Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.102
diff -u -r1.102 bootstrap.inc
--- includes/bootstrap.inc	2 Jul 2006 19:25:34 -0000	1.102
+++ includes/bootstrap.inc	6 Jul 2006 03:30:06 -0000
@@ -24,7 +24,7 @@
 define('DRUPAL_BOOTSTRAP_PATH', 5);
 define('DRUPAL_BOOTSTRAP_FULL', 6);
 
-// these values should match the'role' table
+// These values should match the'role' table.
 define('DRUPAL_ANONYMOUS_RID', 1);
 define('DRUPAL_AUTHENTICATED_RID', 2);
 
@@ -86,11 +86,11 @@
  *
  * Try finding a matching configuration directory by stripping the website's
  * hostname from left to right and pathname from right to left. The first
- * configuration file found will be used, the remaining will ignored. If no
+ * configuration file found will be used, the remaining will be ignored. If no
  * configuration file is found, return a default value '$confdir/default'.
  *
  * Example for a fictitious site installed at
- * http://www.drupal.org:8080/mysite/test/ the 'settings.php' is searched in
+ * http://www.drupal.org:8080/mysite/test/. The 'settings.php' is searched in
  * the following directories:
  *
  *  1. $confdir/8080.www.drupal.org.mysite.test
@@ -134,7 +134,7 @@
 }
 
 /**
- * Unsets all disallowed global variables. See $allowed for what's allowed.
+ * Unset all disallowed global variables. See $allowed for what's allowed.
  */
 function drupal_unset_globals() {
   if (ini_get('register_globals')) {
@@ -148,7 +148,7 @@
 }
 
 /**
- * Loads the configuration and sets the base URL correctly.
+ * Load the configuration and set the base URL correctly.
  */
 function conf_init() {
   global $db_url, $db_prefix, $base_url, $base_path, $base_root, $conf;
@@ -166,7 +166,7 @@
     $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'];
     if ($dir = trim(dirname($_SERVER['SCRIPT_NAME']), '\,/')) {
@@ -181,12 +181,12 @@
 }
 
 /**
- * Returns and optionally sets the filename for a system item (module,
+ * Return and optionally set 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.
  *
  * @param $type
- *   The type of the item (i.e. theme, theme_engine, module).
+ *   The type of the item (i.e. theme, theme_engine, or module).
  * @param $name
  *   The name of the item for which the filename is requested.
  * @param $filename
@@ -207,7 +207,7 @@
     $files[$type][$name] = $filename;
   }
   elseif (isset($files[$type][$name])) {
-    // nothing
+    // Nothing.
   }
   elseif (($file = db_result(db_query("SELECT filename FROM {system} WHERE name = '%s' AND type = '%s'", $name, $type))) && file_exists($file)) {
     $files[$type][$name] = $file;
@@ -236,7 +236,7 @@
  * file.
  */
 function variable_init($conf = array()) {
-  // NOTE: caching the variables improves performance with 20% when serving cached pages.
+  // Note: caching the variables improves performance by 20% when serving cached pages.
   if ($cached = cache_get('variables')) {
     $variables = unserialize($cached->data);
   }
@@ -262,6 +262,7 @@
  *   The name of the variable to return.
  * @param $default
  *   The default value to use if this variable has never been set.
+ *
  * @return
  *   The value of the variable.
  */
@@ -312,7 +313,7 @@
  * Retrieve the current page from the cache.
  *
  * Note, we do not serve cached pages when status messages are waiting (from
- * a redirected form submission which was completed).
+ * a redirected form submission that was completed).
  * Because the output handler is not activated, the resulting page will not
  * get cached either.
  */
@@ -346,11 +347,11 @@
 }
 
 /**
- * Includes a file with the provided type and name. This prevents
+ * Include 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).
+ *   The type of item to load (e.g. theme, theme_engine, module).
  * @param $name
  *   The name of the item to load.
  *
@@ -398,13 +399,13 @@
     }
     $none_match = !empty($_SERVER['HTTP_IF_NONE_MATCH']) ? $_SERVER['HTTP_IF_NONE_MATCH'] == $etag : NULL;
 
-    // The type checking here is very important, be careful when changing entries.
+    // The type checking here is very important; be careful when changing entries.
     if (($modified_since !== NULL || $none_match !== NULL) && $modified_since !== false && $none_match !== false) {
       header('HTTP/1.0 304 Not Modified');
       exit();
     }
 
-    // Send appropriate response:
+    // Send an appropriate response:
     header("Last-Modified: $date");
     header("ETag: $etag");
 
@@ -439,14 +440,14 @@
 }
 
 /**
- * Define the critical hooks that force modules to always be loaded.
+ * Define the critical hooks that force modules always to be loaded.
  */
 function bootstrap_hooks() {
   return array('init', 'exit');
 }
 
 /**
- * Unserializes and appends elements from a serialized string.
+ * Unserialize and append elements from a serialized string.
  *
  * @param $obj
  *   The object to which the elements are appended.
@@ -521,7 +522,7 @@
 
   $current_db = db_set_active();
 
-  // Note: log the exact, entire absolute URL.
+  // Note: log the exact, entire, absolute URL.
   $request_uri = $base_root . request_uri();
 
   db_query("INSERT INTO {watchdog} (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s', '%s', %d)", $user->uid, $type, $message, $severity, $link, $request_uri, referer_uri(), $_SERVER['REMOTE_ADDR'], time());
@@ -532,7 +533,7 @@
 }
 
 /**
- * Set a message which reflects the status of the performed operation.
+ * Set a message that reflects the status of the performed operation.
  *
  * If the function is called with no arguments, this function returns all set
  * messages without clearing them.
@@ -558,7 +559,7 @@
     $_SESSION['messages'][$type][] = $message;
   }
 
-  // messages not set when DB connection fails
+  // Messages are not set when the DB connection fails.
   return isset($_SESSION['messages']) ? $_SESSION['messages'] : NULL;
 }
 
@@ -576,7 +577,7 @@
 }
 
 /**
- * Perform an access check for a given mask and rule type. Rules are usually created via admin/access/rules page.
+ * Perform an access check for a given mask and rule type. Rules usually are created via admin/access/rules page.
  */
 function drupal_is_denied($type, $mask) {
   $allow = db_fetch_object(db_query("SELECT * FROM {access} WHERE status = 1 AND type = '%s' AND LOWER('%s') LIKE LOWER(mask)", $type, $mask));
@@ -588,9 +589,9 @@
 /**
  * A string describing a phase of Drupal to load. Each phase adds to the
  * previous one, so invoking a later phase automatically runs the earlier
- * phases too. The most important usage is that if you want to access
+ * phases too. The most important usage is that if you want to access a
  * Drupal database from a script without loading anything else, you can
- * include bootstrap.inc, and call drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE).
+ * include bootstrap.inc and call drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE).
  *
  * @param $phase
  *   A constant. Allowed values are:
@@ -620,7 +621,7 @@
   switch ($phase) {
     case DRUPAL_BOOTSTRAP_CONFIGURATION:
       drupal_unset_globals();
-      // Initialize the configuration
+      // Initialize the configuration.
       conf_init();
       break;
     case DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE:
@@ -648,7 +649,7 @@
       // Start a page timer:
       timer_start('page');
 
-      // deny access to hosts which were banned. t() is not yet available.
+      // Deny access to hosts that were banned. t() is not yet available.
       if (drupal_is_denied('host', $_SERVER['REMOTE_ADDR'])) {
         header('HTTP/1.0 403 Forbidden');
         print 'Sorry, '. $_SERVER['REMOTE_ADDR']. ' has been banned.';
@@ -674,7 +675,7 @@
 }
 
 /**
- * Enables use of the theme system without requiring database access. Since
+ * Enable use of the theme system without requiring database access. Since
  * there is not database access no theme will be enabled and the default
  * themeable functions will be called. Some themeable functions can not be used
  * without the full Drupal API loaded. For example, theme_page() is
Index: includes/cache.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/cache.inc,v
retrieving revision 1.2
diff -u -r1.2 cache.inc
--- includes/cache.inc	2 Jul 2006 00:34:36 -0000	1.2
+++ includes/cache.inc	5 Jul 2006 23:24:31 -0000
@@ -10,29 +10,29 @@
 function cache_get($key) {
   global $user;
 
-  // Garbage collection necessary when enforcing a minimum cache lifetime
+  // Garbage collection is necessary when enforcing a minimum cache lifetime.
   $cache_flush = variable_get('cache_flush', 0);
   if ($cache_flush && ($cache_flush + variable_get('cache_lifetime', 0) <= time())) {
-    // Time to flush old cache data
+    // Time to flush old cache data.
     db_query("DELETE FROM {cache} WHERE expire != %d AND expire <= %d", CACHE_PERMANENT, $cache_flush);
     variable_set('cache_flush', 0);
   }
 
   $cache = db_fetch_object(db_query("SELECT data, created, headers, expire FROM {cache} WHERE cid = '%s'", $key));
   if (isset($cache->data)) {
-    // If the data is permanent or we're not enforcing a minimum cache lifetime
+    // If the data are permanent or we're not enforcing a minimum cache lifetime,
     // always return the cached data.
     if ($cache->expire == CACHE_PERMANENT || !variable_get('cache_lifetime', 0)) {
       $cache->data = db_decode_blob($cache->data);
     }
-    // If enforcing a minimum cache lifetime, validate that the data is
-    // currently valid for this user before we return it by making sure the
+    // If enforcing a minimum cache lifetime, validate that the data are
+    // currently valid for this user before we return them by making sure the
     // cache entry was created before the timestamp in the current session's
     // cache timer. The cache variable is loaded into the $user object by
     // sess_read() in session.inc.
     else {
       if ($user->cache > $cache->created) {
-        // This cache data is too old and thus not valid for us, ignore it.
+        // These cache data are too old and thus not valid for us, ignore them.
         return 0;
       }
       else {
@@ -95,11 +95,11 @@
 
       $cache_flush = variable_get('cache_flush', 0);
       if ($cache_flush == 0) {
-        // This is the first request to clear the cache, start a timer.
+        // This is the first request to clear the cache, so start a timer.
         variable_set('cache_flush', time());
       }
       else if (time() > ($cache_flush + variable_get('cache_lifetime', 0))) {
-        // Clear the cache for everyone, cache_flush_delay seconds have
+        // Clear the cache for everyone; cache_flush_delay seconds have
         // passed since the first request to clear the cache.
         db_query("DELETE FROM {cache} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
         variable_set('cache_flush', 0);
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.544
diff -u -r1.544 common.inc
--- includes/common.inc	2 Jul 2006 19:53:39 -0000	1.544
+++ includes/common.inc	6 Jul 2006 03:29:34 -0000
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Common functions that many Drupal modules will need to reference.
+ * Provides common functions that many Drupal modules will need to reference.
  *
  * The functions that are critical and need to be available even when serving
  * a cached page are instead located in bootstrap.inc.
@@ -29,7 +29,6 @@
  *
  * @param $region
  *   Page region the content is assigned to.
- *
  * @param $data
  *   Content to be set.
  */
@@ -47,7 +46,6 @@
  *
  * @param $region
  *   A specified region to fetch content for. If null, all regions will be returned.
- *
  * @param $delimiter
  *   Content to be inserted between exploded array elements.
  */
@@ -99,6 +97,7 @@
 
 /**
  * Add output to the head tag of the HTML page.
+ *
  * This function can be called as long the headers aren't sent.
  */
 function drupal_set_html_head($data = NULL) {
@@ -120,7 +119,7 @@
 }
 
 /**
- * Reset the static variable which holds the aliases mapped for this request.
+ * Reset the static variable that holds the aliases mapped for this request.
  */
 function drupal_clear_path_cache() {
   drupal_lookup_path('wipe');
@@ -159,15 +158,16 @@
  * Parse an array into a valid urlencoded query string.
  *
  * @param $query
- *   The array to be processed e.g. $_GET
+ *   The array to be processed e.g. $_GET.
  * @param $exclude
  *   The array filled with keys to be excluded. Use parent[child] to exclude nested items.
  * @param $urlencode
  *   If TRUE, the keys and values are both urlencoded.
  * @param $parent
- *   Should not be passed, only used in recursive calls
+ *   Should not be passed, only used in recursive calls.
+ *
  * @return
- *   urlencoded string which can be appended to/as the URL query string
+ *   A url-encoded string that can be appended to/as the URL query string.
  */
 function drupal_query_string_encode($query, $exclude = array(), $parent = '') {
   $params = array();
@@ -196,9 +196,9 @@
 /**
  * Prepare a destination query string for use in combination with
  * drupal_goto(). Used to direct the user back to the referring page
- * after completing a form. By default the current URL is returned.
+ * after completing a form. By default, the current URL is returned.
  * If a destination exists in the previous request, that destination
- * is returned. As such, a destination can persist across multiple
+ * is returned. Accordingly, a destination can persist across multiple
  * pages.
  *
  * @see drupal_goto()
@@ -224,17 +224,17 @@
  * This issues an on-site HTTP redirect. The function makes sure the redirected
  * URL is formatted correctly.
  *
- * Usually the redirected URL is constructed from this function's input
- * parameters. However you may override that behavior by setting a
+ * Usually, the redirected URL is constructed from this function's input
+ * parameters. However, you may override that behavior by setting a
  * <em>destination</em> 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
+ * the proper page after completing a form, for example, after editing
  * a post on the 'admin/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.
  *
- * It is advised to use drupal_goto() instead of PHP's header(), because
+ * It is advised to use drupal_goto() instead of PHP's header() because
  * drupal_goto() will append the user's session ID to the URI when PHP is
  * compiled with "--enable-trans-sid".
  *
@@ -272,7 +272,7 @@
 }
 
 /**
- * Generates a site off-line message
+ * Generate a site off-line message.
  */
 function drupal_site_offline() {
   drupal_set_header('HTTP/1.0 503 Service unavailable');
@@ -282,13 +282,13 @@
 }
 
 /**
- * Generates a 404 error if the request can not be handled.
+ * Generate a 404 error if the request can not be handled.
  */
 function drupal_not_found() {
   drupal_set_header('HTTP/1.0 404 Not Found');
   watchdog('page not found', t('%page not found.', array('%page' => theme('placeholder', $_GET['q']))), WATCHDOG_WARNING);
 
-  // Keep old path for reference
+  // Keep old path for reference.
   if (!isset($_REQUEST['destination'])) {
     $_REQUEST['destination'] = $_GET['q'];
   }
@@ -310,13 +310,13 @@
 }
 
 /**
- * Generates a 403 error if the request is not allowed.
+ * Generate a 403 error if the request is not allowed.
  */
 function drupal_access_denied() {
   drupal_set_header('HTTP/1.0 403 Forbidden');
   watchdog('access denied', t('%page denied access.', array('%page' => theme('placeholder', $_GET['q']))), WATCHDOG_WARNING, l(t('view'), $_GET['q']));
 
-  // Keep old path for reference
+  // Keep the old path for reference.
   if (!isset($_REQUEST['destination'])) {
     $_REQUEST['destination'] = $_GET['q'];
   }
@@ -355,6 +355,7 @@
  * @param $retry
  *   An integer representing how many times to retry the request in case of a
  *   redirect.
+ *
  * @return
  *   An object containing the HTTP request headers, response code, headers,
  *   data, and redirect status.
@@ -362,7 +363,7 @@
 function drupal_http_request($url, $headers = array(), $method = 'GET', $data = NULL, $retry = 3) {
   $result = new StdClass();
 
-  // Parse the URL, and make sure we can handle the schema.
+  // Parse the URL and make sure we can handle the schema.
   $uri = parse_url($url);
   switch ($uri['scheme']) {
     case 'http':
@@ -495,7 +496,7 @@
     $types = array(1 => 'error', 2 => 'warning', 4 => 'parse error', 8 => 'notice', 16 => 'core error', 32 => 'core warning', 64 => 'compile error', 128 => 'compile warning', 256 => 'user error', 512 => 'user warning', 1024 => 'user notice', 2048 => 'strict warning');
     $entry = $types[$errno] .': '. $message .' in '. $filename .' on line '. $line .'.';
 
-    // Note: force display of error messages in update.php
+    // Note: force display of error messages in update.php.
     if (variable_get('error_level', 1) == 1 || strstr($_SERVER['PHP_SELF'], 'update.php')) {
       drupal_set_message($entry, 'error');
     }
@@ -593,6 +594,7 @@
  * @param $args
  *   An associative array of replacements to make after translation. Incidences
  *   of any key in this array are replaced with the corresponding value.
+ *
  * @return
  *   The translated string.
  */
@@ -623,6 +625,7 @@
  *
  * @param $mail
  *   A string containing an e-mail address.
+ *
  * @return
  *   TRUE if the address is in a valid format.
  */
@@ -642,6 +645,7 @@
  *   The URL to verify.
  * @param $absolute
  *   Whether the URL is absolute (beginning with a scheme such as "http:").
+ *
  * @return
  *   TRUE if the URL is in a valid format.
  */
@@ -667,13 +671,14 @@
 
 /**
  * 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
+ * The user is allowed to proceed if he/she did not trigger the specified event more than
  * $threshold times per hour.
  *
  * @param $name
  *   The name of the event.
  * @param $number
  *   The maximum number of the specified event per hour (per visitor).
+ *
  * @return
  *   True if the user did not exceed the hourly threshold. False otherwise.
  */
@@ -706,7 +711,6 @@
  * Arbitrary elements may be added using the $args associative array.
  */
 function format_rss_channel($title, $link, $description, $items, $language = 'en', $args = array()) {
-  // arbitrary elements may be added using the $args associative array
 
   $output = "<channel>\n";
   $output .= ' <title>'. check_plain($title) ."</title>\n";
@@ -776,15 +780,17 @@
  *   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".
+ *
  * @return
  *   A translated string.
  */
 function format_plural($count, $singular, $plural) {
   if ($count == 1) return t($singular, array("%count" => $count));
 
-  // get the plural index through the gettext formula
+  // Get the plural index through the gettext formula.
   $index = (function_exists('locale_get_plural')) ? locale_get_plural($count) : -1;
-  if ($index < 0) { // backward compatibility
+  // Backward compatibility.
+  if ($index < 0) {
     return t($plural, array("%count" => $count));
   }
   else {
@@ -804,6 +810,7 @@
  *
  * @param $size
  *   The size in bytes.
+ *
  * @return
  *   A translated string representation of the size.
  */
@@ -827,6 +834,7 @@
  *   The length of the interval in seconds.
  * @param $granularity
  *   How many different units to display in the string.
+ *
  * @return
  *   A translated string representation of the interval.
  */
@@ -866,6 +874,7 @@
  *   format.
  * @param $timezone
  *   Time zone offset in seconds; if omitted, the user's time zone is used.
+ *
  * @return
  *   A translated date string in the requested format.
  */
@@ -890,7 +899,7 @@
       $format = variable_get('date_format_long', 'l, F j, Y - H:i');
       break;
     case 'custom':
-      // No change to format
+      // No change to format.
       break;
     case 'medium':
     default:
@@ -947,8 +956,9 @@
  *   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.
+ *
  * @return
- *   a string containing a URL to the given path.
+ *   A string containing a URL to the given path.
  *
  * When creating links in modules, consider whether l() could be a better
  * alternative than url().
@@ -961,18 +971,18 @@
   // Return an external link if $path contains an allowed absolute URL.
   // Only call the slow filter_xss_bad_protocol if $path contains a ':'.
   if (strpos($path, ':') !== FALSE && filter_xss_bad_protocol($path, FALSE) == check_plain($path)) {
-    // Split off the fragment
+    // Split off the fragment.
     if (strpos($path, '#')) {
       list($path, $old_fragment) = explode('#', $path, 2);
       if (isset($old_fragment) && !isset($fragment)) {
         $fragment = '#'. $old_fragment;
       }
     }
-    // Append the query
+    // Append the query.
     if (isset($query)) {
       $path .= (strpos($path, '?') ? '&' : '?') . $query;
     }
-    // Reassemble
+    // Reassemble.
     return $path . $fragment;
   }
 
@@ -981,7 +991,7 @@
   static $clean_url;
 
   if (empty($script)) {
-    // On some web servers, such as IIS, we can't omit "index.php". So, we
+    // On some web servers, such as IIS, we can't omit "index.php". So we
     // generate "index.php?q=foo" instead of "?q=foo" on anything that is not
     // Apache.
     $script = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === false) ? 'index.php' : '';
@@ -1030,6 +1040,7 @@
  *
  * @param $attributes
  *   An associative array of HTML attributes.
+ *
  * @return
  *   An HTML string ready for insertion in a tag.
  */
@@ -1046,7 +1057,7 @@
 /**
  * Format an internal Drupal link.
  *
- * This function correctly handles aliased paths, and allows themes to highlight
+ * This function correctly handles aliased paths and allows themes to highlight
  * links to the current page correctly, so all internal links output by modules
  * should be generated by this function if possible.
  *
@@ -1056,10 +1067,10 @@
  *   The Drupal path being linked to, such as "admin/node". Can be an external
  *   or internal URL.
  *     - If you provide the full URL, it will be considered an
- *   external URL.
+ *       external URL.
  *     - If you provide only the path (e.g. "admin/node"), it is considered an
- *   internal link. In this case, it must be a system URL as the url() function
- *   will generate the alias.
+ *       internal link. In this case, it must be a system URL as the url() function
+ *       will generate the alias.
  * @param $attributes
  *   An associative array of HTML attributes to apply to the anchor tag.
  * @param $query
@@ -1071,11 +1082,12 @@
  *   Useful for links that will be displayed outside the site, such as in an RSS
  *   feed.
  * @param $html
- *   Whether the title is HTML, or just plain-text. For example for making an
+ *   Whether the title is HTML, or just plain-text. For example, for making an
  *   image a link, this must be set to TRUE, or else you will see the encoded
  *   HTML.
+ *
  * @return
- *   an HTML string containing a link to the given path.
+ *   An HTML string containing a link to the given path.
  */
 function l($text, $path, $attributes = array(), $query = NULL, $fragment = NULL, $absolute = FALSE, $html = FALSE) {
   if ($path == $_GET['q']) {
@@ -1116,6 +1128,7 @@
  *   A linear array.
  * @param $function
  *   The name of a function to apply to all values before output.
+ *
  * @result
  *   An associative array.
  */
@@ -1144,11 +1157,12 @@
  * <?php ?> tags; in other words, we evaluate the code as if it were a stand-alone
  * PHP file.
  *
- * Using this wrapper also ensures that the PHP code which is evaluated can not
+ * Using this wrapper also ensures that the PHP code that is evaluated can not
  * overwrite any variables in the calling code, unlike a regular eval() call.
  *
  * @param $code
  *   The code to evaluate.
+ *
  * @return
  *   A string containing the printed output of the code, followed by the returned
  *   output of the code.
@@ -1162,7 +1176,7 @@
 }
 
 /**
- * Returns the path to a system item (module, theme, etc.).
+ * Return the path to a system item (module, theme, etc.).
  *
  * @param $type
  *   The type of the item (i.e. theme, theme_engine, module).
@@ -1177,7 +1191,7 @@
 }
 
 /**
- * Returns the base URL path of the Drupal installation.
+ * Return the base URL path of the Drupal installation.
  * At the very least, this will always default to /.
  */
 function base_path() {
@@ -1220,7 +1234,8 @@
 }
 
 /**
- * Generates a Javascript call, while importing the arguments as is.
+ * Generate a Javascript call, while importing the arguments as is.
+ *
  * PHP arrays are turned into JS objects to preserve keys. This means the array
  * keys must conform to JS's member naming rules.
  *
@@ -1241,7 +1256,7 @@
 }
 
 /**
- * Converts a PHP variable into its Javascript equivalent.
+ * Convert a PHP variable into its Javascript equivalent.
  *
  * We use HTML-safe strings, i.e. with <, > and & escaped.
  */
@@ -1265,7 +1280,7 @@
         }
         return '[ '. implode(', ', $output) .' ]';
       }
-      // Fall through
+      // Fall through.
     case 'object':
       $output = array();
       foreach ($var as $k => $v) {
@@ -1306,7 +1321,7 @@
 }
 
 /**
- * Performs one or more XML-RPC request(s).
+ * Perform one or more XML-RPC request(s).
  *
  * @param $url
  *   An absolute URL of the XML-RPC endpoint.
@@ -1318,6 +1333,7 @@
  *   For multiple requests (system.multicall):
  *     An array of call arrays. Each call array follows the pattern of the single
  *     request: method name followed by the arguments to the method.
+ *
  * @return
  *   For one request:
  *     Either the return value of the method on success, or FALSE.
@@ -1353,15 +1369,15 @@
   set_error_handler('error_handler');
   // Emit the correct charset HTTP header.
   drupal_set_header('Content-Type: text/html; charset=utf-8');
-  // Detect string handling method
+  // Detect string handling method.
   unicode_check();
-  // Undo magic quotes
+  // Undo magic quotes.
   fix_gpc_magic();
-  // Load all enabled modules
+  // Load all enabled modules.
   module_load_all();
   // Initialize the localization system.  Depends on i18n.module being loaded already.
   $locale = locale_initialize();
-  // Let all modules take action before menu system handles the reqest
+  // Let all modules take action before menu system handles the request.
   module_invoke_all('init');
 
 }
@@ -1388,15 +1404,15 @@
       $cache = TRUE;
       if (function_exists('gzencode')) {
         // We do not store the data in case the zlib mode is deflate.
-        // This should be rarely happening.
+        // This should happen only rarely.
         if (zlib_get_coding_type() == 'deflate') {
           $cache = FALSE;
         }
         else if (zlib_get_coding_type() == FALSE) {
           $data = gzencode($data, 9, FORCE_GZIP);
         }
-        // The remaining case is 'gzip' which means the data is
-        // already compressed and nothing left to do but to store it.
+        // The remaining case is 'gzip', which means the data are
+        // already compressed and nothing left to do but to store them.
       }
       ob_end_flush();
       if ($cache && $data) {
