Commit 718fe5d9 authored by webchick's avatar webchick

Issue #1326472 by xjm: Add capitalization and periods to several inline comments in common.inc.

parent 47761b24
......@@ -817,7 +817,7 @@ function drupal_http_request($url, array $options = array()) {
// Mark that this request failed. This will trigger a check of the web
// server's ability to make outgoing HTTP requests the next time that
// requirements checking is performed.
// See system_requirements()
// See system_requirements().
variable_set('drupal_http_request_fails', TRUE);
return $result;
......@@ -1316,21 +1316,21 @@ function filter_xss($string, $allowed_tags = array('a', 'em', 'strong', 'cite',
if (!drupal_validate_utf8($string)) {
return '';
}
// Store the text format
// Store the text format.
_filter_xss_split($allowed_tags, TRUE);
// Remove NULL characters (ignored by some browsers)
// Remove NULL characters (ignored by some browsers).
$string = str_replace(chr(0), '', $string);
// Remove Netscape 4 JS entities
// Remove Netscape 4 JS entities.
$string = preg_replace('%&\s*\{[^}]*(\}\s*;?|$)%', '', $string);
// Defuse all HTML entities
// Defuse all HTML entities.
$string = str_replace('&', '&', $string);
// Change back only well-formed entities in our whitelist
// Decimal numeric entities
// Change back only well-formed entities in our whitelist:
// Decimal numeric entities.
$string = preg_replace('/&#([0-9]+;)/', '&#\1', $string);
// Hexadecimal numeric entities
// Hexadecimal numeric entities.
$string = preg_replace('/&#[Xx]0*((?:[0-9A-Fa-f]{2})+;)/', '&#x\1', $string);
// Named entities
// Named entities.
$string = preg_replace('/&([A-Za-z][A-Za-z0-9]*;)/', '&\1', $string);
return preg_replace_callback('%
......@@ -1369,16 +1369,16 @@ function _filter_xss_split($m, $store = FALSE) {
$string = $m[1];
if (substr($string, 0, 1) != '<') {
// We matched a lone ">" character
// We matched a lone ">" character.
return '&gt;';
}
elseif (strlen($string) == 1) {
// We matched a lone "<" character
// We matched a lone "<" character.
return '&lt;';
}
if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?|(<!--.*?-->)$%', $string, $matches)) {
// Seriously malformed
// Seriously malformed.
return '';
}
......@@ -1392,7 +1392,7 @@ function _filter_xss_split($m, $store = FALSE) {
}
if (!isset($allowed_html[strtolower($elem)])) {
// Disallowed HTML element
// Disallowed HTML element.
return '';
}
......@@ -1408,7 +1408,7 @@ function _filter_xss_split($m, $store = FALSE) {
$attrlist = preg_replace('%(\s?)/\s*$%', '\1', $attrlist, -1, $count);
$xhtml_slash = $count ? ' /' : '';
// Clean up attributes
// Clean up attributes.
$attr2 = implode(' ', _filter_xss_attributes($attrlist));
$attr2 = preg_replace('/[<>]/', '', $attr2);
$attr2 = strlen($attr2) ? ' ' . $attr2 : '';
......@@ -1433,7 +1433,7 @@ function _filter_xss_attributes($attr) {
switch ($mode) {
case 0:
// Attribute name, href for instance
// Attribute name, href for instance.
if (preg_match('/^([-a-zA-Z]+)/', $attr, $match)) {
$attrname = strtolower($match[1]);
$skip = ($attrname == 'style' || substr($attrname, 0, 2) == 'on');
......@@ -1443,7 +1443,7 @@ function _filter_xss_attributes($attr) {
break;
case 1:
// Equals sign or valueless ("selected")
// Equals sign or valueless ("selected").
if (preg_match('/^\s*=\s*/', $attr)) {
$working = 1; $mode = 2;
$attr = preg_replace('/^\s*=\s*/', '', $attr);
......@@ -1460,7 +1460,7 @@ function _filter_xss_attributes($attr) {
break;
case 2:
// Attribute value, a URL after href= for instance
// Attribute value, a URL after href= for instance.
if (preg_match('/^"([^"]*)"(\s+|$)/', $attr, $match)) {
$thisval = filter_xss_bad_protocol($match[1]);
......@@ -1497,7 +1497,7 @@ function _filter_xss_attributes($attr) {
}
if ($working == 0) {
// not well formed, remove and try again
// Not well formed; remove and try again.
$attr = preg_replace('/
^
(
......@@ -5029,7 +5029,7 @@ function drupal_cron_run() {
foreach ($queues as $queue_name => $info) {
DrupalQueue::get($queue_name)->createQueue();
}
// Register shutdown callback
// Register shutdown callback.
drupal_register_shutdown_function('drupal_cron_cleanup');
// Iterate through the modules calling their cron handlers (if any):
......@@ -5043,7 +5043,7 @@ function drupal_cron_run() {
}
}
// Record cron time
// Record cron time.
variable_set('cron_last', REQUEST_TIME);
watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE);
......@@ -5078,7 +5078,7 @@ function drupal_cron_cleanup() {
if (variable_get('cron_semaphore', FALSE)) {
watchdog('cron', 'Cron run exceeded the time limit and was aborted.', array(), WATCHDOG_WARNING);
// Release cron semaphore
// Release cron semaphore.
variable_del('cron_semaphore');
}
}
......@@ -5148,14 +5148,14 @@ function drupal_system_listing($mask, $directory, $key = 'name', $min_depth = 1)
$searchdir[] = "profiles/$profile/$directory";
}
// Always search sites/all/* as well as the global directories
// Always search sites/all/* as well as the global directories.
$searchdir[] = 'sites/all/' . $directory;
if (file_exists("$config/$directory")) {
$searchdir[] = "$config/$directory";
}
// Get current list of items
// Get current list of items.
if (!function_exists('file_scan_directory')) {
require_once DRUPAL_ROOT . '/core/includes/file.inc';
}
......@@ -6414,7 +6414,7 @@ function drupal_array_nested_key_exists(array $array, array $parents) {
*/
function drupal_common_theme() {
return array(
// theme.inc
// From theme.inc.
'html' => array(
'render element' => 'page',
'template' => 'html',
......@@ -6490,7 +6490,7 @@ function drupal_common_theme() {
'html_tag' => array(
'render element' => 'element',
),
// from theme.maintenance.inc
// From theme.maintenance.inc.
'maintenance_page' => array(
'variables' => array('content' => NULL, 'show_messages' => TRUE),
'template' => 'maintenance-page',
......@@ -6510,7 +6510,7 @@ function drupal_common_theme() {
'authorize_report' => array(
'variables' => array('messages' => array()),
),
// from pager.inc
// From pager.inc.
'pager' => array(
'variables' => array('tags' => array(), 'element' => 0, 'parameters' => array(), 'quantity' => 9),
),
......@@ -6529,7 +6529,7 @@ function drupal_common_theme() {
'pager_link' => array(
'variables' => array('text' => NULL, 'page_new' => NULL, 'element' => NULL, 'parameters' => array(), 'attributes' => array()),
),
// from menu.inc
// From menu.inc.
'menu_link' => array(
'render element' => 'element',
),
......@@ -6545,7 +6545,7 @@ function drupal_common_theme() {
'menu_local_tasks' => array(
'variables' => array('primary' => array(), 'secondary' => array()),
),
// from form.inc
// From form.inc.
'select' => array(
'render element' => 'element',
),
......@@ -7023,19 +7023,19 @@ function drupal_parse_info_format($data) {
)\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);
......@@ -7051,7 +7051,7 @@ function drupal_parse_info_format($data) {
$value = $constants[$value];
}
// Insert actual value
// Insert actual value.
if ($last == '') {
$last = count($parent);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment