diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index bc6af1f..7d3f600 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -403,7 +403,7 @@ function conf_init() {
     include_once './'. conf_path() .'/settings.php';
   }
 
-  // Ignore the placeholder url from default.settings.php.
+  // Ignore the placeholder URL from default.settings.php.
   if (isset($db_url) && $db_url == 'mysql://username:password@localhost/databasename') {
     $db_url = '';
   }
@@ -419,7 +419,7 @@ function conf_init() {
     $base_root = substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
   }
   else {
-    // Create base URL
+    // Create base URL.
     $base_root = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
 
     $base_url = $base_root .= '://'. $_SERVER['HTTP_HOST'];
@@ -442,7 +442,7 @@ function conf_init() {
   }
   else {
     // Otherwise use $base_url as session name, without the protocol
-    // to use the same session identifiers across http and https.
+    // to use the same session identifiers across HTTP and HTTPS.
     list( , $session_name) = explode('://', $base_url, 2);
     // We escape the hostname because it can be modified by a visitor.
     if (!empty($_SERVER['HTTP_HOST'])) {
@@ -459,14 +459,15 @@ function conf_init() {
   // To prevent session cookies from being hijacked, a user can configure the
   // SSL version of their website to only transfer session cookies via SSL by
   // using PHP's session.cookie_secure setting. The browser will then use two
-  // separate session cookies for the HTTPS and HTTP versions of the site. So we
-  // must use different session identifiers for HTTPS and HTTP to prevent a
+  // separate session cookies for the HTTPS and HTTP versions of the site. So
+  // we must use different session identifiers for HTTPS and HTTP to prevent a
   // cookie collision.
   if (ini_get('session.cookie_secure')) {
     $session_name .= 'SSL';
   }
   // Per RFC 2109, cookie domains must contain at least one dot other than the
-  // first. For hosts such as 'localhost' or IP Addresses we don't set a cookie domain.
+  // first. For hosts such as 'localhost' or IP Addresses we don't set a cookie
+  // domain.
   if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
     ini_set('session.cookie_domain', $cookie_domain);
   }
@@ -474,29 +475,29 @@ function conf_init() {
 }
 
 /**
- * Returns and optionally sets the filename for a system item (module,
- * theme, etc.). The filename, whether provided, cached, or retrieved
- * from the database, is only returned if the file exists.
+ * Returns and optionally sets the filename for a system item (module, theme,
+ * etc.). The filename, whether provided, cached, or retrieved from the
+ * database, is only returned if the file exists.
  *
- * This function plays a key role in allowing Drupal's resources (modules
- * and themes) to be located in different places depending on a site's
- * configuration. For example, a module 'foo' may legally be be located
- * in any of these three places:
+ * This function plays a key role in allowing Drupal's resources (modules and
+ * themes) to be located in different places depending on a site's
+ * configuration. For example, a module 'foo' may legally be be located in any
+ * of these three places:
  *
  * modules/foo/foo.module
  * sites/all/modules/foo/foo.module
  * sites/example.com/modules/foo/foo.module
  *
- * Calling drupal_get_filename('module', 'foo') will give you one of
- * the above, depending on where the module is located.
+ * Calling drupal_get_filename('module', 'foo') will give you one of the above,
+ * depending on where the module is located.
  *
  * @param $type
  *   The type of the item (i.e. theme, theme_engine, module, profile).
  * @param $name
  *   The name of the item for which the filename is requested.
  * @param $filename
- *   The filename of the item if it is to be set explicitly rather
- *   than by consulting the database.
+ *   The filename of the item if it is to be set explicitly rather than by
+ *   consulting the database.
  *
  * @return
  *   The filename of the requested item.
@@ -512,18 +513,18 @@ function drupal_get_filename($type, $name, $filename = NULL) {
     $files[$type][$name] = $filename;
   }
   elseif (isset($files[$type][$name])) {
-    // nothing
+    // Nothing.
   }
-  // Verify that we have an active database connection, before querying
-  // the database.  This is required because this function is called both
-  // before we have a database connection (i.e. during installation) and
-  // when a database connection fails.
+  // Verify that we have an active database connection, before querying the
+  // database.  This is required because this function is called both before we
+  // have a database connection (i.e. during installation) and when a database
+  // connection fails.
   elseif (db_is_active() && (($file = db_result(db_query("SELECT filename FROM {system} WHERE name = '%s' AND type = '%s'", $name, $type))) && file_exists($file))) {
     $files[$type][$name] = $file;
   }
   else {
-    // Fallback to searching the filesystem if the database connection is
-    // not established or the requested file is not found.
+    // Fallback to searching the filesystem if the database connection is not
+    // established or the requested file is not found.
     $config = conf_path();
     $dir = (($type == 'theme_engine') ? 'themes/engines' : "${type}s");
     $file = (($type == 'theme_engine') ? "$name.engine" : "$name.$type");
@@ -545,11 +546,12 @@ function drupal_get_filename($type, $name, $filename = NULL) {
  * Load the persistent variable table.
  *
  * The variable table is composed of values that have been saved in the table
- * with variable_set() as well as those explicitly specified in the configuration
- * file.
+ * with variable_set() as well as those explicitly specified in the
+ * configuration file.
  */
 function variable_init($conf = array()) {
-  // NOTE: caching the variables improves performance by 20% when serving cached pages.
+  // NOTE: caching the variables improves performance by 20% when serving
+  // cached pages.
   if ($cached = cache_get('variables', 'cache')) {
     $variables = $cached->data;
   }
@@ -648,8 +650,8 @@ function variable_del($name) {
  * a redirected form submission which was completed).
  *
  * @param $status_only
- *   When set to TRUE, retrieve the status of the page cache only
- *   (whether it was started in this request or not).
+ *   When set to TRUE, retrieve the status of the page cache only (whether it
+ *   was started in this request or not).
  */
 function page_get_cache($status_only = FALSE) {
   static $status = FALSE;
@@ -686,8 +688,8 @@ function bootstrap_invoke_all($hook) {
 }
 
 /**
- * Includes a file with the provided type and name. This prevents
- * including a theme, engine, module, etc., more than once.
+ * Includes a file with the provided type and name. This prevents including a
+ * theme, engine, module, etc., more than once.
  *
  * @param $type
  *   The type of item to load (i.e. theme, theme_engine, module, profile).
@@ -719,9 +721,9 @@ function drupal_load($type, $name) {
 /**
  * Set HTTP headers in preparation for a page response.
  *
- * Authenticated users are always given a 'no-cache' header, and will
- * fetch a fresh page on every request.  This prevents authenticated
- * users seeing locally cached pages that show them as logged out.
+ * Authenticated users are always given a 'no-cache' header, and will fetch a
+ * fresh page on every request.  This prevents authenticated users seeing
+ * locally cached pages that show them as logged out.
  *
  * @see page_set_cache()
  */
@@ -735,10 +737,10 @@ function drupal_page_header() {
 /**
  * Set HTTP headers in preparation for a cached page response.
  *
- * The general approach here is that anonymous users can keep a local
- * cache of the page, but must revalidate it on every request.  Then,
- * they are given a '304 Not Modified' response as long as they stay
- * logged out and the page has not been modified.
+ * The general approach here is that anonymous users can keep a local cache of
+ * the page, but must revalidate it on every request.  Then, they are given a
+ * '304 Not Modified' response as long as they stay logged out and the page has
+ * not been modified.
  *
  */
 function drupal_page_cache_header($cache) {
@@ -751,19 +753,20 @@ function drupal_page_cache_header($cache) {
   $if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : FALSE;
 
   if ($if_modified_since && $if_none_match
-      && $if_none_match == $etag // etag must match
+      && $if_none_match == $etag // etag must match.
       && $if_modified_since == $last_modified) {  // if-modified-since must match
     header($_SERVER['SERVER_PROTOCOL'] .' 304 Not Modified');
-    // All 304 responses must send an etag if the 200 response for the same object contained an etag
+    // All 304 responses must send an etag if the 200 response for the same
+    // object contained an etag.
     header("Etag: $etag");
     return;
   }
 
-  // Send appropriate response:
+  // Send appropriate response.
   header("Last-Modified: $last_modified");
   header("ETag: $etag");
 
-  // The following headers force validation of cache:
+  // The following headers force validation of cache.
   header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
   header("Cache-Control: must-revalidate");
 
@@ -782,9 +785,8 @@ function drupal_page_cache_header($cache) {
     }
   }
 
-  // Send the original request's headers. We send them one after
-  // another so PHP's header() function can deal with duplicate
-  // headers.
+  // Send the original request's headers. We send them one after another so
+  // PHP's header() function can deal with duplicate headers.
   $headers = explode("\n", $cache->headers);
   foreach ($headers as $header) {
     header($header);
@@ -865,9 +867,8 @@ function check_plain($text) {
 /**
  * Checks whether a string is valid UTF-8.
  *
- * All functions designed to filter input should use drupal_validate_utf8
- * to ensure they operate on valid UTF-8 strings to prevent bypass of the
- * filter.
+ * All functions designed to filter input should use drupal_validate_utf8 to
+ * ensure they operate on valid UTF-8 strings to prevent bypass of the filter.
  *
  * When text containing an invalid UTF-8 lead byte (0xC0 - 0xFF) is presented
  * as UTF-8 to Internet Explorer 6, the program may misinterpret subsequent
@@ -900,8 +901,8 @@ function drupal_validate_utf8($text) {
 }
 
 /**
- * Since $_SERVER['REQUEST_URI'] is only available on Apache, we
- * generate an equivalent using other environment variables.
+ * Since $_SERVER['REQUEST_URI'] is only available on Apache, we generate an
+ * equivalent using other environment variables.
  */
 function request_uri() {
 
@@ -932,13 +933,12 @@ function request_uri() {
  *   The category to which this message belongs. Can be any string, but the
  *   general practice is to use the name of the module calling watchdog().
  * @param $message
- *   The message to store in the log. See t() for documentation
- *   on how $message and $variables interact. Keep $message
- *   translatable by not concatenating dynamic values into it!
+ *   The message to store in the log. See t() for documentation on how $message
+ *   and $variables interact. Keep $message translatable by not concatenating
+ *   dynamic values into it!
  * @param $variables
- *   Array of variables to replace in the message on display or
- *   NULL if message is already translated or not possible to
- *   translate.
+ *   Array of variables to replace in the message on display or NULL if message
+ *   is already translated or not possible to translate.
  * @param $severity
  *   The severity of the message, as per RFC 3164. Possible values are
  *   WATCHDOG_ERROR, WATCHDOG_WARNING, etc.
@@ -950,7 +950,7 @@ function request_uri() {
 function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) {
   global $user, $base_root;
 
-  // Prepare the fields to be logged
+  // Prepare the fields to be logged.
   $log_message = array(
     'type'        => $type,
     'message'     => $message,
@@ -964,7 +964,7 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO
     'timestamp'   => time(),
     );
 
-  // Call the logging hooks to log/process the message
+  // Call the logging hooks to log/process the message.
   foreach (module_implements('watchdog') as $module) {
     module_invoke($module, 'watchdog', $log_message);
   }
@@ -1003,7 +1003,7 @@ function drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE) {
     }
   }
 
-  // messages not set when DB connection fails
+  // Messages not set when DB connection fails.
   return isset($_SESSION['messages']) ? $_SESSION['messages'] : NULL;
 }
 
@@ -1053,17 +1053,17 @@ function drupal_get_messages($type = NULL, $clear_queue = TRUE) {
  *     - 'mail': e-mail address
  *     - 'user': username
  * @param $mask string
- *   String or mask to test: '_' matches any character, '%' matches any
- *   number of characters.
+ *   String or mask to test: '_' matches any character, '%' matches any number
+ *   of characters.
  * @return bool
  *   TRUE if access is denied, FALSE if access is allowed.
  */
 function drupal_is_denied($type, $mask) {
-  // Because this function is called for every page request, both cached
-  // and non-cached pages, we tried to optimize it as much as possible.
-  // We deny access if the only matching records in the {access} table have
-  // status 0 (deny). If any have status 1 (allow), or if there are no
-  // matching records, we allow access.
+  // Because this function is called for every page request, both cached and
+  // non-cached pages, we tried to optimize it as much as possible. We deny
+  // access if the only matching records in the {access} table have status 0
+  // (deny). If any have status 1 (allow), or if there are no matching records,
+  // we allow access.
   $sql = "SELECT 1 FROM {access} WHERE type = '%s' AND LOWER('%s') LIKE LOWER(mask) AND status = %d";
   return db_result(db_query_range($sql, $type, $mask, 0, 0, 1)) && !db_result(db_query_range($sql, $type, $mask, 1, 0, 1));
 }
@@ -1094,15 +1094,17 @@ function drupal_anonymous_user($session = '') {
  * @param $phase
  *   A constant. Allowed values are:
  *     DRUPAL_BOOTSTRAP_CONFIGURATION: initialize configuration.
- *     DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE: try to call a non-database cache fetch routine.
+ *     DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE: try to call a non-database cache
+ *       fetch routine.
  *     DRUPAL_BOOTSTRAP_DATABASE: initialize database layer.
  *     DRUPAL_BOOTSTRAP_ACCESS: identify and reject banned hosts.
  *     DRUPAL_BOOTSTRAP_SESSION: initialize session handling.
- *     DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE: load bootstrap.inc and module.inc, start
- *       the variable system and try to serve a page from the cache.
+ *     DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE: load bootstrap.inc and module.inc,
+ *       start the variable system and try to serve a page from the cache.
  *     DRUPAL_BOOTSTRAP_LANGUAGE: identify the language used on the page.
  *     DRUPAL_BOOTSTRAP_PATH: set $_GET['q'] to Drupal path of request.
- *     DRUPAL_BOOTSTRAP_FULL: Drupal is fully loaded, validate and fix input data.
+ *     DRUPAL_BOOTSTRAP_FULL: Drupal is fully loaded, validate and fix input
+ *       data.
  */
 function drupal_bootstrap($phase) {
   static $phases = array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL), $phase_index = 0;
@@ -1128,8 +1130,8 @@ function _drupal_bootstrap($phase) {
       break;
 
     case DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE:
-      // Allow specifying special cache handlers in settings.php, like
-      // using memcached or files for storing cache information.
+      // Allow specifying special cache handlers in settings.php, like using
+      // memcached or files for storing cache information.
       require_once variable_get('cache_inc', './includes/cache.inc');
       // If the page_cache_fastpath is set to TRUE in settings.php and
       // page_cache_fastpath (implemented in the special implementation of
@@ -1166,12 +1168,14 @@ function _drupal_bootstrap($phase) {
       break;
 
     case DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE:
-      // Initialize configuration variables, using values from settings.php if available.
+      // Initialize configuration variables, using values from settings.php if
+      // available.
       $conf = variable_init(isset($conf) ? $conf : array());
       $cache_mode = variable_get('cache', CACHE_DISABLED);
       // Get the page from the cache.
       $cache = $cache_mode == CACHE_DISABLED ? '' : page_get_cache();
-      // If the skipping of the bootstrap hooks is not enforced, call hook_boot.
+      // If the skipping of the bootstrap hooks is not enforced, call
+      // hook_boot.
       if (!$cache || $cache_mode != CACHE_AGGRESSIVE) {
         // Load module handling.
         require_once './includes/module.inc';
@@ -1180,7 +1184,8 @@ function _drupal_bootstrap($phase) {
       // If there is a cached page, display it.
       if ($cache) {
         drupal_page_cache_header($cache);
-        // If the skipping of the bootstrap hooks is not enforced, call hook_exit.
+        // If the skipping of the bootstrap hooks is not enforced, call
+        // hook_exit.
         if ($cache_mode != CACHE_AGGRESSIVE) {
           bootstrap_invoke_all('exit');
         }
@@ -1197,7 +1202,8 @@ function _drupal_bootstrap($phase) {
 
     case DRUPAL_BOOTSTRAP_PATH:
       require_once './includes/path.inc';
-      // Initialize $_GET['q'] prior to loading modules and invoking hook_init().
+      // Initialize $_GET['q'] prior to loading modules and invoking
+      // hook_init().
       drupal_init_path();
       break;
 
@@ -1222,8 +1228,8 @@ function drupal_maintenance_theme() {
 }
 
 /**
- * Return the name of the localisation function. Use in code that needs to
- * run both during installation and normal operation.
+ * Return the name of the localisation function. Use in code that needs to run
+ * both during installation and normal operation.
  */
 function get_t() {
   static $t;
@@ -1239,8 +1245,8 @@ function get_t() {
 function drupal_init_language() {
   global $language, $user;
 
-  // Ensure the language is correctly returned, even without multilanguage support.
-  // Useful for eg. XML/HTML 'lang' attributes.
+  // Ensure the language is correctly returned, even without multilanguage
+  // support. Useful for eg. XML/HTML 'lang' attributes.
   if (variable_get('language_count', 1) == 1) {
     $language = language_default();
   }
@@ -1251,7 +1257,7 @@ function drupal_init_language() {
 }
 
 /**
- * Get a list of languages set up indexed by the specified key
+ * Get a list of languages set up indexed by the specified key.
  *
  * @param $field The field to index the list with.
  * @param $reset Boolean to request a reset of the list.
@@ -1259,12 +1265,12 @@ function drupal_init_language() {
 function language_list($field = 'language', $reset = FALSE) {
   static $languages = NULL;
 
-  // Reset language list
+  // Reset language list.
   if ($reset) {
     $languages = NULL;
   }
 
-  // Init language list
+  // Init language list.
   if (!isset($languages)) {
     if (variable_get('language_count', 1) > 1 || module_exists('locale')) {
       $result = db_query('SELECT * FROM {languages} ORDER BY weight ASC, name ASC');
@@ -1279,11 +1285,11 @@ function language_list($field = 'language', $reset = FALSE) {
     }
   }
 
-  // Return the array indexed by the right field
+  // Return the array indexed by the right field.
   if (!isset($languages[$field])) {
     $languages[$field] = array();
     foreach ($languages['language'] as $lang) {
-      // Some values should be collected into an array
+      // Some values should be collected into an array.
       if (in_array($field, array('enabled', 'weight'))) {
         $languages[$field][$lang->$field][$lang->language] = $lang;
       }
@@ -1296,10 +1302,10 @@ function language_list($field = 'language', $reset = FALSE) {
 }
 
 /**
- * Default language used on the site
+ * Default language used on the site.
  *
  * @param $property
- *   Optional property of the language object to return
+ *   Optional property of the language object to return.
  */
 function language_default($property = NULL) {
   $language = variable_get('language_default', (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => ''));
@@ -1308,8 +1314,8 @@ function language_default($property = NULL) {
 
 /**
  * If Drupal is behind a reverse proxy, we use the X-Forwarded-For header
- * instead of $_SERVER['REMOTE_ADDR'], which would be the IP address
- * of the proxy server, and not the client's.
+ * instead of $_SERVER['REMOTE_ADDR'], which would be the IP address of the
+ * proxy server, and not the client's.
  *
  * @return
  *   IP address of client machine, adjusted for reverse proxy.
@@ -1320,12 +1326,12 @@ function ip_address() {
   if (!isset($ip_address)) {
     $ip_address = $_SERVER['REMOTE_ADDR'];
     if (variable_get('reverse_proxy', 0) && array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
-      // If an array of known reverse proxy IPs is provided, then trust
-      // the XFF header if request really comes from one of them.
+      // If an array of known reverse proxy IPs is provided, then trust the XFF
+      // header if request really comes from one of them.
       $reverse_proxy_addresses = variable_get('reverse_proxy_addresses', array());
       if (!empty($reverse_proxy_addresses) && in_array($ip_address, $reverse_proxy_addresses, TRUE)) {
-        // If there are several arguments, we need to check the most
-        // recently added one, i.e. the last one.
+        // If there are several arguments, we need to check the most recently
+        // added one, i.e. the last one.
         $ip_address_parts = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
         $ip_address = array_pop($ip_address_parts);
       }
diff --git a/includes/common.inc b/includes/common.inc
index 7d0bf85..e6a4a93 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -31,8 +31,8 @@ if (!defined('E_DEPRECATED')) {
 }
 
 /**
- * Error code indicating that the request made by drupal_http_request() exceeded
- * the specified timeout.
+ * Error code indicating that the request made by drupal_http_request()
+ * exceeded the specified timeout.
  */
 define('HTTP_REQUEST_TIMEOUT', -1);
 
@@ -83,8 +83,8 @@ function drupal_get_content($region = NULL, $delimiter = ' ') {
  * Set the breadcrumb trail for the current page.
  *
  * @param $breadcrumb
- *   Array of links, starting with "home" and proceeding up to but not including
- *   the current page.
+ *   Array of links, starting with "home" and proceeding up to but not
+ *   including the current page.
  */
 function drupal_set_breadcrumb($breadcrumb = NULL) {
   static $stored_breadcrumb;
@@ -176,7 +176,7 @@ function drupal_final_markup($content) {
  * Add a feed URL for the current page.
  *
  * @param $url
- *   A url for the feed.
+ *   A URL for the feed.
  * @param $title
  *   The title of the feed.
  */
@@ -222,7 +222,7 @@ function drupal_get_feeds($delimiter = "\n") {
  * @param $parent
  *   Should not be passed, only used in recursive calls.
  * @return
- *   An urlencoded string which can be appended to/as the URL query string.
+ *   A urlencoded string which can be appended to/as the URL query string.
  */
 function drupal_query_string_encode($query, $exclude = array(), $parent = '') {
   $params = array();
@@ -281,13 +281,13 @@ function drupal_get_destination() {
  *
  * Usually the redirected URL is constructed from this function's input
  * parameters. However you may override that behavior by setting a
- * destination in either the $_REQUEST-array (i.e. by using
- * the query string of an URI) or the $_REQUEST['edit']-array (i.e. by
- * using a hidden form field). This is used to direct the user back to
- * the proper page after completing a form. For example, after editing
- * a post on the 'admin/content/node'-page or after having logged on using the
- * 'user login'-block in a sidebar. The function drupal_get_destination()
- * can be used to help set the destination URL.
+ * destination in either the $_REQUEST-array (i.e. by using the query string
+ * of an URI) or the $_REQUEST['edit']-array (i.e. by using a hidden form
+ * field). This is used to direct the user back to the proper page after
+ * completing a form. For example, after editing a post on the
+ * 'admin/content/node'-page or after having logged on using the 'user login'
+ * -block in a sidebar. The function drupal_get_destination() can be used to
+ * help set the destination URL.
  *
  * Drupal will ensure that messages set by drupal_set_message() and other
  * session data are written to the database before the user is redirected.
@@ -298,7 +298,7 @@ function drupal_get_destination() {
  * @param $path
  *   A Drupal path or a full URL.
  * @param $query
- *   A URL-encoded query string to append to the link, or an array of query
+ *   A urlencoded query string to append to the link, or an array of query
  *   key/value-pairs without any URL-encoding. Passed to url().
  * @param $fragment
  *   A destination fragment identifier (named anchor).
@@ -428,8 +428,8 @@ function drupal_access_denied() {
 /**
  * Perform an HTTP request.
  *
- * This is a flexible and powerful HTTP client implementation. Correctly handles
- * GET, POST, PUT or any other HTTP requests. Handles redirects.
+ * This is a flexible and powerful HTTP client implementation. Correctly
+ * handles GET, POST, PUT or any other HTTP requests. Handles redirects.
  *
  * @param $url
  *   A string containing a fully qualified URI.
@@ -444,8 +444,8 @@ function drupal_access_denied() {
  *   redirect.
  * @param $timeout
  *   A float representing the maximum number of seconds the function call may
- *   take. The default is 30 seconds. If a timeout occurs, the error code is set
- *   to the HTTP_REQUEST_TIMEOUT constant.
+ *   take. The default is 30 seconds. If a timeout occurs, the error code is
+ *   set to the HTTP_REQUEST_TIMEOUT constant.
  * @return
  *   An object containing the HTTP request headers, response code, protocol,
  *   status message, headers, data and redirect status.
@@ -516,32 +516,32 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
   // Create HTTP request.
   $defaults = array(
     // RFC 2616: "non-standard ports MUST, default ports MAY be included".
-    // We don't add the port to prevent from breaking rewrite rules checking the
-    // host that do not take into account the port number.
+    // We don't add the port to prevent from breaking rewrite rules checking
+    // the host that do not take into account the port number.
     'Host' => "Host: $host",
     'User-Agent' => 'User-Agent: Drupal (+http://drupal.org/)',
   );
 
   // Only add Content-Length if we actually have any content or if it is a POST
-  // or PUT request. Some non-standard servers get confused by Content-Length in
-  // at least HEAD/GET requests, and Squid always requires Content-Length in
+  // or PUT request. Some non-standard servers get confused by Content-Length
+  // in at least HEAD/GET requests, and Squid always requires Content-Length in
   // POST/PUT requests.
   $content_length = strlen($data);
   if ($content_length > 0 || $method == 'POST' || $method == 'PUT') {
     $defaults['Content-Length'] = 'Content-Length: '. $content_length;
   }
 
-  // If the server url has a user then attempt to use basic authentication
+  // If the server URL has a user then attempt to use basic authentication
   if (isset($uri['user'])) {
     $defaults['Authorization'] = 'Authorization: Basic '. base64_encode($uri['user'] . (!empty($uri['pass']) ? ":". $uri['pass'] : ''));
   }
 
-  // If the database prefix is being used by SimpleTest to run the tests in a copied
-  // database then set the user-agent header to the database prefix so that any
-  // calls to other Drupal pages will run the SimpleTest prefixed database. The
-  // user-agent is used to ensure that multiple testing sessions running at the
-  // same time won't interfere with each other as they would if the database
-  // prefix were stored statically in a file or database variable.
+  // If the database prefix is being used by SimpleTest to run the tests in a
+  // copied database then set the user-agent header to the database prefix so
+  // that any calls to other Drupal pages will run the SimpleTest prefixed
+  // database. The user-agent is used to ensure that multiple testing sessions
+  // running at the same time won't interfere with each other as they would if
+  // the database prefix were stored statically in a file or database variable.
   if (is_string($db_prefix) && preg_match("/^simpletest\d+$/", $db_prefix, $matches)) {
     $defaults['User-Agent'] = 'User-Agent: ' . $matches[0];
   }
@@ -612,8 +612,8 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
     400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Time-out', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Large', 415 => 'Unsupported Media Type', 416 => 'Requested range not satisfiable', 417 => 'Expectation Failed',
     500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Time-out', 505 => 'HTTP Version not supported'
   );
-  // RFC 2616 states that all unknown HTTP codes must be treated the same as the
-  // base code in their class.
+  // RFC 2616 states that all unknown HTTP codes must be treated the same as
+  // the base code in their class.
   if (!isset($responses[$code])) {
     $code = floor($code / 100) * 100;
   }
@@ -708,8 +708,9 @@ function _fix_gpc_magic(&$item) {
 }
 
 /**
- * Helper function to strip slashes from $_FILES skipping over the tmp_name keys
- * since PHP generates single backslashes for file paths on Windows systems.
+ * Helper function to strip slashes from $_FILES skipping over the tmp_name
+ * keys since PHP generates single backslashes for file paths on Windows
+ * systems.
  *
  * tmp_name does not have backslashes added see
  * http://php.net/manual/en/features.file-upload.php#42280
@@ -726,7 +727,8 @@ function _fix_gpc_magic_files(&$item, $key) {
 }
 
 /**
- * Fix double-escaping problems caused by "magic quotes" in some PHP installations.
+ * Fix double-escaping problems caused by "magic quotes" in some PHP
+ * installations.
  */
 function fix_gpc_magic() {
   static $fixed = FALSE;
@@ -743,8 +745,8 @@ function fix_gpc_magic() {
 /**
  * Translate strings to the page language or a given language.
  *
- * Human-readable text that will be displayed somewhere within a page should
- * be run through the t() function.
+ * Human-readable text that will be displayed somewhere within a page should be
+ * run through the t() function.
  *
  * Examples:
  * @code
@@ -758,13 +760,13 @@ function fix_gpc_magic() {
  *   );
  * @endcode
  *
- * Any text within t() can be extracted by translators and changed into
- * the equivalent text in their native language.
+ * Any text within t() can be extracted by translators and changed into the
+ * equivalent text in their native language.
  *
  * Special variables called "placeholders" are used to signal dynamic
- * information in a string which should not be translated. Placeholders
- * can also be used for text that may change from time to time (such as
- * link paths) to be changed without requiring updates to translations.
+ * information in a string which should not be translated. Placeholders can
+ * also be used for text that may change from time to time (such as link paths)
+ * to be changed without requiring updates to translations.
  *
  * For example:
  * @code
@@ -1050,7 +1052,8 @@ function valid_url($url, $absolute = FALSE) {
  */
 
 /**
- * Register an event for the current visitor (hostname/IP) to the flood control mechanism.
+ * Register an event for the current visitor (hostname/IP) to the flood control
+ * mechanism.
  *
  * @param $name
  *   The name of an event.
@@ -1060,10 +1063,11 @@ function flood_register_event($name) {
 }
 
 /**
- * Check if the current visitor (hostname/IP) is allowed to proceed with the specified event.
+ * Check if the current visitor (hostname/IP) is allowed to proceed with the
+ * specified event.
  *
- * The user is allowed to proceed if he did not trigger the specified event more
- * than $threshold times per hour.
+ * The user is allowed to proceed if he did not trigger the specified event
+ * more than $threshold times per hour.
  *
  * @param $name
  *   The name of the event.
@@ -1198,16 +1202,17 @@ function format_xml_elements($array) {
  *   The item count to display.
  * @param $singular
  *   The string for the singular case. Please make sure it is clear this is
- *   singular, to ease translation (e.g. use "1 new comment" instead of "1 new").
- *   Do not use @count in the singular string.
+ *   singular, to ease translation (e.g. use "1 new comment" instead of "1
+ *   new"). Do not use @count in the singular string.
  * @param $plural
- *   The string for the plural case. Please make sure it is clear this is plural,
- *   to ease translation. Use @count in place of the item count, as in "@count
- *   new comments".
+ *   The string for the plural case. Please make sure it is clear this is
+ *   plural, to ease translation. Use @count in place of the item count, as in
+ *   "@count new comments".
  * @param $args
  *   An associative array of replacements to make after translation. Incidences
  *   of any key in this array are replaced with the corresponding value.
- *   Based on the first character of the key, the value is escaped and/or themed:
+ *   Based on the first character of the key, the value is escaped and/or
+ *   themed:
  *    - !variable: inserted as is
  *    - @variable: escape plain text to HTML (check_plain)
  *    - %variable: escape text and theme as a placeholder for user-submitted
@@ -1301,8 +1306,8 @@ function format_size($size, $langcode = NULL) {
  * @param $granularity
  *   How many different units to display in the string.
  * @param $langcode
- *   Optional language code to translate to a language other than
- *   what is used to display the page.
+ *   Optional language code to translate to a language other than what is used
+ *   to display the page.
  * @return
  *   A translated string representation of the interval.
  */
@@ -1334,8 +1339,9 @@ function format_interval($timestamp, $granularity = 2, $langcode = NULL) {
  * @param $timestamp
  *   The exact date to format, as a UNIX timestamp.
  * @param $type
- *   The format to use. Can be "small", "medium" or "large" for the preconfigured
- *   date formats. If "custom" is specified, then $format is required as well.
+ *   The format to use. Can be "small", "medium" or "large" for the
+ *   preconfigured date formats. If "custom" is specified, then $format is
+ *   required as well.
  * @param $format
  *   A PHP date format string as required by date(). A backslash should be used
  *   before a character to avoid interpreting the character as part of a date
@@ -1385,8 +1391,8 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
     }
     else if ($c == 'F') {
       // Special treatment for long month names: May is both an abbreviation
-      // and a full month name in English, but other languages have
-      // different abbreviations.
+      // and a full month name in English, but other languages have different
+      // abbreviations.
       $date .= trim(t('!long-month-name '. gmdate($c, $timestamp), array('!long-month-name' => ''), $langcode));
     }
     else if (strpos('BdgGhHiIjLmnsStTUwWYyz', $c) !== FALSE) {
@@ -1431,9 +1437,9 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
  *     and it will be replaced with the alias, if one exists. Additional query
  *     arguments for internal paths must be supplied in $options['query'], not
  *     included in $path.
- *   - If you provide an internal path and $options['alias'] is set to TRUE, the
- *     path is assumed already to be the correct path alias, and the alias is
- *     not looked up.
+ *   - If you provide an internal path and $options['alias'] is set to TRUE,
+ *     the path is assumed already to be the correct path alias, and the alias
+ *     is not looked up.
  *   - The special string '<front>' generates a link to the site's base URL.
  *   - If your external URL contains a query (e.g. http://example.com/foo?a=b),
  *     then you can either URL encode the query keys and values yourself and
@@ -1441,13 +1447,13 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
  *     URL encode them.
  * @param $options
  *   An associative array of additional options, with the following elements:
- *   - 'query': A URL-encoded query string to append to the link, or an array of
+ *   - 'query': A urlencoded query string to append to the link, or an array of
  *     query key/value-pairs without any URL-encoding.
  *   - 'fragment': A fragment identifier (named anchor) to append to the URL.
  *     Do not include the leading '#' character.
- *   - 'absolute' (default FALSE): Whether to force the output to be an absolute
- *     link (beginning with http:). Useful for links that will be displayed
- *     outside the site, such as in an RSS feed.
+ *   - 'absolute' (default FALSE): Whether to force the output to be an
+ *     absolute link (beginning with http:). Useful for links that will be
+ *     displayed outside the site, such as in an RSS feed.
  *   - 'alias' (default FALSE): Whether the given path is a URL alias already.
  *   - 'external': Whether the given path is an external URL.
  *   - 'language': An optional language object. Used to build the URL to link
@@ -2586,8 +2592,8 @@ function drupal_json($var = NULL) {
  * Wrapper around urlencode() which avoids Apache quirks.
  *
  * Should be used when placing arbitrary data in an URL. Note that Drupal paths
- * are urlencoded() when passed through url() and do not require urlencoding()
- * of individual components.
+ * are urlencoded when passed through url() and do not require urlencoding() of
+ * individual components.
  *
  * Notes:
  * - For esthetic reasons, we do not escape slashes. This also avoids a 'feature'
@@ -3289,8 +3295,8 @@ function drupal_common_theme() {
 /**
  * Get the schema definition of a table, or the whole database schema.
  *
- * The returned schema will include any modifications made by any
- * module that implements hook_schema_alter().
+ * The returned schema will include any modifications made by any module that
+ * implements hook_schema_alter().
  *
  * @param $table
  *   The name of the table. If not given, the schema of all tables is returned.
@@ -3314,8 +3320,9 @@ function drupal_get_schema($table = NULL, $rebuild = FALSE) {
       // Invoke hook_schema for all modules.
       foreach (module_implements('schema') as $module) {
         // Cast the result of hook_schema() to an array, as a NULL return value
-        // would cause array_merge() to set the $schema variable to NULL as well.
-        // That would break modules which use $schema further down the line.
+        // would cause array_merge() to set the $schema variable to NULL as
+        // well. That would break modules which use $schema further down the
+        // line.
         $current = (array) module_invoke($module, 'schema');
         _drupal_initialize_schema($module, $current);
         $schema = array_merge($schema, $current);
@@ -3390,26 +3397,24 @@ function drupal_uninstall_schema($module) {
 /**
  * Returns the unprocessed and unaltered version of a module's schema.
  *
- * Use this function only if you explicitly need the original
- * specification of a schema, as it was defined in a module's
- * hook_schema(). No additional default values will be set,
- * hook_schema_alter() is not invoked and these unprocessed
- * definitions won't be cached.
+ * Use this function only if you explicitly need the original specification of
+ * a schema, as it was defined in a module's hook_schema(). No additional
+ * default values will be set, hook_schema_alter() is not invoked and these
+ * unprocessed definitions won't be cached.
  *
  * This function can be used to retrieve a schema specification in
  * hook_schema(), so it allows you to derive your tables from existing
  * specifications.
  *
- * It is also used by drupal_install_schema() and
- * drupal_uninstall_schema() to ensure that a module's tables are
- * created exactly as specified without any changes introduced by a
- * module that implements hook_schema_alter().
+ * It is also used by drupal_install_schema() and drupal_uninstall_schema() to
+ * ensure that a module's tables are created exactly as specified without any
+ * changes introduced by a module that implements hook_schema_alter().
  *
  * @param $module
  *   The module to which the table belongs.
  * @param $table
- *   The name of the table. If not given, the module's complete schema
- *   is returned.
+ *   The name of the table. If not given, the module's complete schema is
+ *   returned.
  */
 function drupal_get_schema_unprocessed($module, $table = NULL) {
   // Load the .install file to get hook_schema.
@@ -3475,8 +3480,8 @@ function drupal_schema_fields_sql($table, $prefix = NULL) {
 /**
  * Save a record to the database based upon the schema.
  *
- * Default values are filled in for missing items, and 'serial' (auto increment)
- * types are filled in with IDs.
+ * Default values are filled in for missing items, and 'serial' (auto
+ * increment) types are filled in with IDs.
  *
  * @param $table
  *   The name of the table; this must exist in schema API.
@@ -3487,7 +3492,8 @@ function drupal_schema_fields_sql($table, $prefix = NULL) {
  * @param $update
  *   If this is an update, specify the primary keys' field names. It is the
  *   caller's responsibility to know if a record for this object already
- *   exists in the database. If there is only 1 key, you may pass a simple string.
+ *   exists in the database. If there is only 1 key, you may pass a simple
+ *   string.
  * @return
  *   Failure to write a record will return FALSE. Otherwise SAVED_NEW or
  *   SAVED_UPDATED is returned depending on the operation performed. The
@@ -3525,7 +3531,7 @@ function drupal_write_record($table, &$object, $update = array()) {
       continue;
     }
 
-    // For inserts, populate defaults from Schema if not already provided
+    // For inserts, populate defaults from Schema if not already provided.
     if (!isset($object->$field) && !count($update) && isset($info['default'])) {
       $object->$field = $info['default'];
     }
@@ -3641,7 +3647,8 @@ function drupal_write_record($table, &$object, $update = array()) {
  * Information stored in the module.info file:
  * - name: The real name of the module for display purposes.
  * - description: A brief description of the module.
- * - dependencies: An array of shortnames of other modules this module depends on.
+ * - dependencies: An array of shortnames of other modules this module depends
+ *   on.
  * - package: The name of the package of modules this module belongs to.
  *
  * Example of .info file:
@@ -3682,19 +3689,19 @@ function drupal_parse_info_file($filename) {
     )\s*$                           # Stop at the next end of a line, ignoring trailing whitespace
     @msx', $data, $matches, PREG_SET_ORDER)) {
     foreach ($matches as $match) {
-      // Fetch the key and value string
+      // Fetch the key and value string.
       $i = 0;
       foreach (array('key', 'value1', 'value2', 'value3') as $var) {
         $$var = isset($match[++$i]) ? $match[$i] : '';
       }
       $value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3;
 
-      // Parse array syntax
+      // Parse array syntax.
       $keys = preg_split('/\]?\[/', rtrim($key, ']'));
       $last = array_pop($keys);
       $parent = &$info;
 
-      // Create nested arrays
+      // Create nested arrays.
       foreach ($keys as $key) {
         if ($key == '') {
           $key = count($parent);
@@ -3710,7 +3717,7 @@ function drupal_parse_info_file($filename) {
         $value = $constants[$value];
       }
 
-      // Insert actual value
+      // Insert actual value.
       if ($last == '') {
         $last = count($parent);
       }
@@ -3755,9 +3762,9 @@ function drupal_explode_tags($tags) {
 
   $tags = array();
   foreach ($typed_tags as $tag) {
-    // If a user has escaped a term (to demonstrate that it is a group,
-    // or includes a comma or quote character), we remove the escape
-    // formatting so to save the term into the database as the user intends.
+    // If a user has escaped a term (to demonstrate that it is a group, or
+    // includes a comma or quote character), we remove the escape formatting so
+    // to save the term into the database as the user intends.
     $tag = trim(str_replace('""', '"', preg_replace('/^"(.*)"$/', '\1', $tag)));
     if ($tag != "") {
       $tags[] = $tag;
@@ -3798,8 +3805,8 @@ function drupal_flush_all_caches() {
   drupal_clear_css_cache();
   drupal_clear_js_cache();
 
-  // If invoked from update.php, we must not update the theme information in the
-  // database, or this will result in all themes being disabled.
+  // If invoked from update.php, we must not update the theme information in
+  // the database, or this will result in all themes being disabled.
   if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update') {
     _system_theme_data();
   }
@@ -3822,11 +3829,11 @@ function drupal_flush_all_caches() {
 /**
  * Helper function to change query-strings on css/js files.
  *
- * Changes the character added to all css/js files as dummy query-string,
- * so that all browsers are forced to reload fresh files. We keep
- * 20 characters history (FIFO) to avoid repeats, but only the first
- * (newest) character is actually used on urls, to keep them short.
- * This is also called from update.php.
+ * Changes the character added to all css/js files as dummy query-string, so
+ * that all browsers are forced to reload fresh files. We keep 20 characters
+ * history (FIFO) to avoid repeats, but only the first (newest) character is
+ * actually used on URLs, to keep them short. This is also called from
+ * update.php.
  */
 function _drupal_flush_css_js() {
   $string_history = variable_get('css_js_query_string', '00000000000000000000');
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc
index 37e4ae5..80c70bd 100644
--- a/includes/database.mysql.inc
+++ b/includes/database.mysql.inc
@@ -50,14 +50,14 @@ function db_version() {
 function db_connect($url) {
   $url = parse_url($url);
 
-  // Check if MySQL support is present in PHP
+  // Check if MySQL support is present in PHP.
   if (!function_exists('mysql_connect')) {
     _db_error_page('Unable to use the MySQL database because the MySQL extension for PHP is not installed. Check your <code>php.ini</code> to see how you can enable it.');
   }
 
-  // Decode url-encoded information in the db connection string
+  // Decode urlencoded information in the db connection string.
   $url['user'] = urldecode($url['user']);
-  // Test if database url has a password.
+  // Test if database URL has a password.
   $url['pass'] = isset($url['pass']) ? urldecode($url['pass']) : '';
   $url['host'] = urldecode($url['host']);
   $url['path'] = urldecode($url['path']);
@@ -68,14 +68,13 @@ function db_connect($url) {
   }
 
   // - TRUE makes mysql_connect() always open a new link, even if
-  //   mysql_connect() was called before with the same parameters.
-  //   This is important if you are using two databases on the same
-  //   server.
-  // - 2 means CLIENT_FOUND_ROWS: return the number of found
-  //   (matched) rows, not the number of affected rows.
+  //   mysql_connect() was called before with the same parameters. This is
+  //   important if you are using two databases on the same server.
+  // - 2 means CLIENT_FOUND_ROWS: return the number of found (matched) rows,
+  //   not the number of affected rows.
   $connection = @mysql_connect($url['host'], $url['user'], $url['pass'], TRUE, 2);
   if (!$connection || !mysql_select_db(substr($url['path'], 1))) {
-    // Show error screen otherwise
+    // Show error screen otherwise.
     _db_error_page(mysql_error());
   }
 
@@ -101,9 +100,10 @@ function _db_query($query, $debug = 0) {
   if (variable_get('dev_query', 0)) {
     list($usec, $sec) = explode(' ', microtime());
     $timer = (float)$usec + (float)$sec;
-    // If devel.module query logging is enabled, prepend a comment with the username and calling function
-    // to the SQL string. This is useful when running mysql's SHOW PROCESSLIST to learn what exact
-    // code is issueing the slow query.
+    // If devel.module query logging is enabled, prepend a comment with the
+    // username and calling function to the SQL string. This is useful when
+    // running MySQL's SHOW PROCESSLIST to learn what exact code is issueing
+    // the slow query.
     $bt = debug_backtrace();
     // t() may not be available yet so we don't wrap 'Anonymous'.
     $name = $user->uid ? $user->name : variable_get('anonymous', 'Anonymous');
@@ -143,8 +143,8 @@ function _db_query($query, $debug = 0) {
  * @param $result
  *   A database query result resource, as returned from db_query().
  * @return
- *   An object representing the next row of the result, or FALSE. The attributes
- *   of this object are the table fields selected by the query.
+ *   An object representing the next row of the result, or FALSE. The
+ *   attributes of this object are the table fields selected by the query.
  */
 function db_fetch_object($result) {
   if ($result) {
@@ -182,8 +182,8 @@ function db_fetch_array($result) {
  */
 function db_result($result) {
   if ($result && mysql_num_rows($result) > 0) {
-    // The mysql_fetch_row function has an optional second parameter $row
-    // but that can't be used for compatibility with Oracle, DB2, etc.
+    // The mysql_fetch_row function has an optional second parameter $row but
+    // that can't be used for compatibility with Oracle, DB2, etc.
     $array = mysql_fetch_row($result);
     return $array[0];
   }
@@ -211,20 +211,20 @@ function db_affected_rows() {
  *
  * Use this as a substitute for db_query() when a subset of the query is to be
  * returned.
- * User-supplied arguments to the query should be passed in as separate parameters
- * so that they can be properly escaped to avoid SQL injection attacks.
+ * User-supplied arguments to the query should be passed in as separate
+ * parameters so that they can be properly escaped to avoid SQL injection
+ * attacks.
  *
  * @param $query
  *   A string containing an SQL query.
  * @param ...
- *   A variable number of arguments which are substituted into the query
- *   using printf() syntax. The query arguments can be enclosed in one
- *   array instead.
- *   Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose
- *   in '') and %%.
+ *   A variable number of arguments which are substituted into the query using
+ *   printf() syntax. The query arguments can be enclosed in one array instead.
+ *   Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose in '')
+ *   and %%.
  *
- *   NOTE: using this syntax will cast NULL and FALSE values to decimal 0,
- *   and TRUE values to decimal 1.
+ *   NOTE: using this syntax will cast NULL and FALSE values to decimal 0, and
+ *   TRUE values to decimal 1.
  *
  * @param $from
  *   The first result row to return.
@@ -241,7 +241,8 @@ function db_query_range($query) {
   array_shift($args);
 
   $query = db_prefix_tables($query);
-  if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax
+  // 'All arguments in one array' syntax.
+  if (isset($args[0]) and is_array($args[0])) {
     $args = $args[0];
   }
   _db_query_callback($args, TRUE);
@@ -256,8 +257,9 @@ function db_query_range($query) {
  * Use this as a substitute for db_query() when the results need to be stored
  * in a temporary table.
  *
- * User-supplied arguments to the query should be passed in as separate parameters
- * so that they can be properly escaped to avoid SQL injection attacks.
+ * User-supplied arguments to the query should be passed in as separate
+ * parameters so that they can be properly escaped to avoid SQL injection
+ * attacks.
  *
  * Note that if you need to know how many results were returned, you should do
  * a SELECT COUNT(*) on the temporary table afterwards. db_affected_rows() does
@@ -266,11 +268,10 @@ function db_query_range($query) {
  * @param $query
  *   A string containing a normal SELECT SQL query.
  * @param ...
- *   A variable number of arguments which are substituted into the query
- *   using printf() syntax. The query arguments can be enclosed in one
- *   array instead.
- *   Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose
- *   in '') and %%.
+ *   A variable number of arguments which are substituted into the query using
+ *   printf() syntax. The query arguments can be enclosed in one array instead.
+ *   Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose in '')
+ *   and %%.
  *
  *   NOTE: using this syntax will cast NULL and FALSE values to decimal 0,
  *   and TRUE values to decimal 1.
@@ -288,7 +289,8 @@ function db_query_temporary($query) {
   array_shift($args);
 
   $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE '. $tablename .' Engine=HEAP SELECT', db_prefix_tables($query));
-  if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax
+  // 'All arguments in one array' syntax.
+  if (isset($args[0]) and is_array($args[0])) {
     $args = $args[0];
   }
   _db_query_callback($args, TRUE);
@@ -322,7 +324,8 @@ function db_decode_blob($data) {
 }
 
 /**
- * Prepare user input for use in a database query, preventing SQL injection attacks.
+ * Prepare user input for use in a database query, preventing SQL injection
+ * attacks.
  */
 function db_escape_string($text) {
   global $active_db;
diff --git a/includes/database.mysqli.inc b/includes/database.mysqli.inc
index c984c10..68c995a 100644
--- a/includes/database.mysqli.inc
+++ b/includes/database.mysqli.inc
@@ -54,16 +54,16 @@ function db_version() {
  * Note that mysqli does not support persistent connections.
  */
 function db_connect($url) {
-  // Check if MySQLi support is present in PHP
+  // Check if MySQLi support is present in PHP.
   if (!function_exists('mysqli_init') && !extension_loaded('mysqli')) {
     _db_error_page('Unable to use the MySQLi database because the MySQLi extension for PHP is not installed. Check your <code>php.ini</code> to see how you can enable it.');
   }
 
   $url = parse_url($url);
 
-  // Decode url-encoded information in the db connection string
+  // Decode urlencoded information in the db connection string.
   $url['user'] = urldecode($url['user']);
-  // Test if database url has a password.
+  // Test if database URL has a password.
   $url['pass'] = isset($url['pass']) ? urldecode($url['pass']) : '';
   $url['host'] = urldecode($url['host']);
   $url['path'] = urldecode($url['path']);
@@ -100,11 +100,12 @@ function _db_query($query, $debug = 0) {
   if (variable_get('dev_query', 0)) {
     list($usec, $sec) = explode(' ', microtime());
     $timer = (float)$usec + (float)$sec;
-    // If devel.module query logging is enabled, prepend a comment with the username and calling function
-    // to the SQL string. This is useful when running mysql's SHOW PROCESSLIST to learn what exact
-    // code is issueing the slow query.
+    // If devel.module query logging is enabled, prepend a comment with the
+    // username and calling function to the SQL string. This is useful when
+    // running mysql's SHOW PROCESSLIST to learn what exact code is issueing
+    // the slow query.
     $bt = debug_backtrace();
-    // t() may not be available yet so we don't wrap 'Anonymous'
+    // t() may not be available yet so we don't wrap 'Anonymous'.
     $name = $user->uid ? $user->name : variable_get('anonymous', 'Anonymous');
     // str_replace() to prevent SQL injection via username or anonymous name.
     $name = str_replace(array('*', '/'), '', $name);
@@ -142,8 +143,8 @@ function _db_query($query, $debug = 0) {
  * @param $result
  *   A database query result resource, as returned from db_query().
  * @return
- *   An object representing the next row of the result, or FALSE. The attributes
- *   of this object are the table fields selected by the query.
+ *   An object representing the next row of the result, or FALSE. The
+ *   attributes of this object are the table fields selected by the query.
  */
 function db_fetch_object($result) {
   if ($result) {
@@ -182,8 +183,8 @@ function db_fetch_array($result) {
  */
 function db_result($result) {
   if ($result && mysqli_num_rows($result) > 0) {
-    // The mysqli_fetch_row function has an optional second parameter $row
-    // but that can't be used for compatibility with Oracle, DB2, etc.
+    // The mysqli_fetch_row function has an optional second parameter $row but
+    // that can't be used for compatibility with Oracle, DB2, etc.
     $array = mysqli_fetch_row($result);
     return $array[0];
   }
@@ -211,20 +212,20 @@ function db_affected_rows() {
  *
  * Use this as a substitute for db_query() when a subset of the query is to be
  * returned.
- * User-supplied arguments to the query should be passed in as separate parameters
- * so that they can be properly escaped to avoid SQL injection attacks.
+ * User-supplied arguments to the query should be passed in as separate
+ * parameters so that they can be properly escaped to avoid SQL injection
+ * attacks.
  *
  * @param $query
  *   A string containing an SQL query.
  * @param ...
- *   A variable number of arguments which are substituted into the query
- *   using printf() syntax. The query arguments can be enclosed in one
- *   array instead.
- *   Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose
- *   in '') and %%.
+ *   A variable number of arguments which are substituted into the query using
+ *   printf() syntax. The query arguments can be enclosed in one array instead.
+ *   Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose in '')
+ *   and %%.
  *
- *   NOTE: using this syntax will cast NULL and FALSE values to decimal 0,
- *   and TRUE values to decimal 1.
+ *   NOTE: using this syntax will cast NULL and FALSE values to decimal 0, and
+ *   TRUE values to decimal 1.
  *
  * @param $from
  *   The first result row to return.
@@ -256,8 +257,9 @@ function db_query_range($query) {
  * Use this as a substitute for db_query() when the results need to be stored
  * in a temporary table.
  * 
- * User-supplied arguments to the query should be passed in as separate parameters
- * so that they can be properly escaped to avoid SQL injection attacks.
+ * User-supplied arguments to the query should be passed in as separate
+ * parameters so that they can be properly escaped to avoid SQL injection
+ * attacks.
  *
  * Note that if you need to know how many results were returned, you should do
  * a SELECT COUNT(*) on the temporary table afterwards. db_affected_rows() does
@@ -266,14 +268,13 @@ function db_query_range($query) {
  * @param $query
  *   A string containing a normal SELECT SQL query.
  * @param ...
- *   A variable number of arguments which are substituted into the query
- *   using printf() syntax. The query arguments can be enclosed in one
- *   array instead.
- *   Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose
- *   in '') and %%.
+ *   A variable number of arguments which are substituted into the query using
+ *   printf() syntax. The query arguments can be enclosed in one array instead.
+ *   Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose in '')
+ *   and %%.
  *
- *   NOTE: using this syntax will cast NULL and FALSE values to decimal 0,
- *   and TRUE values to decimal 1.
+ *   NOTE: using this syntax will cast NULL and FALSE values to decimal 0, and
+ *   TRUE values to decimal 1.
  * @param $table
  *   The name of the temporary table to select into. This name will not be
  *   prefixed as there is no risk of collision.
@@ -288,7 +289,8 @@ function db_query_temporary($query) {
   array_shift($args);
 
   $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE '. $tablename .' Engine=HEAP SELECT', db_prefix_tables($query));
-  if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax
+  // 'All arguments in one array' syntax.
+  if (isset($args[0]) and is_array($args[0])) {
     $args = $args[0];
   }
   _db_query_callback($args, TRUE);
@@ -322,7 +324,8 @@ function db_decode_blob($data) {
 }
 
 /**
- * Prepare user input for use in a database query, preventing SQL injection attacks.
+ * Prepare user input for use in a database query, preventing SQL injection
+ * attacks.
  */
 function db_escape_string($text) {
   global $active_db;
@@ -374,4 +377,3 @@ function db_column_exists($table, $column) {
 /**
  * @} End of "ingroup database".
  */
-
diff --git a/includes/file.inc b/includes/file.inc
index bbcf9dc..bcc2210 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -25,8 +25,9 @@ define('FILE_EXISTS_ERROR', 2);
  * is temporary Drupal's file garbage collection will delete the file and
  * remove it from the files table after a set period of time.
  *
- * If you wish to add custom statuses for use by contrib modules please expand as
- * binary flags and consider the first 8 bits reserved. (0,1,2,4,8,16,32,64,128)
+ * If you wish to add custom statuses for use by contrib modules please expand
+ * as binary flags and consider the first 8 bits reserved. (0, 1, 2, 4, 8, 16,
+ * 32, 64, 128)
  */
 define('FILE_STATUS_TEMPORARY', 0);
 define('FILE_STATUS_PERMANENT', 1);
@@ -38,7 +39,8 @@ define('FILE_STATUS_PERMANENT', 1);
  * @return A string containing a URL that can be used to download the file.
  */
 function file_create_url($path) {
-  // Strip file_directory_path from $path. We only include relative paths in urls.
+  // Strip file_directory_path from $path. We only include relative paths in
+  // URLs.
   if (strpos($path, file_directory_path() .'/') === 0) {
     $path = trim(substr($path, strlen(file_directory_path())), '\\/');
   }
@@ -65,11 +67,13 @@ function file_create_path($dest = 0) {
   if (!$dest) {
     return $file_path;
   }
-  // file_check_location() checks whether the destination is inside the Drupal files directory.
+  // file_check_location() checks whether the destination is inside the Drupal
+  // files directory.
   if (file_check_location($dest, $file_path)) {
     return $dest;
   }
-  // check if the destination is instead inside the Drupal temporary files directory.
+  // Check if the destination is instead inside the Drupal temporary files
+  // directory.
   else if (file_check_location($dest, file_directory_temp())) {
     return $dest;
   }
@@ -95,15 +99,15 @@ function file_create_path($dest = 0) {
  *   the directory. Any combination of the actions FILE_CREATE_DIRECTORY and
  *   FILE_MODIFY_PERMISSIONS is allowed.
  * @param $form_item
- *   An optional string containing the name of a form item that any errors
- *   will be attached to. Useful when the function validates a directory path
+ *   An optional string containing the name of a form item that any errors will
+ *   be attached to. Useful when the function validates a directory path
  *   entered as a form value. An error will consequently prevent form submit
  *   handlers from running, and instead display the form along with the
  *   error messages.
  *
  * @return
- *   FALSE if the directory does not exist or is not writable, even after
- *   any optional actions have been carried out. Otherwise, TRUE is returned.
+ *   FALSE if the directory does not exist or is not writable, even after any
+ *   optional actions have been carried out. Otherwise, TRUE is returned.
  */
 function file_check_directory(&$directory, $mode = 0, $form_item = NULL) {
   $directory = rtrim($directory, '/\\');
@@ -194,7 +198,7 @@ function file_check_location($source, $directory = '') {
     $source = $check;
   }
   else {
-    // This file does not yet exist
+    // This file does not yet exist.
     $source = realpath(dirname($source)) .'/'. basename($source);
   }
   $directory = realpath($directory);
@@ -211,8 +215,8 @@ function file_check_location($source, $directory = '') {
  * version of copy().
  * - Checks if $source and $dest are valid and readable/writable.
  * - Performs a file copy if $source is not equal to $dest.
- * - If file already exists in $dest either the call will error out, replace the
- *   file or rename the file based on the $replace parameter.
+ * - If file already exists in $dest either the call will error out, replace
+ *   the file or rename the file based on the $replace parameter.
  *
  * @param $source
  *   Either a string specifying the file location of the original file or an
@@ -260,13 +264,14 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
     return 0;
   }
 
-  // If the destination file is not specified then use the filename of the source file.
+  // If the destination file is not specified then use the filename of the
+  // source file.
   $basename = $basename ? $basename : basename($source);
   $dest = $directory .'/'. $basename;
 
-  // Make sure source and destination filenames are not the same, makes no sense
-  // to copy it if they are. In fact copying the file will most likely result in
-  // a 0 byte file. Which is bad. Real bad.
+  // Make sure source and destination filenames are not the same, makes no
+  // sense to copy it if they are. In fact copying the file will most likely
+  // result in a 0 byte file. Which is bad. Real bad.
   if ($source != realpath($dest)) {
     if (!$dest = file_destination($dest, $replace)) {
       drupal_set_message(t('The selected file %file could not be copied, because a file by that name already exists in the destination.', array('%file' => $source)), 'error');
@@ -278,9 +283,8 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
       return 0;
     }
 
-    // Give everyone read access so that FTP'd users or
-    // non-webserver users can see/read these files,
-    // and give group write permissions so group members
+    // Give everyone read access so that FTP'd users or non-webserver users can
+    // see/read these files, and give group write permissions so group members
     // can alter files uploaded by the webserver.
     @chmod($dest, 0664);
   }
@@ -294,7 +298,8 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
     $source = $dest;
   }
 
-  return 1; // Everything went ok.
+  // Everything went ok.
+  return 1;
 }
 
 /**
@@ -332,8 +337,8 @@ function file_destination($destination, $replace) {
  *
  * - Checks if $source and $dest are valid and readable/writable.
  * - Performs a file move if $source is not equal to $dest.
- * - If file already exists in $dest either the call will error out, replace the
- *   file or rename the file based on the $replace parameter.
+ * - If file already exists in $dest either the call will error out, replace
+ *   the file or rename the file based on the $replace parameter.
  *
  * @param $source
  *   Either a string specifying the file location of the original file or an
@@ -385,7 +390,8 @@ function file_move(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
  *
  * Function behavior is also controlled by the Drupal variable
  * 'allow_insecure_uploads'. If 'allow_insecure_uploads' evaluates to TRUE, no
- * alterations will be made, if it evaluates to FALSE, the filename is 'munged'.
+ * alterations will be made, if it evaluates to FALSE, the filename is
+ * 'munged'.
  *
  * @param $filename
  *   File name to modify.
@@ -401,7 +407,7 @@ function file_move(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
 function file_munge_filename($filename, $extensions, $alerts = TRUE) {
   $original = $filename;
 
-  // Allow potentially insecure uploads for very savvy users and admin
+  // Allow potentially insecure uploads for very savvy users and admin.
   if (!variable_get('allow_insecure_uploads', 0)) {
     $whitelist = array_unique(explode(' ', trim($extensions)));
 
@@ -487,8 +493,8 @@ function file_delete($path) {
  * Determine total disk space used by a single user or the whole filesystem.
  *
  * @param $uid
- *   An optional user id. A NULL value returns the total space used
- *   by all files.
+ *   An optional user id. A NULL value returns the total space used by all
+ *   files.
  */
 function file_space_used($uid = NULL) {
   if (isset($uid)) {
@@ -500,9 +506,9 @@ function file_space_used($uid = NULL) {
 /**
  * Saves a file upload to a new location.
  *
- * The source file is validated as a proper upload and handled as such.
- * The file will be added to the files table as a temporary file. Temporary
- * files are periodically cleaned. To make the file permanent file call
+ * The source file is validated as a proper upload and handled as such. The
+ * file will be added to the files table as a temporary file. Temporary files
+ * are periodically cleaned. To make the file permanent file call
  * file_set_status() to change its status.
  *
  * @param $source
@@ -510,18 +516,18 @@ function file_space_used($uid = NULL) {
  * @param $validators
  *   (optional) An associative array of callback functions used to validate the
  *   file. The keys are function names and the values arrays of callback
- *   parameters which will be passed in after the file object. The
- *   functions should return an array of error messages; an empty array
- *   indicates that the file passed validation. The functions will be called in
- *   the order specified.
+ *   parameters which will be passed in after the file object. The functions
+ *   should return an array of error messages; an empty array indicates that
+ *   the file passed validation. The functions will be called in the order
+ *   specified.
  * @param $dest
  *   A string containing the directory $source should be copied to. If this is
  *   not provided or is not writable, the temporary directory will be used.
  * @param $replace
  *   Replace behavior when the destination file already exists:
  *   - FILE_EXISTS_REPLACE: Replace the existing file.
- *   - FILE_EXISTS_RENAME: Append _{incrementing number} until the filename
- *     is unique.
+ *   - FILE_EXISTS_RENAME: Append _{incrementing number} until the filename is
+ *     unique.
  *   - FILE_EXISTS_ERROR: Do nothing and return FALSE.
  *
  * @return
@@ -534,16 +540,16 @@ function file_save_upload($source, $validators = array(), $dest = FALSE, $replac
   // Add in our check of the the file name length.
   $validators['file_validate_name_length'] = array();
 
-  // Return cached objects without processing since the file will have
-  // already been processed and the paths in _FILES will be invalid.
+  // Return cached objects without processing since the file will have already
+  // been processed and the paths in _FILES will be invalid.
   if (isset($upload_cache[$source])) {
     return $upload_cache[$source];
   }
 
   // If a file was uploaded, process it.
   if (isset($_FILES['files']) && $_FILES['files']['name'][$source] && is_uploaded_file($_FILES['files']['tmp_name'][$source])) {
-    // Check for file upload errors and return FALSE if a
-    // lower level system error occurred.
+    // Check for file upload errors and return FALSE if a lower level system
+    // error occurred.
     switch ($_FILES['files']['error'][$source]) {
       // @see http://php.net/manual/en/features.file-upload.errors.php
       case UPLOAD_ERR_OK:
@@ -559,14 +565,14 @@ function file_save_upload($source, $validators = array(), $dest = FALSE, $replac
         drupal_set_message(t('The file %file could not be saved, because the upload did not complete.', array('%file' => $source)), 'error');
         return 0;
 
-        // Unknown error
+      // Unknown error.
       default:
         drupal_set_message(t('The file %file could not be saved. An unknown error has occurred.', array('%file' => $source)), 'error');
         return 0;
     }
 
     // Build the list of non-munged extensions.
-    // @todo: this should not be here. we need to figure out the right place.
+    // @todo this should not be here. we need to figure out the right place.
     $extensions = '';
     foreach ($user->roles as $rid => $name) {
       $extensions .= ' '. variable_get("upload_extensions_$rid",
@@ -623,8 +629,9 @@ function file_save_upload($source, $validators = array(), $dest = FALSE, $replac
       return 0;
     }
 
-    // Move uploaded files from PHP's upload_tmp_dir to Drupal's temporary directory.
-    // This overcomes open_basedir restrictions for future file operations.
+    // Move uploaded files from PHP's upload_tmp_dir to Drupal's temporary
+    // directory. This overcomes open_basedir restrictions for future file
+    // operations.
     $file->filepath = $file->destination;
     if (!move_uploaded_file($_FILES['files']['tmp_name'][$source], $file->filepath)) {
       form_set_error($source, t('File upload error. Could not move uploaded file.'));
@@ -701,10 +708,11 @@ function file_validate_extensions($file, $extensions) {
  *   An integer specifying the maximum file size in bytes. Zero indicates that
  *   no limit should be enforced.
  * @param $user_limit
- *   An integer specifying the maximum number of bytes the user is allowed. Zero
- *   indicates that no limit should be enforced.
+ *   An integer specifying the maximum number of bytes the user is allowed.
+ *   Zero indicates that no limit should be enforced.
  * @return
- *   An array. If the file size exceeds limits, it will contain an error message.
+ *   An array. If the file size exceeds limits, it will contain an error
+ *   message.
  */
 function file_validate_size($file, $file_limit = 0, $user_limit = 0) {
   global $user;
@@ -805,7 +813,8 @@ function file_validate_image_resolution(&$file, $maximum_dimensions = 0, $minimu
  * @param $dest A string containing the destination location.
  * @param $replace Replace behavior when the destination file already exists.
  *   - FILE_EXISTS_REPLACE - Replace the existing file
- *   - FILE_EXISTS_RENAME - Append _{incrementing number} until the filename is unique
+ *   - FILE_EXISTS_RENAME - Append _{incrementing number} until the filename is
+ *     unique
  *   - FILE_EXISTS_ERROR - Do nothing and return FALSE.
  *
  * @return A string containing the resulting filename or 0 on error
@@ -850,11 +859,11 @@ function file_set_status(&$file, $status) {
 }
 
 /**
- * Transfer file using http to client. Pipes a file through Drupal to the
+ * Transfer file using HTTP to client. Pipes a file through Drupal to the
  * client.
  *
  * @param $source File to transfer.
- * @param $headers An array of http headers to send along with file.
+ * @param $headers An array of HTTP headers to send along with file.
  */
 function file_transfer($source, $headers) {
   if (ob_get_level()) {
@@ -862,7 +871,7 @@ function file_transfer($source, $headers) {
   }
   
   // IE cannot download private files because it cannot store files downloaded
-  // over https in the browser cache. The problem can be solved by sending
+  // over HTTPS in the browser cache. The problem can be solved by sending
   // custom headers to IE. See http://support.microsoft.com/kb/323308/en-us
   if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) {
     drupal_set_header('Cache-Control: private');
@@ -870,8 +879,8 @@ function file_transfer($source, $headers) {
   }
 
   foreach ($headers as $header) {
-    // To prevent HTTP header injection, we delete new lines that are
-    // not followed by a space or a tab.
+    // To prevent HTTP header injection, we delete new lines that are not
+    // followed by a space or a tab.
     // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
     $header = preg_replace('/\r?\n(?!\t| )/', '', $header);
     drupal_set_header($header);
@@ -925,9 +934,9 @@ function file_download() {
 /**
  * Finds all files that match a given mask in a given directory.
  *
- * Directories and files beginning with a period are excluded; this
- * prevents hidden files and directories (such as SVN working directories)
- * from being scanned.
+ * Directories and files beginning with a period are excluded; this prevents
+ * hidden files and directories (such as SVN working directories) from being
+ * scanned.
  *
  * @param $dir
  *   The base directory for the scan, without trailing slash.
@@ -964,11 +973,13 @@ function file_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS'), $ca
     while (FALSE !== ($file = readdir($handle))) {
       if (!in_array($file, $nomask) && $file[0] != '.') {
         if (is_dir("$dir/$file") && $recurse) {
-          // Give priority to files in this folder by merging them in after any subdirectory files.
+          // Give priority to files in this folder by merging them in after any
+          // subdirectory files.
           $files = array_merge(file_scan_directory("$dir/$file", $mask, $nomask, $callback, $recurse, $key, $min_depth, $depth + 1), $files);
         }
         elseif ($depth >= $min_depth && @ereg($mask, $file)) {
-          // Always use this match over anything already set in $files with the same $$key.
+          // Always use this match over anything already set in $files with the
+          // same $$key.
           $filename = "$dir/$file";
           $basename = basename($file);
           $name = substr($basename, 0, strrpos($basename, '.'));
@@ -1022,7 +1033,8 @@ function file_directory_temp() {
       }
     }
 
-    // if a directory has been found, use it, otherwise default to 'files/tmp' or 'files\\tmp';
+    // If a directory has been found, use it, otherwise default to 'files/tmp'
+    // or 'files\\tmp';
     $temporary_directory = $temporary_directory ? $temporary_directory : file_directory_path() . $path_delimiter .'tmp';
     variable_set('file_directory_temp', $temporary_directory);
   }
@@ -1043,7 +1055,8 @@ function file_directory_path() {
  * Determine the maximum file upload size by querying the PHP settings.
  *
  * @return
- *   A file size limit in bytes based on the PHP upload_max_filesize and post_max_size
+ *   A file size limit in bytes based on the PHP upload_max_filesize and
+ *   post_max_size.
  */
 function file_upload_max_size() {
   static $max_size = -1;
@@ -1066,7 +1079,8 @@ function file_upload_max_size() {
  *   'extension1|extension2|...' => 'type'.
  *
  * @return
- *   The internet media type registered for the extension or application/octet-stream for unknown extensions.
+ *   The internet media type registered for the extension or
+ *   application/octet-stream for unknown extensions.
  */
 function file_get_mimetype($filename, $mapping = NULL) {
   if (!is_array($mapping)) {
diff --git a/includes/form.inc b/includes/form.inc
index e6d2a6a..f09184d 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -5,10 +5,10 @@
  * @{
  * Functions that build an abstract representation of a HTML form.
  *
- * All modules should declare their form builder functions to be in this
- * group and each builder function should reference its validate and submit
- * functions using \@see. Conversely, validate and submit functions should
- * reference the form builder function using \@see. For examples, of this see
+ * All modules should declare their form builder functions to be in this group
+ * and each builder function should reference its validate and submit functions
+ * using \@see. Conversely, validate and submit functions should reference the
+ * form builder function using \@see. For examples, of this see
  * system_modules_uninstall() or user_pass(), the latter of which has the
  * following in its doxygen documentation:
  *
@@ -24,9 +24,9 @@
  * @{
  * Functions to enable the processing and display of HTML forms.
  *
- * Drupal uses these functions to achieve consistency in its form processing and
- * presentation, while simplifying code and reducing the amount of HTML that
- * must be explicitly generated by modules.
+ * Drupal uses these functions to achieve consistency in its form processing
+ * and presentation, while simplifying code and reducing the amount of HTML
+ * that must be explicitly generated by modules.
  *
  * The drupal_get_form() function handles retrieving, processing, and
  * displaying a rendered HTML form for modules automatically. For example:
@@ -36,13 +36,14 @@
  * $output = drupal_get_form('user_register');
  * @endcode
  *
- * Forms can also be built and submitted programmatically without any user input
- * using the drupal_execute() function.
+ * Forms can also be built and submitted programmatically without any user
+ * input using the drupal_execute() function.
  *
  * For information on the format of the structured arrays used to define forms,
- * and more detailed explanations of the Form API workflow, see the
- * @link http://api.drupal.org/api/file/developer/topics/forms_api_reference.html/6 reference @endlink
- * and the @link http://drupal.org/node/204270 Form API guide. @endlink
+ * and more detailed explanations of the Form API workflow, see the @link
+ * http://api.drupal.org/api/file/developer/topics/forms_api_reference.html/6
+ * reference @endlink and the @link http://drupal.org/node/204270 Form API
+ * guide. @endlink
  */
 
 /**
@@ -51,19 +52,20 @@
  * on for processing, after and rendered for display if necessary.
  *
  * @param $form_id
- *   The unique string identifying the desired form. If a function
- *   with that name exists, it is called to build the form array.
- *   Modules that need to generate the same form (or very similar forms)
- *   using different $form_ids can implement hook_forms(), which maps
- *   different $form_id values to the proper form constructor function. Examples
- *   may be found in node_forms(), search_forms(), and user_forms().
+ *   The unique string identifying the desired form. If a function with that
+ *   name exists, it is called to build the form array. Modules that need to
+ *   generate the same form (or very similar forms) using different $form_ids
+ *   can implement hook_forms(), which maps different $form_id values to the
+ *   proper form constructor function. Examples may be found in node_forms(),
+ *   search_forms(), and user_forms().
  * @param ...
  *   Any additional arguments are passed on to the functions called by
- *   drupal_get_form(), including the unique form constructor function.
- *   For example, the node_edit form requires that a node object be passed
- *   in here when it is called. These are available to implementations of
+ *   drupal_get_form(), including the unique form constructor function. For
+ *   example, the node_edit form requires that a node object be passed in here
+ *   when it is called. These are available to implementations of
  *   hook_form_alter() and hook_form_FORM_ID_alter() as the array
  *   $form['#parameters'].
+ *
  * @return
  *   The rendered form.
  */
@@ -81,21 +83,21 @@ function drupal_get_form($form_id) {
     unset($_SESSION['batch_form_state']);
   }
   else {
-    // If the incoming $_POST contains a form_build_id, we'll check the
-    // cache for a copy of the form in question. If it's there, we don't
-    // have to rebuild the form to proceed. In addition, if there is stored
-    // form_state data from a previous step, we'll retrieve it so it can
-    // be passed on to the form processing code.
+    // If the incoming $_POST contains a form_build_id, we'll check the cache
+    // for a copy of the form in question. If it's there, we don't have to
+    // rebuild the form to proceed. In addition, if there is stored form_state
+    // data from a previous step, we'll retrieve it so it can be passed on to
+    // the form processing code.
     if (isset($_POST['form_id']) && $_POST['form_id'] == $form_id && !empty($_POST['form_build_id'])) {
       $form = form_get_cache($_POST['form_build_id'], $form_state);
     }
 
-    // If the previous bit of code didn't result in a populated $form
-    // object, we're hitting the form for the first time and we need
-    // to build it from scratch.
+    // If the previous bit of code didn't result in a populated $form object,
+    // we're hitting the form for the first time and we need to build it from
+    // scratch.
     if (!isset($form)) {
       $form_state['post'] = $_POST;
-      // Use a copy of the function's arguments for manipulation
+      // Use a copy of the function's arguments for manipulation.
       $args_temp = $args;
       $args_temp[0] = &$form_state;
       array_unshift($args_temp, $form_id);
@@ -126,25 +128,23 @@ function drupal_get_form($form_id) {
   }
 
   // Most simple, single-step forms will be finished by this point --
-  // drupal_process_form() usually redirects to another page (or to
-  // a 'fresh' copy of the form) once processing is complete. If one
-  // of the form's handlers has set $form_state['redirect'] to FALSE,
-  // the form will simply be re-rendered with the values still in its
-  // fields.
+  // drupal_process_form() usually redirects to another page (or to a 'fresh'
+  // copy of the form) once processing is complete. If one of the form's
+  // handlers has set $form_state['redirect'] to FALSE, the form will simply be
+  // re-rendered with the values still in its fields.
   //
-  // If $form_state['storage'] or $form_state['rebuild'] has been set
-  // and input has been processed, we know that we're in a complex
-  // multi-part process of some sort and the form's workflow is NOT
-  // complete. We need to construct a fresh copy of the form, passing
-  // in the latest $form_state in addition to any other variables passed
-  // into drupal_get_form().
+  // If $form_state['storage'] or $form_state['rebuild'] has been set and input
+  // has been processed, we know that we're in a complex multi-part process of
+  // some sort and the form's workflow is NOT complete. We need to construct a
+  // fresh copy of the form, passing in the latest $form_state in addition to
+  // any other variables passed into drupal_get_form().
 
   if ((!empty($form_state['storage']) || !empty($form_state['rebuild'])) && !empty($form_state['process_input']) && !form_get_errors()) {
     $form = drupal_rebuild_form($form_id, $form_state, $args);
   }
 
-  // If we haven't redirected to a new location by now, we want to
-  // render whatever form array is currently in hand.
+  // If we haven't redirected to a new location by now, we want to render
+  // whatever form array is currently in hand.
   return drupal_render_form($form_id, $form);
 }
 
@@ -163,15 +163,15 @@ function drupal_get_form($form_id) {
  * part.
  *
  * @param $form_id
- *   The unique string identifying the desired form. If a function
- *   with that name exists, it is called to build the form array.
- *   Modules that need to generate the same form (or very similar forms)
- *   using different $form_ids can implement hook_forms(), which maps
- *   different $form_id values to the proper form constructor function. Examples
- *   may be found in node_forms(), search_forms(), and user_forms().
+ *   The unique string identifying the desired form. If a function with that
+ *   name exists, it is called to build the form array. Modules that need to
+ *   generate the same form (or very similar forms) using different $form_ids
+ *   can implement hook_forms(), which maps different $form_id values to the
+ *   proper form constructor function. Examples may be found in node_forms(),
+ *   search_forms(), and user_forms().
  * @param $form_state
- *   A keyed array containing the current state of the form. Most
- *   important is the $form_state['storage'] collection.
+ *   A keyed array containing the current state of the form. Most important is
+ *   the $form_state['storage'] collection.
  * @param $args
  *   Any additional arguments are passed on to the functions called by
  *   drupal_get_form(), plus the original form_state in the beginning. If you
@@ -182,6 +182,7 @@ function drupal_get_form($form_id) {
  *   If the AHAH callback calling this function only alters part of the form,
  *   then pass in the existing form_build_id so we can re-cache with the same
  *   csid.
+ *
  * @return
  *   The newly built form.
  */
@@ -206,9 +207,9 @@ function drupal_rebuild_form($form_id, &$form_state, $args, $form_build_id = NUL
   // it so that it can be used to resume complex multi-step processes.
   form_set_cache($form_build_id, $form, $form_state);
 
-  // Clear out all post data, as we don't want the previous step's
-  // data to pollute this one and trigger validate/submit handling,
-  // then process the form for rendering.
+  // Clear out all post data, as we don't want the previous step's data to
+  // pollute this one and trigger validate/submit handling, then process the
+  // form for rendering.
   $_POST = array();
   $form['#post'] = array();
   drupal_process_form($form_id, $form, $form_state);
@@ -259,25 +260,24 @@ function form_get_cache($form_build_id, &$form_state) {
  * calling form_get_errors().
  *
  * @param $form_id
- *   The unique string identifying the desired form. If a function
- *   with that name exists, it is called to build the form array.
- *   Modules that need to generate the same form (or very similar forms)
- *   using different $form_ids can implement hook_forms(), which maps
- *   different $form_id values to the proper form constructor function. Examples
- *   may be found in node_forms(), search_forms(), and user_forms().
+ *   The unique string identifying the desired form. If a function with that
+ *   name exists, it is called to build the form array. Modules that need to
+ *   generate the same form (or very similar forms) using different $form_ids
+ *   can implement hook_forms(), which maps different $form_id values to the
+ *   proper form constructor function. Examples may be found in node_forms(),
+ *   search_forms(), and user_forms().
  * @param $form_state
- *   A keyed array containing the current state of the form. Most
- *   important is the $form_state['values'] collection, a tree of data
- *   used to simulate the incoming $_POST information from a user's
- *   form submission.
+ *   A keyed array containing the current state of the form. Most important is
+ *   the $form_state['values'] collection, a tree of data used to simulate the
+ *   incoming $_POST information from a user's form submission.
  * @param ...
  *   Any additional arguments are passed on to the functions called by
- *   drupal_execute(), including the unique form constructor function.
- *   For example, the node_edit form requires that a node object be passed
- *   in here when it is called.
+ *   drupal_execute(), including the unique form constructor function. For
+ *   example, the node_edit form requires that a node object be passed in here
+ *   when it is called.
  * For example:
  * @code
- * // register a new user
+ * // Register a new user.
  * $form_state = array();
  * $form_state['values']['name'] = 'robo-user';
  * $form_state['values']['mail'] = 'robouser@example.com';
@@ -286,7 +286,7 @@ function form_get_cache($form_build_id, &$form_state) {
  * $form_state['values']['op'] = t('Create new account');
  * drupal_execute('user_register', $form_state);
  *
- * // Create a new node
+ * // Create a new node.
  * $form_state = array();
  * module_load_include('inc', 'node', 'node.pages');
  * $node = array('type' => 'story');
@@ -318,27 +318,26 @@ function drupal_execute($form_id, &$form_state) {
  * Retrieves the structured array that defines a given form.
  *
  * @param $form_id
- *   The unique string identifying the desired form. If a function
- *   with that name exists, it is called to build the form array.
- *   Modules that need to generate the same form (or very similar forms)
- *   using different $form_ids can implement hook_forms(), which maps
- *   different $form_id values to the proper form constructor function.
+ *   The unique string identifying the desired form. If a function with that
+ *   name exists, it is called to build the form array. Modules that need to
+ *   generate the same form (or very similar forms) using different $form_ids
+ *   can implement hook_forms(), which maps different $form_id values to the
+ *   proper form constructor function.
  * @param $form_state
  *   A keyed array containing the current state of the form.
  * @param ...
- *   Any additional arguments needed by the unique form constructor
- *   function. Generally, these are any arguments passed into the
- *   drupal_get_form() or drupal_execute() functions after the first
- *   argument. If a module implements hook_forms(), it can examine
- *   these additional arguments and conditionally return different
- *   builder functions as well.
+ *   Any additional arguments needed by the unique form constructor function.
+ *   Generally, these are any arguments passed into the drupal_get_form() or
+ *   drupal_execute() functions after the first argument. If a module
+ *   implements hook_forms(), it can examine these additional arguments and
+ *   conditionally return different builder functions as well.
  */
 function drupal_retrieve_form($form_id, &$form_state) {
   static $forms;
 
-  // We save two copies of the incoming arguments: one for modules to use
-  // when mapping form ids to constructor functions, and another to pass to
-  // the constructor function itself. We shift out the first argument -- the
+  // We save two copies of the incoming arguments: one for modules to use when
+  // mapping form ids to constructor functions, and another to pass to the
+  // constructor function itself. We shift out the first argument -- the
   // $form_id itself -- from the list to pass into the constructor function,
   // since it's already known.
   $args = func_get_args();
@@ -348,20 +347,21 @@ function drupal_retrieve_form($form_id, &$form_state) {
     array_shift($args);
   }
 
-  // We first check to see if there's a function named after the $form_id.
-  // If there is, we simply pass the arguments on to it to get the form.
+  // We first check to see if there's a function named after the $form_id. If
+  // there is, we simply pass the arguments on to it to get the form.
   if (!function_exists($form_id)) {
-    // In cases where many form_ids need to share a central constructor function,
-    // such as the node editing form, modules can implement hook_forms(). It
-    // maps one or more form_ids to the correct constructor functions.
+    // In cases where many form_ids need to share a central constructor
+    // function, such as the node editing form, modules can implement
+    // hook_forms(). It maps one or more form_ids to the correct constructor
+    // functions.
     //
-    // We cache the results of that hook to save time, but that only works
-    // for modules that know all their form_ids in advance. (A module that
-    // adds a small 'rate this comment' form to each comment in a list
-    // would need a unique form_id for each one, for example.)
+    // We cache the results of that hook to save time, but that only works for
+    // modules that know all their form_ids in advance. (A module that adds a
+    // small 'rate this comment' form to each comment in a list would would
+    // need a unique form_id for each one, for example.)
     //
-    // So, we call the hook if $forms isn't yet populated, OR if it doesn't
-    // yet have an entry for the requested form_id.
+    // So, we call the hook if $forms isn't yet populated, OR if it doesn't yet
+    // have an entry for the requested form_id.
     if (!isset($forms) || !isset($forms[$form_id])) {
       $forms = module_invoke_all('forms', $form_id, $args);
     }
@@ -382,43 +382,42 @@ function drupal_retrieve_form($form_id, &$form_state) {
   $form = call_user_func_array(isset($callback) ? $callback : $form_id, $args);
 
   // We store the original function arguments, rather than the final $arg
-  // value, so that form_alter functions can see what was originally
-  // passed to drupal_retrieve_form(). This allows the contents of #parameters
-  // to be saved and passed in at a later date to recreate the form.
+  // value, so that form_alter functions can see what was originally passed to
+  // drupal_retrieve_form(). This allows the contents of #parameters to be
+  // saved and passed in at a later date to recreate the form.
   $form['#parameters'] = $saved_args;
   return $form;
 }
 
 /**
- * This function is the heart of form API. The form gets built, validated and in
- * appropriate cases, submitted.
+ * This function is the heart of form API. The form gets built, validated and
+ * in appropriate cases, submitted.
  *
  * @param $form_id
  *   The unique string identifying the current form.
  * @param $form
  *   An associative array containing the structure of the form.
  * @param $form_state
- *   A keyed array containing the current state of the form. This
- *   includes the current persistent storage data for the form, and
- *   any data passed along by earlier steps when displaying a
- *   multi-step form. Additional information, like the sanitized $_POST
- *   data, is also accumulated here.
+ *   A keyed array containing the current state of the form. This includes the
+ *   current persistent storage data for the form, and any data passed along by
+ *   earlier steps when displaying a multi-step form. Additional information,
+ *   like the sanitized $_POST data, is also accumulated here.
  */
 function drupal_process_form($form_id, &$form, &$form_state) {
   $form_state['values'] = array();
 
   $form = form_builder($form_id, $form, $form_state);
-  // Only process the form if it is programmed or the form_id coming
-  // from the POST data is set and matches the current form_id.
+  // Only process the form if it is programmed or the form_id coming from the
+  // POST data is set and matches the current form_id.
   if ((!empty($form['#programmed'])) || (!empty($form['#post']) && (isset($form['#post']['form_id']) && ($form['#post']['form_id'] == $form_id)))) {
     $form_state['process_input'] = TRUE;
     drupal_validate_form($form_id, $form, $form_state);
 
-    // form_clean_id() maintains a cache of element IDs it has seen,
-    // so it can prevent duplicates. We want to be sure we reset that
-    // cache when a form is processed, so scenerios that result in
-    // the form being built behind the scenes and again for the
-    // browser don't increment all the element IDs needlessly.
+    // form_clean_id() maintains a cache of element IDs it has seen, so it can
+    // prevent duplicates. We want to be sure we reset that cache when a form
+    // is processed, so scenerios that result in the form being built behind
+    // the scenes and again for the browser don't increment all the element IDs
+    // needlessly.
     form_clean_id(NULL, TRUE);
 
     if ((!empty($form_state['submitted'])) && !form_get_errors() && empty($form_state['rebuild'])) {
@@ -438,25 +437,24 @@ function drupal_process_form($form_id, &$form, &$form_state) {
       // that is already being processed (if a batch operation performs a
       // drupal_execute).
       if ($batch =& batch_get() && !isset($batch['current_set'])) {
-        // The batch uses its own copies of $form and $form_state for
-        // late execution of submit handers and post-batch redirection.
+        // The batch uses its own copies of $form and $form_state for late
+        // execution of submit handers and post-batch redirection.
         $batch['form'] = $form;
         $batch['form_state'] = $form_state;
         $batch['progressive'] = !$form['#programmed'];
         batch_process();
         // Execution continues only for programmatic forms.
-        // For 'regular' forms, we get redirected to the batch processing
-        // page. Form redirection will be handled in _batch_finished(),
-        // after the batch is processed.
+        // For 'regular' forms, we get redirected to the batch processing page.
+        // Form redirection will be handled in _batch_finished(), after the
+        // batch is processed.
       }
 
       // If no submit handlers have populated the $form_state['storage']
-      // bundle, and the $form_state['rebuild'] flag has not been set,
-      // we're finished and should redirect to a new destination page
-      // if one has been set (and a fresh, unpopulated copy of the form
-      // if one hasn't). If the form was called by drupal_execute(),
-      // however, we'll skip this and let the calling function examine
-      // the resulting $form_state bundle itself.
+      // bundle, and the $form_state['rebuild'] flag has not been set, we're
+      // finished and should redirect to a new destination page if one has been
+      // set (and a fresh, unpopulated copy of the form if one hasn't). If the
+      // form was called by drupal_execute(), however, we'll skip this and let
+      // the calling function examine the resulting $form_state bundle itself.
       if (!$form['#programmed'] && empty($form_state['rebuild']) && empty($form_state['storage'])) {
         drupal_redirect_form($form, $form_state['redirect']);
       }
@@ -465,18 +463,18 @@ function drupal_process_form($form_id, &$form, &$form_state) {
 }
 
 /**
- * Prepares a structured form array by adding required elements,
- * executing any hook_form_alter functions, and optionally inserting
- * a validation token to prevent tampering.
+ * Prepares a structured form array by adding required elements, executing any
+ * hook_form_alter functions, and optionally inserting a validation token to
+ * prevent tampering.
  *
  * @param $form_id
- *   A unique string identifying the form for validation, submission,
- *   theming, and hook_form_alter functions.
+ *   A unique string identifying the form for validation, submission, theming,
+ *   and hook_form_alter functions.
  * @param $form
  *   An associative array containing the structure of the form.
  * @param $form_state
- *   A keyed array containing the current state of the form. Passed
- *   in here so that hook_form_alter() calls can use it, as well.
+ *   A keyed array containing the current state of the form. Passed in here so
+ *   that hook_form_alter() calls can use it, as well.
  */
 function drupal_prepare_form($form_id, &$form, &$form_state) {
   global $user;
@@ -545,37 +543,37 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
   // the __drupal_alter_by_ref key, we can store any additional parameters
   // that need to be altered, and they'll be split out into additional params
   // for the hook_form_alter() implementations.
-  // @todo: Remove this in Drupal 7.
+  // @todo Remove this in Drupal 7.
   $data = &$form;
   $data['__drupal_alter_by_ref'] = array(&$form_state);
   drupal_alter('form_'. $form_id, $data);
 
-  // __drupal_alter_by_ref is unset in the drupal_alter() function, we need
-  // to repopulate it to ensure both calls get the data.
+  // __drupal_alter_by_ref is unset in the drupal_alter() function, we need to
+  // repopulate it to ensure both calls get the data.
   $data['__drupal_alter_by_ref'] = array(&$form_state);
   drupal_alter('form', $data, $form_id);
 }
 
 
 /**
- * Validates user-submitted form data from the $form_state using
- * the validate functions defined in a structured form array.
+ * Validates user-submitted form data from the $form_state using the validate
+ * functions defined in a structured form array.
  *
  * @param $form_id
- *   A unique string identifying the form for validation, submission,
- *   theming, and hook_form_alter functions.
+ *   A unique string identifying the form for validation, submission, theming,
+ *   and hook_form_alter functions.
  * @param $form
  *   An associative array containing the structure of the form.
  * @param $form_state
- *   A keyed array containing the current state of the form. The current
- *   user-submitted data is stored in $form_state['values'], though
- *   form validation functions are passed an explicit copy of the
- *   values for the sake of simplicity. Validation handlers can also
- *   $form_state to pass information on to submit handlers. For example:
+ *   A keyed array containing the current state of the form. The current user-
+ *   -submitted data is stored in $form_state['values'], though form validation
+ *   functions are passed an explicit copy of the values for the sake of
+ *   simplicity. Validation handlers can also $form_state to pass information
+ *   on to submit handlers. For example:
  *     $form_state['data_for_submision'] = $data;
- *   This technique is useful when validation requires file parsing,
- *   web service requests, or other expensive requests that should
- *   not be repeated in the submission step.
+ *   This technique is useful when validation requires file parsing, web
+ *   service requests, or other expensive requests that should not be repeated
+ *   in the submission step.
  */
 function drupal_validate_form($form_id, $form, &$form_state) {
   static $validated_forms = array();
@@ -601,10 +599,11 @@ function drupal_validate_form($form_id, $form, &$form_state) {
  * Renders a structured form array into themed HTML.
  *
  * @param $form_id
- *   A unique string identifying the form for validation, submission,
- *   theming, and hook_form_alter functions.
+ *   A unique string identifying the form for validation, submission, theming,
+ *   and hook_form_alter functions.
  * @param $form
  *   An associative array containing the structure of the form.
+ *
  * @return
  *   A string containing the themed HTML.
  */
@@ -628,8 +627,8 @@ function drupal_render_form($form_id, &$form) {
  * @param $form
  *   An associative array containing the structure of the form.
  * @param $redirect
- *   An optional value containing the destination path to redirect
- *   to if none is specified by the form.
+ *   An optional value containing the destination path to redirect to if none
+ *   is specified by the form.
  */
 function drupal_redirect_form($form, $redirect = NULL) {
   $goto = NULL;
@@ -660,18 +659,18 @@ function drupal_redirect_form($form, $redirect = NULL) {
  * @param $elements
  *   An associative array containing the structure of the form.
  * @param $form_state
- *   A keyed array containing the current state of the form. The current
- *   user-submitted data is stored in $form_state['values'], though
- *   form validation functions are passed an explicit copy of the
- *   values for the sake of simplicity. Validation handlers can also
- *   $form_state to pass information on to submit handlers. For example:
+ *   A keyed array containing the current state of the form. The current user-
+ *   -submitted data is stored in $form_state['values'], though form validation
+ *   functions are passed an explicit copy of the values for the sake of
+ *   simplicity. Validation handlers can also $form_state to pass information
+ *   on to submit handlers. For example:
  *     $form_state['data_for_submision'] = $data;
- *   This technique is useful when validation requires file parsing,
- *   web service requests, or other expensive requests that should
- *   not be repeated in the submission step.
+ *   This technique is useful when validation requires file parsing, web
+ *   service requests, or other expensive requests that should not be repeated
+ *   in the submission step.
  * @param $form_id
- *   A unique string identifying the form for validation, submission,
- *   theming, and hook_form_alter functions.
+ *   A unique string identifying the form for validation, submission, theming,
+ *   and hook_form_alter functions.
  */
 function _form_validate($elements, &$form_state, $form_id = NULL) {
   static $complete_form;
@@ -725,8 +724,8 @@ function _form_validate($elements, &$form_state, $form_id = NULL) {
     }
 
     // Call user-defined form level validators and store a copy of the full
-    // form so that element-specific validators can examine the entire structure
-    // if necessary.
+    // form so that element-specific validators can examine the entire
+    // structure if necessary.
     if (isset($form_id)) {
       form_execute_handlers('validate', $elements, $form_state);
       $complete_form = $elements;
@@ -750,8 +749,8 @@ function _form_validate($elements, &$form_state, $form_id = NULL) {
  * first. If none exist, the function falls back to form-level handlers.
  *
  * @param $type
- *   The type of handler to execute. 'validate' or 'submit' are the
- *   defaults used by Form API.
+ *   The type of handler to execute. 'validate' or 'submit' are the defaults
+ *   used by Form API.
  * @param $form
  *   An associative array containing the structure of the form.
  * @param $form_state
@@ -773,13 +772,13 @@ function form_execute_handlers($type, &$form, &$form_state) {
 
   foreach ($handlers as $function) {
     if (function_exists($function))  {
-      // Check to see if a previous _submit handler has set a batch, but 
-      // make sure we do not react to a batch that is already being processed 
-      // (for instance if a batch operation performs a drupal_execute()).
+      // Check to see if a previous _submit handler has set a batch, but make
+      // sure we do not react to a batch that is already being processed (for
+      // instance if a batch operation performs a drupal_execute()).
       if ($type == 'submit' && ($batch =& batch_get()) && !isset($batch['current_set'])) {
-        // Some previous _submit handler has set a batch. We store the call
-        // in a special 'control' batch set, for execution at the correct
-        // time during the batch processing workflow.
+        // Some previous _submit handler has set a batch. We store the call in
+        // a special 'control' batch set, for execution at the correct time
+        // during the batch processing workflow.
         $batch['sets'][] = array('form_submit' => $function);
       }
       else {
@@ -803,6 +802,7 @@ function form_execute_handlers($type, &$form, &$form_state) {
  *   The error message to present to the user.
  * @param $reset
  *   Reset the form errors static cache.
+ *
  * @return
  *   Never use the return value of this function, use form_get_errors and
  *   form_get_error instead.
@@ -854,20 +854,18 @@ function form_error(&$element, $message = '') {
 }
 
 /**
- * Walk through the structured form array, adding any required
- * properties to each element and mapping the incoming $_POST
- * data to the proper elements.
+ * Walk through the structured form array, adding any required properties to
+ * each element and mapping the incoming $_POST data to the proper elements.
  *
  * @param $form_id
- *   A unique string identifying the form for validation, submission,
- *   theming, and hook_form_alter functions.
+ *   A unique string identifying the form for validation, submission, theming,
+ *   and hook_form_alter functions.
  * @param $form
  *   An associative array containing the structure of the form.
  * @param $form_state
- *   A keyed array containing the current state of the form. In this
- *   context, it is used to accumulate information about which button
- *   was clicked when the form was submitted, as well as the sanitized
- *   $_POST data.
+ *   A keyed array containing the current state of the form. In this context,
+ *   it is used to accumulate information about which button was clicked when
+ *   the form was submitted, as well as the sanitized $_POST data.
  */
 function form_builder($form_id, $form, &$form_state) {
   static $complete_form, $cache;
@@ -914,8 +912,8 @@ function form_builder($form_id, $form, &$form_state) {
 
     // Don't squash existing parents value.
     if (!isset($form[$key]['#parents'])) {
-      // Check to see if a tree of child elements is present. If so,
-      // continue down the tree if required.
+      // Check to see if a tree of child elements is present. If so, continue
+      // down the tree if required.
       $form[$key]['#parents'] = $form[$key]['#tree'] && $form['#tree'] ? array_merge($form['#parents'], array($key)) : array($key);
       $array_parents = isset($form['#array_parents']) ? $form['#array_parents'] : array();
       $array_parents[] = $key;
@@ -935,8 +933,8 @@ function form_builder($form_id, $form, &$form_state) {
     $count++;
   }
 
-  // The #after_build flag allows any piece of a form to be altered
-  // after normal input parsing has been completed.
+  // The #after_build flag allows any piece of a form to be altered after
+  // normal input parsing has been completed.
   if (isset($form['#after_build']) && !isset($form['#after_build_done'])) {
     foreach ($form['#after_build'] as $function) {
       $form = $function($form, $form_state);
@@ -948,16 +946,15 @@ function form_builder($form_id, $form, &$form_state) {
   // Internet Explorer button-click scenario.
   _form_builder_ie_cleanup($form, $form_state);
 
-  // We shoud keep the buttons array until the IE clean up function
-  // has recognized the submit button so the form has been marked
-  // as submitted. If we already know which button was submitted,
-  // we don't need the array.
+  // We shoud keep the buttons array until the IE clean up function has
+  // recognized the submit button so the form has been marked as submitted. If
+  // we already know which button was submitted, we don't need the array.
   if (!empty($form_state['submitted'])) {
     unset($form_state['buttons']);
   }
 
-  // If some callback set #cache, we need to flip a static flag so later it
-  // can be found.
+  // If some callback set #cache, we need to flip a static flag so later it can
+  // be found.
   if (!empty($form['#cache'])) {
     $cache = $form['#cache'];
   }
@@ -969,18 +966,18 @@ function form_builder($form_id, $form, &$form_state) {
 }
 
 /**
- * Populate the #value and #name properties of input elements so they
- * can be processed and rendered. Also, execute any #process handlers
- * attached to a specific element.
+ * Populate the #value and #name properties of input elements so they can be
+ * processed and rendered. Also, execute any #process handlers attached to a
+ * specific element.
  */
 function _form_builder_handle_input_element($form_id, &$form, &$form_state, $complete_form) {
   if (!isset($form['#name'])) {
     $name = array_shift($form['#parents']);
     $form['#name'] = $name;
     if ($form['#type'] == 'file') {
-      // To make it easier to handle $_FILES in file.inc, we place all
-      // file fields in the 'files' array. Also, we do not support
-      // nested file names.
+      // To make it easier to handle $_FILES in file.inc, we place all file
+      // fields in the 'files' array. Also, we do not support nested file
+      // names.
       $form['#name'] = 'files['. $form['#name'] .']';
     }
     elseif (count($form['#parents'])) {
@@ -1019,23 +1016,24 @@ function _form_builder_handle_input_element($form_id, &$form, &$form_state, $com
     }
     // Load defaults.
     if (!isset($form['#value'])) {
-      // Call #type_value without a second argument to request default_value handling.
+      // Call #type_value without a second argument to request default_value
+      // handling.
       if (function_exists($function)) {
         $form['#value'] = $function($form);
       }
-      // Final catch. If we haven't set a value yet, use the explicit default value.
-      // Avoid image buttons (which come with garbage value), so we only get value
-      // for the button actually clicked.
+      // Final catch. If we haven't set a value yet, use the explicit default
+      // value. Avoid image buttons (which come with garbage value), so we only
+      // get value for the button actually clicked.
       if (!isset($form['#value']) && empty($form['#has_garbage_value'])) {
         $form['#value'] = isset($form['#default_value']) ? $form['#default_value'] : '';
       }
     }
   }
 
-  // Determine which button (if any) was clicked to submit the form.
-  // We compare the incoming values with the buttons defined in the form,
-  // and flag the one that matches. We have to do some funky tricks to
-  // deal with Internet Explorer's handling of single-button forms, though.
+  // Determine which button (if any) was clicked to submit the form. We compare
+  // the incoming values with the buttons defined in the form, and flag the one
+  // that matches. We have to do some funky tricks to deal with Internet
+  // Explorer's handling of single-button forms, though.
   if (!empty($form['#post']) && isset($form['#executes_submit_callback'])) {
     // First, accumulate a collection of buttons, divided into two bins:
     // those that execute full submit callbacks and those that only validate.
@@ -1045,9 +1043,9 @@ function _form_builder_handle_input_element($form_id, &$form, &$form_state, $com
     if (_form_button_was_clicked($form)) {
       $form_state['submitted'] = $form_state['submitted'] || $form['#executes_submit_callback'];
 
-      // In most cases, we want to use form_set_value() to manipulate
-      // the global variables. In this special case, we want to make sure that
-      // the value of this element is listed in $form_variables under 'op'.
+      // In most cases, we want to use form_set_value() to manipulate the
+      // global variables. In this special case, we want to make sure that the
+      // value of this element is listed in $form_variables under 'op'.
       $form_state['values'][$form['#name']] = $form['#value'];
       $form_state['clicked_button'] = $form;
 
@@ -1073,20 +1071,19 @@ function _form_builder_handle_input_element($form_id, &$form, &$form_state, $com
 }
 
 /**
- * Helper function to handle the sometimes-convoluted logic of button
- * click detection.
+ * Helper function to handle the sometimes-convoluted logic of button click
+ * detection.
  *
- * In Internet Explorer, if ONLY one submit button is present, AND the
- * enter key is used to submit the form, no form value is sent for it
- * and we'll never detect a match. That special case is handled by
- * _form_builder_ie_cleanup().
+ * In Internet Explorer, if ONLY one submit button is present, AND the enter
+ * key is used to submit the form, no form value is sent for it and we'll never
+ * detect a match. That special case is handled by _form_builder_ie_cleanup().
  */
 function _form_button_was_clicked($form) {
-  // First detect normal 'vanilla' button clicks. Traditionally, all
-  // standard buttons on a form share the same name (usually 'op'),
-  // and the specific return value is used to determine which was
-  // clicked. This ONLY works as long as $form['#name'] puts the
-  // value at the top level of the tree of $_POST data.
+  // First detect normal 'vanilla' button clicks. Traditionally, all standard
+  // buttons on a form share the same name (usually 'op'), and the specific
+  // return value is used to determine which was clicked. This ONLY works as
+  // long as $form['#name'] puts the value at the top level of the tree of
+  // $_POST data.
   if (isset($form['#post'][$form['#name']]) && $form['#post'][$form['#name']] == $form['#value']) {
     return TRUE;
   }
@@ -1102,25 +1099,24 @@ function _form_button_was_clicked($form) {
 }
 
 /**
- * In IE, if only one submit button is present, AND the enter key is
- * used to submit the form, no form value is sent for it and our normal
- * button detection code will never detect a match. We call this
- * function after all other button-detection is complete to check
- * for the proper conditions, and treat the single button on the form
- * as 'clicked' if they are met.
+ * In IE, if only one submit button is present, AND the enter key is used to
+ * submit the form, no form value is sent for it and our normal button
+ * detection code will never detect a match. We call this function after all
+ * other button-detection is complete to check for the proper conditions, and
+ * treat the single button on the form as 'clicked' if they are met.
  */
 function _form_builder_ie_cleanup($form, &$form_state) {
-  // Quick check to make sure we're always looking at the full form
-  // and not a sub-element.
+  // Quick check to make sure we're always looking at the full form and not a
+  // sub-element.
   if (!empty($form['#type']) && $form['#type'] == 'form') {
-    // If we haven't recognized a submission yet, and there's a single
-    // submit button, we know that we've hit the right conditions. Grab
-    // the first one and treat it as the clicked button.
+    // If we haven't recognized a submission yet, and there's a single submit
+    // button, we know that we've hit the right conditions. Grab the first one
+    // and treat it as the clicked button.
     if (empty($form_state['submitted']) && !empty($form_state['buttons']['submit']) && empty($form_state['buttons']['button'])) {
       $button = $form_state['buttons']['submit'][0];
 
-      // Set up all the $form_state information that would have been
-      // populated had the button been recognized earlier.
+      // Set up all the $form_state information that would have been populated
+      // had the button been recognized earlier.
       $form_state['submitted'] = TRUE;
       $form_state['submit_handlers'] = empty($button['#submit']) ? NULL : $button['#submit'];
       $form_state['validate_handlers'] = empty($button['#validate']) ? NULL : $button['#validate'];
@@ -1136,28 +1132,29 @@ function _form_builder_ie_cleanup($form, &$form_state) {
  * @param $form
  *   The form element whose value is being populated.
  * @param $edit
- *   The incoming POST data to populate the form element. If this is FALSE,
- *   the element's default value should be returned.
+ *   The incoming POST data to populate the form element. If this is FALSE, the
+ *   element's default value should be returned.
+ *
  * @return
- *   The data that will appear in the $form_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   The data that will appear in the $form_state['values'] collection for this
+ *   element. Return nothing to use the default.
  */
 function form_type_image_button_value($form, $edit = FALSE) {
   if ($edit !== FALSE) {
     if (!empty($edit)) {
-      // If we're dealing with Mozilla or Opera, we're lucky. It will
-      // return a proper value, and we can get on with things.
+      // If we're dealing with Mozilla or Opera, we're lucky. It will return a
+      // proper value, and we can get on with things.
       return $form['#return_value'];
     }
     else {
-      // Unfortunately, in IE we never get back a proper value for THIS
-      // form element. Instead, we get back two split values: one for the
-      // X and one for the Y coordinates on which the user clicked the
-      // button. We'll find this element in the #post data, and search
-      // in the same spot for its name, with '_x'.
+      // Unfortunately, in IE we never get back a proper value for THIS form
+      // element. Instead, we get back two split values: one for theX and one
+      // for the Y coordinates on which the user clicked the button. We'll find
+      // this element in the #post data, and search in the same spot for its
+      // name, with '_x'.
       $post = $form['#post'];
       foreach (split('\[', $form['#name']) as $element_name) {
-        // chop off the ] that may exist.
+        // Chop off the ] that may exist.
         if (substr($element_name, -1) == ']') {
           $element_name = substr($element_name, 0, -1);
         }
@@ -1181,11 +1178,12 @@ function form_type_image_button_value($form, $edit = FALSE) {
  * @param $form
  *   The form element whose value is being populated.
  * @param $edit
- *   The incoming POST data to populate the form element. If this is FALSE,
- *   the element's default value should be returned.
+ *   The incoming POST data to populate the form element. If this is FALSE, the
+ *   element's default value should be returned.
+ *
  * @return
- *   The data that will appear in the $form_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   The data that will appear in the $form_state['values'] collection for this
+ *   element. Return nothing to use the default.
  */
 function form_type_checkbox_value($form, $edit = FALSE) {
   if ($edit !== FALSE) {
@@ -1204,11 +1202,12 @@ function form_type_checkbox_value($form, $edit = FALSE) {
  * @param $form
  *   The form element whose value is being populated.
  * @param $edit
- *   The incoming POST data to populate the form element. If this is FALSE,
- *   the element's default value should be returned.
+ *   The incoming POST data to populate the form element. If this is FALSE, the
+ *   element's default value should be returned.
+ *
  * @return
- *   The data that will appear in the $form_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   The data that will appear in the $form_state['values'] collection for this
+ *   element. Return nothing to use the default.
  */
 function form_type_checkboxes_value($form, $edit = FALSE) {
   if ($edit === FALSE) {
@@ -1225,17 +1224,17 @@ function form_type_checkboxes_value($form, $edit = FALSE) {
 }
 
 /**
- * Helper function to determine the value for a password_confirm form
- * element.
+ * Helper function to determine the value for a password_confirm form element.
  *
  * @param $form
  *   The form element whose value is being populated.
  * @param $edit
- *   The incoming POST data to populate the form element. If this is FALSE,
- *   the element's default value should be returned.
+ *   The incoming POST data to populate the form element. If this is FALSE, the
+ *   element's default value should be returned.
+ *
  * @return
- *   The data that will appear in the $form_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   The data that will appear in the $form_state['values'] collection for this
+ *   element. Return nothing to use the default.
  */
 function form_type_password_confirm_value($form, $edit = FALSE) {
   if ($edit === FALSE) {
@@ -1250,11 +1249,12 @@ function form_type_password_confirm_value($form, $edit = FALSE) {
  * @param $form
  *   The form element whose value is being populated.
  * @param $edit
- *   The incoming POST data to populate the form element. If this is FALSE,
- *   the element's default value should be returned.
+ *   The incoming POST data to populate the form element. If this is FALSE, the
+ *   element's default value should be returned.
+ *
  * @return
- *   The data that will appear in the $form_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   The data that will appear in the $form_state['values'] collection for this
+ *   element. Return nothing to use the default.
  */
 function form_type_select_value($form, $edit = FALSE) {
   if ($edit !== FALSE) {
@@ -1273,16 +1273,16 @@ function form_type_select_value($form, $edit = FALSE) {
  * @param $form
  *   The form element whose value is being populated.
  * @param $edit
- *   The incoming POST data to populate the form element. If this is FALSE,
- *   the element's default value should be returned.
+ *   The incoming POST data to populate the form element. If this is FALSE, the
+ *   element's default value should be returned.
+ *
  * @return
- *   The data that will appear in the $form_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   The data that will appear in the $form_state['values'] collection for this
+ *   element. Return nothing to use the default.
  */
 function form_type_textfield_value($form, $edit = FALSE) {
   if ($edit !== FALSE) {
-    // Equate $edit to the form value to ensure it's marked for
-    // validation.
+    // Equate $edit to the form value to ensure it's marked for validation.
     return str_replace(array("\r", "\n"), '', $edit);
   }
 }
@@ -1293,11 +1293,12 @@ function form_type_textfield_value($form, $edit = FALSE) {
  * @param $form
  *   The form element whose value is being populated.
  * @param $edit
- *   The incoming POST data to populate the form element. If this is FALSE,
- *   the element's default value should be returned.
+ *   The incoming POST data to populate the form element. If this is FALSE, the
+ *   element's default value should be returned.
+ *
  * @return
- *   The data that will appear in the $form_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   The data that will appear in the $form_state['values'] collection for this
+ *   element. Return nothing to use the default.
  */
 function form_type_token_value($form, $edit = FALSE) {
   if ($edit !== FALSE) {
@@ -1314,15 +1315,15 @@ function form_type_token_value($form, $edit = FALSE) {
  *
  * Since $form_state['values'] can either be a flat array of values, or a tree
  * of nested values, some care must be taken when using this function.
- * Specifically, $form_item['#parents'] is an array that describes the branch of
- * the tree whose value should be updated. For example, if we wanted to update
- * $form_state['values']['one']['two'] to 'new value', we'd pass in
+ * Specifically, $form_item['#parents'] is an array that describes the branch
+ * of the tree whose value should be updated. For example, if we wanted to
+ * update $form_state['values']['one']['two'] to 'new value', we'd pass in
  * $form_item['#parents'] = array('one', 'two') and $value = 'new value'.
  *
  * @param $form_item
  *   The form item that should have its value updated. Keys used: #parents,
- *   #value. In most cases you can just pass in the right element from the $form
- *   array.
+ *   #value. In most cases you can just pass in the right element from the
+ *   $form array.
  * @param $value
  *   The new value for the form item.
  * @param $form_state
@@ -1335,9 +1336,9 @@ function form_set_value($form_item, $value, &$form_state) {
 /**
  * Helper function for form_set_value().
  *
- * We iterate over $parents and create nested arrays for them
- * in $form_state['values'] if needed. Then we insert the value into
- * the right array.
+ * We iterate over $parents and create nested arrays for them in
+ * $form_state['values'] if needed. Then we insert the value into the right
+ * array.
  */
 function _form_set_value(&$form_values, $form_item, $parents, $value) {
   $parent = array_shift($parents);
@@ -1410,7 +1411,9 @@ function form_options_flatten($array, $reset = TRUE) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used: title, value, options, description, extra, multiple, required
+ *   Properties used: title, value, options, description, extra, multiple,
+ *   required.
+ *
  * @return
  *   A themed HTML string representing the form element.
  *
@@ -1432,8 +1435,8 @@ function form_select_options($element, $choices = NULL) {
   if (!isset($choices)) {
     $choices = $element['#options'];
   }
-  // array_key_exists() accommodates the rare event where $element['#value'] is NULL.
-  // isset() fails in this situation.
+  // array_key_exists() accommodates the rare event where $element['#value'] is
+  // NULL. isset() fails in this situation.
   $value_valid = isset($element['#value']) || array_key_exists('#value', $element);
   $value_is_array = is_array($element['#value']);
   $options = '';
@@ -1461,36 +1464,35 @@ function form_select_options($element, $choices = NULL) {
 }
 
 /**
- * Traverses a select element's #option array looking for any values
- * that hold the given key. Returns an array of indexes that match.
+ * Traverses a select element's #option array looking for any values that hold
+ * the given key. Returns an array of indexes that match.
  *
- * This function is useful if you need to modify the options that are
- * already in a form element; for example, to remove choices which are
- * not valid because of additional filters imposed by another module.
- * One example might be altering the choices in a taxonomy selector.
- * To correctly handle the case of a multiple hierarchy taxonomy,
- * #options arrays can now hold an array of objects, instead of a
- * direct mapping of keys to labels, so that multiple choices in the
- * selector can have the same key (and label). This makes it difficult
- * to manipulate directly, which is why this helper function exists.
+ * This function is useful if you need to modify the options that are already
+ * in a form element; for example, to remove choices which are not valid
+ * because of additional filters imposed by another module. One example might
+ * be altering the choices in a taxonomy selector. To correctly handle the case
+ * of a multiple hierarchy taxonomy, #options arrays can now hold an array of
+ * objects, instead of a direct mapping of keys to labels, so that multiple
+ * choices in the selector can have the same key (and label). This makes it
+ * difficult to manipulate directly, which is why this helper function exists.
  *
- * This function does not support optgroups (when the elements of the
- * #options array are themselves arrays), and will return FALSE if
- * arrays are found. The caller must either flatten/restore or
- * manually do their manipulations in this case, since returning the
- * index is not sufficient, and supporting this would make the
- * "helper" too complicated and cumbersome to be of any help.
+ * This function does not support optgroups (when the elements of the #options
+ * array are themselves arrays), and will return FALSE if arrays are found.
+ * The caller must either flatten/restore or manually do their manipulations in
+ * this case, since returning the index is not sufficient, and supporting this
+ * would make the "helper" too complicated and cumbersome to be of any help.
  *
- * As usual with functions that can return array() or FALSE, do not
- * forget to use === and !== if needed.
+ * As usual with functions that can return array() or FALSE, do not forget to
+ * use === and !== if needed.
  *
  * @param $element
  *   The select element to search.
  * @param $key
  *   The key to look for.
+ *
  * @return
- *   An array of indexes that match the given $key. Array will be
- *   empty if no elements were found. FALSE if optgroups were found.
+ *   An array of indexes that match the given $key. Array will be empty if no
+ *   elements were found. FALSE if optgroups were found.
  */
 function form_get_options($element, $key) {
   $keys = array();
@@ -1515,7 +1517,9 @@ function form_get_options($element, $key) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used: attributes, title, value, description, children, collapsible, collapsed
+ *   Properties used: attributes, title, value, description, children,
+ *   collapsible, collapsed.
+ *
  * @return
  *   A themed HTML string representing the form item group.
  *
@@ -1543,7 +1547,9 @@ function theme_fieldset($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used: required, return_value, value, attributes, title, description
+ *   Properties used: required, return_value, value, attributes, title,
+ *   description.
+ *
  * @return
  *   A themed HTML string representing the form item group.
  *
@@ -1570,7 +1576,8 @@ function theme_radio($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used: title, value, options, description, required and attributes.
+ *   Properties used: title, value, options, description, required, attributes.
+ *
  * @return
  *   A themed HTML string representing the radio button set.
  *
@@ -1597,6 +1604,7 @@ function theme_radios($element) {
  * @param $element
  *   An associative array containing the properties of the element.
  *   Properties used: title, value, id, required, error.
+ *
  * @return
  *   A themed HTML string representing the form item.
  *
@@ -1664,7 +1672,8 @@ function password_confirm_validate($form, &$form_state) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used: title, value, options, description, required and attributes.
+ *   Properties used: title, value, options, description, required, attributes.
+ *
  * @return
  *   A themed HTML string representing the date selection boxes.
  *
@@ -1751,8 +1760,8 @@ function weight_value(&$form) {
 }
 
 /**
- * Roll out a single radios element to a list of radios,
- * using the options array as index.
+ * Roll out a single radios element to a list of radios, using the options
+ * array as index.
  */
 function expand_radios($element) {
   if (count($element['#options']) > 0) {
@@ -1779,14 +1788,15 @@ function expand_radios($element) {
 
 /**
  * Add AHAH information about a form element to the page to communicate with
- * javascript. If #ahah[path] is set on an element, this additional javascript is
- * added to the page header to attach the AHAH behaviors. See ahah.js for more
- * information.
+ * JavaScript. If #ahah[path] is set on an element, this additional JavaScript
+ * is added to the page header to attach the AHAH behaviors. See ahah.js for
+ * more information.
  *
  * @param $element
  *   An associative array containing the properties of the element.
  *   Properties used: ahah_event, ahah_path, ahah_wrapper, ahah_parameters,
  *   ahah_effect.
+ *
  * @return
  *   None. Additional code is added to the header of the page using
  *   drupal_add_js.
@@ -1799,12 +1809,12 @@ function form_expand_ahah($element) {
       case 'submit':
       case 'button':
       case 'image_button':
-        // Use the mousedown instead of the click event because form
-        // submission via pressing the enter key triggers a click event on
-        // submit inputs, inappropriately triggering AHAH behaviors.
+        // Use the mousedown instead of the click event because form submission
+        // via pressing the enter key triggers a click event on submit inputs,
+        // inappropriately triggering AHAH behaviors.
         $element['#ahah']['event'] = 'mousedown';
-        // Attach an additional event handler so that AHAH behaviours
-        // can be triggered still via keyboard input.
+        // Attach an additional event handler so that AHAH behaviours can be
+        // triggered still via keyboard input.
         $element['#ahah']['keypress'] = TRUE;
         break;
       case 'password':
@@ -1842,7 +1852,7 @@ function form_expand_ahah($element) {
     if (is_string($ahah_binding['progress'])) {
       $ahah_binding['progress'] = array('type' => $ahah_binding['progress']);
     }
-    // Change progress path to a full url.
+    // Change progress path to a full URL.
     if (isset($ahah_binding['progress']['path'])) {
       $ahah_binding['progress']['url'] = url($ahah_binding['progress']['path']);
     }
@@ -1865,7 +1875,8 @@ function form_expand_ahah($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used:  title, value, description, required, error
+ *   Properties used: title, value, description, required, error.
+ *
  * @return
  *   A themed HTML string representing the form item.
  *
@@ -1880,7 +1891,8 @@ function theme_item($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used:  title, value, return_value, description, required
+ *   Properties used: title, value, return_value, description, required.
+ *
  * @return
  *   A themed HTML string representing the checkbox.
  *
@@ -1909,6 +1921,7 @@ function theme_checkbox($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
+ *
  * @return
  *   A themed HTML string representing the checkbox set.
  *
@@ -2007,7 +2020,8 @@ function theme_image_button($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used:  value, edit
+ *   Properties used: value, edit.
+ *
  * @return
  *   A themed HTML string representing the hidden form field.
  *
@@ -2031,7 +2045,9 @@ function theme_token($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used:  title, value, description, size, maxlength, required, attributes autocomplete_path
+ *   Properties used: title, value, description, size, maxlength, required,
+ *   attributes, autocomplete_path.
+ *
  * @return
  *   A themed HTML string representing the textfield.
  *
@@ -2069,7 +2085,8 @@ function theme_textfield($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used: action, method, attributes, children
+ *   Properties used: action, method, attributes, children.
+ *
  * @return
  *   A themed HTML string representing the form.
  *
@@ -2086,7 +2103,9 @@ function theme_form($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used: title, value, description, rows, cols, required, attributes
+ *   Properties used: title, value, description, rows, cols, required,
+ *   attributes.
+ *
  * @return
  *   A themed HTML string representing the textarea.
  *
@@ -2095,7 +2114,7 @@ function theme_form($element) {
 function theme_textarea($element) {
   $class = array('form-textarea');
 
-  // Add teaser behavior (must come before resizable)
+  // Add teaser behavior (must come before resizable).
   if (!empty($element['#teaser'])) {
     drupal_add_js('misc/teaser.js');
     // Note: arrays are merged in drupal_get_js().
@@ -2104,7 +2123,7 @@ function theme_textarea($element) {
     $class[] = 'teaser';
   }
 
-  // Add resizable behavior
+  // Add resizable behavior.
   if ($element['#resizable'] !== FALSE) {
     drupal_add_js('misc/textarea.js');
     $class[] = 'resizable';
@@ -2117,11 +2136,13 @@ function theme_textarea($element) {
 /**
  * Format HTML markup for use in forms.
  *
- * This is used in more advanced forms, such as theme selection and filter format.
+ * This is used in more advanced forms, such as theme selection and filter
+ * format.
  *
  * @param $element
  *   An associative array containing the properties of the element.
  *   Properties used: value, children.
+ *
  * @return
  *   A themed HTML string representing the HTML markup.
  *
@@ -2137,7 +2158,9 @@ function theme_markup($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used:  title, value, description, size, maxlength, required, attributes
+ *   Properties used: title, value, description, size, maxlength, required,
+ *   attributes.
+ *
  * @return
  *   A themed HTML string representing the form.
  *
@@ -2179,6 +2202,7 @@ function process_weight($element) {
  *   Explanatory text to display after the form item.
  * @param $required
  *   Whether the user must upload a file to the field.
+ *
  * @return
  *   A themed HTML string representing the field.
  *
@@ -2197,9 +2221,10 @@ function theme_file($element) {
  *
  * @param element
  *   An associative array containing the properties of the element.
- *   Properties used: title, description, id, required
+ *   Properties used: title, description, id, required.
  * @param $value
  *   The form element's data.
+ *
  * @return
  *   A string representing the form element.
  *
@@ -2268,11 +2293,12 @@ function _form_set_class(&$element, $class = array()) {
  * @param $id
  *   The ID to clean.
  * @param $flush
- *   If set to TRUE, the function will flush and reset the static array
- *   which is built to test the uniqueness of element IDs. This is only
- *   used if a form has completed the validation process. This parameter
- *   should never be set to TRUE if this function is being called to
- *   assign an ID to the #ID element.
+ *   If set to TRUE, the function will flush and reset the static array which
+ *   is built to test the uniqueness of element IDs. This is only used if a
+ *   form has completed the validation process. This parameter should never be
+ *   set to TRUE if this function is being called to assign an ID to the #ID
+ *   element.
+ *
  * @return
  *   The cleaned ID.
  */
@@ -2287,10 +2313,10 @@ function form_clean_id($id = NULL, $flush = FALSE) {
 
   // Ensure IDs are unique. The first occurrence is held but left alone.
   // Subsequent occurrences get a number appended to them. This incrementing
-  // will almost certainly break code that relies on explicit HTML IDs in
-  // forms that appear more than once on the page, but the alternative is
-  // outputting duplicate IDs, which would break JS code and XHTML
-  // validity anyways. For now, it's an acceptable stopgap solution.
+  // will almost certainly break code that relies on explicit HTML IDs in forms
+  // that appear more than once on the page, but the alternative is outputting
+  // duplicate IDs, which would break JS code and XHTML validity anyways. For
+  // now, it's an acceptable stopgap solution.
   if (isset($seen_ids[$id])) {
     $id = $id .'-'. $seen_ids[$id]++;
   }
@@ -2343,8 +2369,8 @@ function form_clean_id($id = NULL, $flush = FALSE) {
  * @code
  * // Simple and artificial: load a node of a given type for a given user
  * function my_function_1($uid, $type, &$context) {
- *   // The $context array gathers batch context information about the execution (read),
- *   // as well as 'return values' for the current operation (write)
+ *   // The $context array gathers batch context information about the execution
+ *   // (read), as well as 'return values' for the current operation (write)
  *   // The following keys are provided :
  *   // 'results' (read / write): The array of results gathered so far by
  *   //   the batch processing, for the current operation to append its own.
@@ -2354,8 +2380,8 @@ function form_clean_id($id = NULL, $flush = FALSE) {
  *   //   store persistent data between iterations. It is recommended to
  *   //   use this instead of $_SESSION, which is unsafe if the user
  *   //   continues browsing in a separate window while the batch is processing.
- *   // 'finished' (write): A float number between 0 and 1 informing
- *   //   the processing engine of the completion level for the operation.
+ *   // 'finished' (write): A float number between 0 and 1 informing the
+ *   //   processing engine of the completion level for the operation.
  *   //   1 (or no value explicitly set) means the operation is finished
  *   //   and the batch processing can continue to the next operation.
  *
@@ -2420,8 +2446,8 @@ function form_clean_id($id = NULL, $flush = FALSE) {
  *       array('my_function_2', array($arg2_1, $arg2_2)),
  *     )
  *     @endcode
- *   - 'title': Title for the progress page. Only safe strings should be passed.
- *     Defaults to t('Processing').
+ *   - 'title': Title for the progress page. Only safe strings should be
+ *     passed. Defaults to t('Processing').
  *   - 'init_message': Message displayed while the processing is initialized.
  *     Defaults to t('Initializing.').
  *   - 'progress_message': Message displayed while processing the batch.
@@ -2430,27 +2456,26 @@ function form_clean_id($id = NULL, $flush = FALSE) {
  *   - 'error_message': Message displayed if an error occurred while processing
  *     the batch. Defaults to t('An error has occurred.').
  *   - 'finished': Name of a function to be executed after the batch has
- *     completed. This should be used to perform any result massaging that
- *     may be needed, and possibly save data in $_SESSION for display after
- *     final page redirection.
- *   - 'file': Path to the file containing the definitions of the
- *     'operations' and 'finished' functions, for instance if they don't
- *     reside in the main .module file. The path should be relative to
- *     base_path(), and thus should be built using drupal_get_path().
- *
- * Operations are added as new batch sets. Batch sets are used to ensure
- * clean code independence, ensuring that several batches submitted by
- * different parts of the code (core / contrib modules) can be processed
- * correctly while not interfering or having to cope with each other. Each
- * batch set gets to specify its own UI messages, operates on its own set
- * of operations and results, and triggers its own 'finished' callback.
- * Batch sets are processed sequentially, with the progress bar starting
- * fresh for every new set.
+ *     completed. This should be used to perform any result massaging that may
+ *     be needed, and possibly save data in $_SESSION for display after final
+ *     page redirection.
+ *   - 'file': Path to the file containing the definitions of the 'operations'
+ *     and 'finished' functions, for instance if they don't reside in the main
+ *     .module file. The path should be relative to base_path(), and thus
+ *     should be built using drupal_get_path().
+ *
+ * Operations are added as new batch sets. Batch sets are used to ensure clean
+ * code independence, ensuring that several batches submitted by different
+ * parts of the code (core / contrib modules) can be processed correctly while
+ * not interfering or having to cope with each other. Each batch set gets to
+ * specify its own UI messages, operates on its own set of operations and
+ * results, and triggers its own 'finished' callback. Batch sets are processed
+ * sequentially, with the progress bar starting fresh for every new set.
  */
 function batch_set($batch_definition) {
   if ($batch_definition) {
     $batch =& batch_get();
-    // Initialize the batch
+    // Initialize the batch.
     if (empty($batch)) {
       $batch = array(
         'sets' => array(),
@@ -2472,12 +2497,13 @@ function batch_set($batch_definition) {
     );
     $batch_set = $init + $batch_definition + $defaults;
 
-    // Tweak init_message to avoid the bottom of the page flickering down after init phase.
+    // Tweak init_message to avoid the bottom of the page flickering down after
+    // init phase.
     $batch_set['init_message'] .= '<br/>&nbsp;';
     $batch_set['total'] = count($batch_set['operations']);
 
-    // If the batch is being processed (meaning we are executing a stored submit handler),
-    // insert the new set after the current one.
+    // If the batch is being processed (meaning we are executing a stored
+    // submit handler), insert the new set after the current one.
     if (isset($batch['current_set'])) {
       // array_insert does not exist...
       $slice1 = array_slice($batch['sets'], 0, $batch['current_set'] + 1);
@@ -2496,8 +2522,8 @@ function batch_set($batch_definition) {
  * Unless the batch has been marked with 'progressive' = FALSE, the function
  * issues a drupal_goto and thus ends page execution.
  *
- * This function is not needed in form submit handlers; Form API takes care
- * of batches that were set during form submission.
+ * This function is not needed in form submit handlers; Form API takes care of
+ * batches that were set during form submission.
  *
  * @param $redirect
  *   (optional) Path to redirect to when the batch has finished processing.
@@ -2509,7 +2535,7 @@ function batch_process($redirect = NULL, $url = NULL) {
   $batch =& batch_get();
 
   if (isset($batch)) {
-    // Add process information
+    // Add process information.
     $url = isset($url) ? $url : 'batch';
     $process_info = array(
       'current_set' => 0,
@@ -2533,8 +2559,8 @@ function batch_process($redirect = NULL, $url = NULL) {
         unset($_REQUEST['edit']['destination']);
       }
 
-      // Initiate db storage in order to get a batch id. We have to provide
-      // at least an empty string for the (not null) 'token' column.
+      // Initiate db storage in order to get a batch id. We have to provide at
+      // least an empty string for the (not null) 'token' column.
       db_query("INSERT INTO {batch} (token, timestamp) VALUES ('', %d)", time());
       $batch['id'] = db_last_insert_id('batch', 'bid');
 
@@ -2543,14 +2569,15 @@ function batch_process($redirect = NULL, $url = NULL) {
       $t = get_t();
       $batch['error_message'] = $t('Please continue to <a href="@error_url">the error page</a>', array('@error_url' => url($url, array('query' => array('id' => $batch['id'], 'op' => 'finished')))));
 
-      // Actually store the batch data and the token generated form the batch id.
+      // Actually store the batch data and the token generated form the batch
+      // id.
       db_query("UPDATE {batch} SET token = '%s', batch = '%s' WHERE bid = %d", drupal_get_token($batch['id']), serialize($batch), $batch['id']);
 
       drupal_goto($batch['url'], 'op=start&id='. $batch['id']);
     }
     else {
-      // Non-progressive execution: bypass the whole progressbar workflow
-      // and execute the batch in one pass.
+      // Non-progressive execution: bypass the whole progressbar workflow and
+      // execute the batch in one pass.
       require_once './includes/batch.inc';
       _batch_process();
     }
diff --git a/includes/install.mysql.inc b/includes/install.mysql.inc
index e544294..73aa365 100644
--- a/includes/install.mysql.inc
+++ b/includes/install.mysql.inc
@@ -26,7 +26,7 @@ function drupal_test_mysql($url, &$success) {
 
   $url = parse_url($url);
 
-  // Decode url-encoded information in the db connection string.
+  // Decode urlencoded information in the db connection string.
   $url['user'] = urldecode($url['user']);
   $url['pass'] = isset($url['pass']) ? urldecode($url['pass']) : '';
   $url['host'] = urldecode($url['host']);
diff --git a/includes/install.mysqli.inc b/includes/install.mysqli.inc
index 8920d01..0080804 100644
--- a/includes/install.mysqli.inc
+++ b/includes/install.mysqli.inc
@@ -26,7 +26,7 @@ function drupal_test_mysqli($url, &$success) {
 
   $url = parse_url($url);
 
-  // Decode url-encoded information in the db connection string.
+  // Decode urlencoded information in the db connection string.
   $url['user'] = urldecode($url['user']);
   $url['pass'] = isset($url['pass']) ? urldecode($url['pass']) : '';
   $url['host'] = urldecode($url['host']);
diff --git a/includes/install.pgsql.inc b/includes/install.pgsql.inc
index fde97a3..5c2c21d 100644
--- a/includes/install.pgsql.inc
+++ b/includes/install.pgsql.inc
@@ -27,7 +27,7 @@ function drupal_test_pgsql($url, &$success) {
   $url = parse_url($url);
   $conn_string = '';
 
-  // Decode url-encoded information in the db connection string
+  // Decode urlencoded information in the db connection string
   if (isset($url['user'])) {
     $conn_string .= ' user='. urldecode($url['user']);
   }
diff --git a/includes/theme.inc b/includes/theme.inc
index e1e45e0..44a60c4 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -1335,14 +1335,16 @@ function theme_submenu($links) {
  *   - "field": The database field represented in the table column (required if
  *     user is to be able to sort on this column).
  *   - "sort": A default sort order for this column ("asc" or "desc").
- *   - Any HTML attributes, such as "colspan", to apply to the column header cell.
+ *   - Any HTML attributes, such as "colspan", to apply to the column header
+ *     cell.
  * @param $rows
  *   An array of table rows. Every row is an array of cells, or an associative
  *   array with the following keys:
  *   - "data": an array of cells
  *   - Any HTML attributes, such as "class", to apply to the table row.
  *
- *   Each cell can be either a string or an associative array with the following keys:
+ *   Each cell can be either a string or an associative array with the
+ *   following keys:
  *   - "data": The string to display in the table cell.
  *   - "header": Indicates this cell is a header.
  *   - Any HTML attributes, such as "colspan", to apply to the table cell.
@@ -1394,7 +1396,8 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) {
       $cell = tablesort_header($cell, $header, $ts);
       $output .= _theme_table_cell($cell, TRUE);
     }
-    // Using ternary operator to close the tags based on whether or not there are rows
+    // Using ternary operator to close the tags based on whether or not there
+    // are rows.
     $output .= (count($rows) ? " </tr></thead>\n" : "</tr>\n");
   }
   else {
@@ -1409,7 +1412,7 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) {
     foreach ($rows as $number => $row) {
       $attributes = array();
 
-      // Check if we're dealing with a simple or complex row
+      // Check if we're dealing with a simple or complex row.
       if (isset($row['data'])) {
         foreach ($row as $key => $value) {
           if ($key == 'data') {
@@ -1498,7 +1501,7 @@ function theme_box($title, $content, $region = 'main') {
  * content.
  *
  * @param $type
- *   Number representing the marker type to display
+ *   Number representing the marker type to display.
  * @see MARK_NEW, MARK_UPDATED, MARK_READ
  * @return
  *   A string containing the marker.
@@ -1527,7 +1530,7 @@ function theme_mark($type = MARK_NEW) {
  * @param $title
  *   The title of the list.
  * @param $type
- *   The type of list to return (e.g. "ul", "ol")
+ *   The type of list to return (e.g. "ul", "ol").
  * @param $attributes
  *   The attributes applied to the list element.
  * @return
@@ -1592,7 +1595,7 @@ function theme_more_help_link($url) {
  *
  * @see theme_feed_icon()
  * @param $url
- *   The url of the feed.
+ *   The URL of the feed.
  */
 function theme_xml_icon($url) {
   if ($image = theme('image', 'misc/xml.png', t('XML feed'), t('XML feed'))) {
@@ -1604,7 +1607,7 @@ function theme_xml_icon($url) {
  * Return code that emits an feed icon.
  *
  * @param $url
- *   The url of the feed.
+ *   The URL of the feed.
  * @param $title
  *   A descriptive title of the feed.
   */
@@ -1618,9 +1621,9 @@ function theme_feed_icon($url, $title) {
  * Returns code that emits the 'more' link used on blocks.
  *
  * @param $url
- *   The url of the main page
+ *   The URL of the main page.
  * @param $title
- *   A descriptive verb for the link, like 'Read more'
+ *   A descriptive verb for the link, like 'Read more'.
  */
 function theme_more_link($url, $title) {
   return '<div class="more-link">'. t('<a href="@link" title="@title">more</a>', array('@link' => check_url($url), '@title' => $title)) .'</div>';
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 49702fe..9a86b52 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -745,11 +745,11 @@ function _filter_url_settings($format) {
 }
 
 /**
- * URL filter. Automatically converts text web addresses (URLs, e-mail addresses,
- * ftp links, etc.) into hyperlinks.
+ * URL filter. Automatically converts text web addresses (URLs, e-mail
+ * addresses, FTP links, etc.) into hyperlinks.
  */
 function _filter_url($text, $format) {
-  // Pass length to regexp callback
+  // Pass length to regexp callback.
   _filter_url_trim(NULL, variable_get('filter_url_length_'. $format, 72));
 
   $text = ' '. $text .' ';
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 1b027f3..9c87298 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -687,20 +687,23 @@ function template_preprocess_forums(&$variables) {
 
     // Loop through all node types for forum vocabulary.
     foreach ($vocabulary->nodes as $type) {
-      // Check if the current user has the 'create' permission for this node type.
+      // Check if the current user has the 'create' permission for this node
+      // type.
       if (node_access('create', $type)) {
         // Fetch the "General" name of the content type;
-        // Push the link with title and url to the array.
+        // Push the link with title and URL to the array.
         $forum_types[$type] = array('title' => t('Post new @node_type', array('@node_type' => node_get_types('name', $type))), 'href' => 'node/add/'. str_replace('_', '-', $type) .'/'. $variables['tid']);
       }
     }
 
     if (empty($forum_types)) {
-      // The user is logged-in; but denied access to create any new forum content type.
+      // The user is logged-in; but denied access to create any new forum
+      // content type.
       if ($user->uid) {
         $forum_types['disallowed'] = array('title' => t('You are not allowed to post new content in the forum.'));
       }
-      // The user is not logged-in; and denied access to create any new forum content type.
+      // The user is not logged-in; and denied access to create any new forum
+      // content type.
       else {
         $forum_types['login'] = array('title' => t('<a href="@login">Login</a> to post new content in the forum.', array('@login' => url('user/login', array('query' => drupal_get_destination())))), 'html' => TRUE);
       }
@@ -722,8 +725,9 @@ function template_preprocess_forums(&$variables) {
       $variables['topics'] = '';
     }
 
-    // Provide separate template suggestions based on what's being output. Topic id is also accounted for.
-    // Check both variables to be safe then the inverse. Forums with topic ID's take precedence.
+    // Provide separate template suggestions based on what's being output.
+    // Topic id is also accounted for. Check both variables to be safe then the
+    // inverse. Forums with topic ID's take precedence.
     if ($variables['forums'] && !$variables['topics']) {
       $variables['template_files'][] = 'forums-containers';
       $variables['template_files'][] = 'forums-'. $variables['tid'];
diff --git a/modules/node/node.tpl.php b/modules/node/node.tpl.php
index 0ae6fd9..0db067c 100644
--- a/modules/node/node.tpl.php
+++ b/modules/node/node.tpl.php
@@ -15,7 +15,7 @@
  * - $links: Themed links like "Read more", "Add new comment", etc. output
  *   from theme_links().
  * - $name: Themed username of node author output from theme_username().
- * - $node_url: Direct url of the current node.
+ * - $node_url: Direct URL of the current node.
  * - $terms: the themed list of taxonomy term links output from theme_links().
  * - $submitted: themed submission information output from
  *   theme_node_submitted().
diff --git a/modules/profile/profile-wrapper.tpl.php b/modules/profile/profile-wrapper.tpl.php
index 5b10d47..4601b59 100644
--- a/modules/profile/profile-wrapper.tpl.php
+++ b/modules/profile/profile-wrapper.tpl.php
@@ -6,7 +6,7 @@
  * profiles.
  *
  * This template is used when viewing a list of users. It can be a general
- * list for viewing all users with the url of "example.com/profile" or when
+ * list for viewing all users with the URL of "example.com/profile" or when
  * viewing a set of users who share a specific value for a profile such
  * as "example.com/profile/country/belgium".
  *
diff --git a/modules/system/system.module b/modules/system/system.module
index 8e9d237..92e1310 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1959,8 +1959,8 @@ function _system_zonelist() {
 function system_check_http_request() {
   // Try to get the content of the front page via drupal_http_request().
   $result = drupal_http_request(url('', array('absolute' => TRUE)), array(), 'GET', NULL, 0);
-  // We only care that we get a http response - this means that Drupal
-  // can make a http request.
+  // We only care that we get a HTTP response - this means that Drupal can make
+  // a HTTP request.
   $works = isset($result->code) && ($result->code >= 100) && ($result->code < 600);
   variable_set('drupal_http_request_fails', !$works);
   return $works;
diff --git a/scripts/drupal.sh b/scripts/drupal.sh
index 2bf035a..bf93010 100755
--- a/scripts/drupal.sh
+++ b/scripts/drupal.sh
@@ -2,10 +2,10 @@
 <?php
 
 /**
- * Drupal shell execution script
+ * Drupal shell execution script.
  *
- * Check for your PHP interpreter - on Windows you'll probably have to
- * replace line 1 with
+ * Check for your PHP interpreter - on Windows you'll probably have to replace
+ * line 1 with
  *   #!c:/program files/php/php.exe
  *
  * @param path  Drupal's absolute root directory in local file system (optional).
@@ -56,7 +56,7 @@ EOF;
   exit;
 }
 
-// define default settings
+// Define default settings.
 $cmd = 'index.php';
 $_SERVER['HTTP_HOST']       = 'default';
 $_SERVER['PHP_SELF']        = '/index.php';
@@ -66,7 +66,7 @@ $_SERVER['REQUEST_METHOD']  = 'GET';
 $_SERVER['QUERY_STRING']    = '';
 $_SERVER['PHP_SELF']        = $_SERVER['REQUEST_URI'] = '/';
 
-// toggle verbose mode
+// Toggle verbose mode.
 if (in_array('--verbose', $_SERVER['argv'])) {
   $_verbose_mode = true;
 }
@@ -74,11 +74,11 @@ else {
   $_verbose_mode = false;
 }
 
-// parse invocation arguments
+// Parse invocation arguments.
 while ($param = array_shift($_SERVER['argv'])) {
   switch ($param) {
     case '--root':
-      // change working directory
+      // Change working directory.
       $path = array_shift($_SERVER['argv']);
       if (is_dir($path)) {
         chdir($path);
@@ -97,22 +97,22 @@ while ($param = array_shift($_SERVER['argv'])) {
         break;
       }
       else {
-        // parse the URI
+        // Parse the URI.
         $path = parse_url($param);
 
-        // set site name
+        // Set site name.
         if (isset($path['host'])) {
           $_SERVER['HTTP_HOST'] = $path['host'];
         }
 
-        // set query string
+        // Set query string.
         if (isset($path['query'])) {
           $_SERVER['QUERY_STRING'] = $path['query'];
           parse_str($path['query'], $_GET);
           $_REQUEST = $_GET;
         }
 
-        // set file to execute or Drupal path (clean urls enabled)
+        // Set file to execute or Drupal path (clean URLs enabled).
         if (isset($path['path']) && file_exists(substr($path['path'], 1))) {
           $_SERVER['PHP_SELF'] = $_SERVER['REQUEST_URI'] = $path['path'];
           $cmd = substr($path['path'], 1);
@@ -123,7 +123,7 @@ while ($param = array_shift($_SERVER['argv'])) {
           }
         }
 
-        // display setup in verbose mode
+        // Display setup in verbose mode.
         if ($_verbose_mode) {
           echo "Hostname set to: {$_SERVER['HTTP_HOST']}\n";
           echo "Script name set to: {$cmd}\n";
