diff --git a/cron.php b/cron.php index 7e2ba89a7732d66199cb5eb0ffc5d293095e3f0b..cdc0b45c58416aab6338efcfec1a8897c5fc56c0 100644 --- a/cron.php +++ b/cron.php @@ -15,17 +15,17 @@ } // Check if the last cron run completed -if (variable_get('cron_busy', false)) { +if (variable_get('cron_busy', FALSE)) { watchdog('cron', t('Last cron run did not complete.'), WATCHDOG_WARNING); } else { - variable_set('cron_busy', true); + variable_set('cron_busy', TRUE); } // Iterate through the modules calling their cron handlers (if any): module_invoke_all('cron'); // Clean up -variable_set('cron_busy', false); +variable_set('cron_busy', FALSE); variable_set('cron_last', time()); watchdog('cron', t('Cron run completed')); diff --git a/database/updates.inc b/database/updates.inc index 3fe357b34131a9255e0b85f58e78e997ab8b5e13..f9f4bff7f5abbbcd1933ba262f9a7a2cfbecea7e 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -922,7 +922,7 @@ function system_update_150() { function system_update_151() { $ret = array(); - $ts = variable_get('theme_settings', null); + $ts = variable_get('theme_settings', NULL); // set up data array so we can loop over both sets of links $menus = array(0 => array('links_var' => 'primary_links', @@ -1535,7 +1535,7 @@ function _system_update_utf8($tables) { } function system_update_170() { - if (!variable_get('update_170_done', false)) { + if (!variable_get('update_170_done', FALSE)) { switch ($GLOBALS['db_type']) { case 'pgsql': $ret = array(); @@ -1763,21 +1763,21 @@ function _update_178_url_formats() { // Any format with the HTML filter in it $result = db_query("SELECT format FROM {filters} WHERE module = 'filter' AND delta = 0"); while ($format = db_fetch_object($result)) { - $formats[$format->format] = true; + $formats[$format->format] = TRUE; } // Any format with only the linebreak filter in it $result = db_query("SELECT format FROM {filters} WHERE module = 'filter' AND delta = 2"); while ($format = db_fetch_object($result)) { if (db_result(db_query('SELECT COUNT(*) FROM {filters} WHERE format = %d', $format->format)) == 1) { - $formats[$format->format] = true; + $formats[$format->format] = TRUE; } } // Any format with 'HTML' in its name $result = db_query("SELECT format FROM {filter_formats} WHERE name LIKE '%HTML%'"); while ($format = db_fetch_object($result)) { - $formats[$format->format] = true; + $formats[$format->format] = TRUE; } return $formats; diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index b192cbbf785c27a18e2dd8bc4c4d7b549ff3969e..ba7ab0a0314047e3fe656be1100f7eee8b9d36f6 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -399,7 +399,7 @@ function drupal_page_header() { $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. - if (($modified_since !== NULL || $none_match !== NULL) && $modified_since !== false && $none_match !== false) { + if (($modified_since !== NULL || $none_match !== NULL) && $modified_since !== FALSE && $none_match !== FALSE) { header('HTTP/1.0 304 Not Modified'); exit(); } @@ -409,7 +409,7 @@ function drupal_page_header() { header("ETag: $etag"); // Determine if the browser accepts gzipped data. - if (@strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') === false && function_exists('gzencode')) { + if (@strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') === FALSE && function_exists('gzencode')) { // Strip the gzip header and run uncompress. $cache->data = gzinflate(substr(substr($cache->data, 10), 0, -8)); } @@ -433,7 +433,7 @@ function drupal_page_header() { header("Expires: Sun, 19 Nov 1978 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); + header("Cache-Control: post-check=0, pre-check=0", FALSE); header("Pragma: no-cache"); } } diff --git a/includes/cache.inc b/includes/cache.inc index c33961a449ec228b99f7e323f744118a44bcfc20..1559d342963a5189c74bc03f8cf139d61efa63f5 100644 --- a/includes/cache.inc +++ b/includes/cache.inc @@ -79,10 +79,10 @@ function cache_set($cid, $data, $expire = CACHE_PERMANENT, $headers = NULL) { * expire are deleted. * * @param $wildcard - * If set to true, the $cid is treated as a substring to match rather than a + * If set to TRUE, the $cid is treated as a substring to match rather than a * complete ID. */ -function cache_clear_all($cid = NULL, $wildcard = false) { +function cache_clear_all($cid = NULL, $wildcard = FALSE) { global $user; if (empty($cid)) { diff --git a/includes/common.inc b/includes/common.inc index e1bda87d137d5d88d87d4c7ed3292d46cfadf3f6..828d6e116d702ecbc5f89978bc5f5a305a3177f6 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -33,7 +33,7 @@ * @param $data * Content to be set. */ -function drupal_set_content($region = null, $data = null) { +function drupal_set_content($region = NULL, $data = NULL) { static $content = array(); if (!is_null($region) && !is_null($data)) { @@ -46,7 +46,7 @@ function drupal_set_content($region = null, $data = null) { * Get assigned content. * * @param $region - * A specified region to fetch content for. If null, all regions will be returned. + * A specified region to fetch content for. If NULL, all regions will be returned. * * @param $delimiter * Content to be inserted between exploded array elements. @@ -518,13 +518,13 @@ function _fix_gpc_magic(&$item) { * installations. */ function fix_gpc_magic() { - static $fixed = false; + static $fixed = FALSE; if (!$fixed && ini_get('magic_quotes_gpc')) { array_walk($_GET, '_fix_gpc_magic'); array_walk($_POST, '_fix_gpc_magic'); array_walk($_COOKIE, '_fix_gpc_magic'); array_walk($_REQUEST, '_fix_gpc_magic'); - $fixed = true; + $fixed = TRUE; } } @@ -901,10 +901,10 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL $date = ''; for ($i = 0; $i < $max; $i++) { $c = $format[$i]; - if (strpos('AaDFlM', $c) !== false) { + if (strpos('AaDFlM', $c) !== FALSE) { $date .= t(gmdate($c, $timestamp)); } - else if (strpos('BdgGhHiIjLmnsStTUwWYyz', $c) !== false) { + else if (strpos('BdgGhHiIjLmnsStTUwWYyz', $c) !== FALSE) { $date .= gmdate($c, $timestamp); } else if ($c == 'r') { @@ -984,7 +984,7 @@ function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE) { // 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' : ''; + $script = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === FALSE) ? 'index.php' : ''; } // Cache the clean_url variable to improve performance. @@ -1211,11 +1211,11 @@ function drupal_add_js($file, $nocache = FALSE) { $postfix = $nocache ? '?'. time() : ''; if (!isset($sent['misc/drupal.js'])) { drupal_set_html_head(''); - $sent['misc/drupal.js'] = true; + $sent['misc/drupal.js'] = TRUE; } if (!isset($sent[$file])) { drupal_set_html_head(''); - $sent[$file] = true; + $sent[$file] = TRUE; } } diff --git a/includes/database.inc b/includes/database.inc index 987adbc289799a239043e8a472cca3f8b7c092ad..7fca7a2b5867c457a2b28ca498ac01d6f15a47e6 100644 --- a/includes/database.inc +++ b/includes/database.inc @@ -146,7 +146,7 @@ function _db_query_callback($match, $init = FALSE) { } switch ($match[1]) { - case '%d': // We must use type casting to int to convert false/null/(true?) + case '%d': // We must use type casting to int to convert FALSE/NULL/(TRUE?) return (int) array_shift($args); // We don't need db_escape_string as numbers are db-safe case '%s': return db_escape_string(array_shift($args)); diff --git a/includes/file.inc b/includes/file.inc index 71ec3c06b33a69c01e5e1c4f2eb3de88adbe0358..d234bb9de68e49be51c1b390d79804d1a990d944 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -81,7 +81,7 @@ function file_create_path($dest = 0) { * any errors will be attached to. This is useful for settings forms that * require the user to specify a writable directory. If it can't be made to * work, a form error will be set preventing them from saving the settings. - * @return False when directory not found, or true when directory exists. + * @return FALSE when directory not found, or TRUE when directory exists. */ function file_check_directory(&$directory, $mode = 0, $form_item = NULL) { $directory = rtrim($directory, '/\\'); @@ -96,7 +96,7 @@ function file_check_directory(&$directory, $mode = 0, $form_item = NULL) { if ($form_item) { form_set_error($form_item, t('The directory %directory does not exist.', array('%directory' => theme('placeholder', $directory)))); } - return false; + return FALSE; } } @@ -108,7 +108,7 @@ function file_check_directory(&$directory, $mode = 0, $form_item = NULL) { else { form_set_error($form_item, t('The directory %directory is not writable', array('%directory' => theme('placeholder', $directory)))); watchdog('file system', t('The directory %directory is not writable, because it does not have the correct permissions set.', array('%directory' => theme('placeholder', $directory))), WATCHDOG_ERROR); - return false; + return FALSE; } } @@ -124,7 +124,7 @@ function file_check_directory(&$directory, $mode = 0, $form_item = NULL) { } } - return true; + return TRUE; } /** @@ -148,7 +148,7 @@ function file_check_path(&$path) { return $filename; } - return false; + return FALSE; } @@ -163,7 +163,7 @@ function file_check_path(&$path) { * @todo Extenalize SESSION['file_uploads'] to modules. * * @param $source An upload source (the name of the upload form item), or a file - * @return false for an invalid file or upload. A file object for valid uploads/files. + * @return FALSE for an invalid file or upload. A file object for valid uploads/files. * */ @@ -181,7 +181,7 @@ function file_check_upload($source = 'upload') { return $source; } else { - return false; + return FALSE; } } @@ -194,7 +194,7 @@ function file_check_upload($source = 'upload') { // If a file was uploaded, process it. if ($_FILES["edit"]["name"][$source] && is_uploaded_file($_FILES["edit"]["tmp_name"][$source])) { - // Check for file upload errors and return false if a + // Check for file upload errors and return FALSE if a // lower level system error occurred. switch ($_FILES["edit"]["error"][$source]) { @@ -239,7 +239,7 @@ function file_check_upload($source = 'upload') { if (!move_uploaded_file($_FILES["edit"]["tmp_name"][$source], $file->filepath)) { drupal_set_message(t('File upload error. Could not move uploaded file.')); watchdog('file', t('Upload Error. Could not move uploaded file(%file) to destination(%destination).', array('%file' => theme('placeholder', $_FILES["edit"]["tmp_name"][$source]), '%destination' => theme('placeholder', $file->filepath)))); - return false; + return FALSE; } $file->filesize = $_FILES["edit"]["size"][$source]; @@ -256,8 +256,8 @@ function file_check_upload($source = 'upload') { return $_SESSION['file_uploads'][$source]; } } - // If nothing was done, return false. - return false; + // If nothing was done, return FALSE. + return FALSE; } /** @@ -266,7 +266,7 @@ function file_check_upload($source = 'upload') { * exploits. * * @code - * // Returns false: + * // Returns FALSE: * file_check_location('/www/example.com/files/../../../etc/passwd', '/www/example.com/files'); * @endcode * @@ -306,8 +306,8 @@ function file_check_location($source, $directory = '') { * @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_ERROR - Do nothing and return false. - * @return True for success, false for failure. + * - FILE_EXISTS_ERROR - Do nothing and return FALSE. + * @return True for success, FALSE for failure. */ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) { $dest = file_create_path($dest); @@ -316,7 +316,7 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) { $basename = file_check_path($directory); // Make sure we at least have a valid directory. - if ($basename === false) { + if ($basename === FALSE) { $source = is_object($source) ? $source->filepath : $source; drupal_set_message(t('The selected file %file could not be uploaded, because the destination %directory is not properly configured.', array('%file' => theme('placeholder', $source), '%directory' => theme('placeholder', $dest))), 'error'); watchdog('file system', t('The selected file %file could not not be uploaded, because the destination %directory could not be found, or because its permissions do not allow the file to be written.', array('%file' => theme('placeholder', $source), '%directory' => theme('placeholder', $dest))), WATCHDOG_ERROR); @@ -408,8 +408,8 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) { * @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_ERROR - Do nothing and return false. - * @return True for success, false for failure. + * - FILE_EXISTS_ERROR - Do nothing and return FALSE. + * @return True for success, FALSE for failure. */ function file_move(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) { @@ -460,7 +460,7 @@ function file_create_filename($basename, $directory) { * Delete a file. * * @param $path A string containing a file path. - * @return True for success, false for failure. + * @return True for success, FALSE for failure. */ function file_delete($path) { if (is_file($path)) { @@ -477,11 +477,11 @@ function file_delete($path) { * success. * @param $dest A string containing the directory $source should be copied to, * will use the temporary directory in case no other value is set. - * @param $replace A boolean, set to true if the destination should be replaced - * when in use, but when false append a _X to the filename. + * @param $replace A boolean, set to TRUE if the destination should be replaced + * when in use, but when FALSE append a _X to the filename. * @return An object containing file info or 0 in case of error. */ -function file_save_upload($source, $dest = false, $replace = FILE_EXISTS_RENAME) { +function file_save_upload($source, $dest = FALSE, $replace = FILE_EXISTS_RENAME) { // Make sure $source exists && is valid. if ($file = file_check_upload($source)) { @@ -516,7 +516,7 @@ function file_save_upload($source, $dest = false, $replace = FILE_EXISTS_RENAME) * @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_ERROR - Do nothing and return false. + * - FILE_EXISTS_ERROR - Do nothing and return FALSE. * * @return A string containing the resulting filename or 0 on error */ diff --git a/includes/form.inc b/includes/form.inc index cd2e5b9eb067dbd9cc80912e65b0c5da7c66efed..80f53726c24b495195796983ecfe390d27bbc1fe 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -576,7 +576,7 @@ function _form_sort($a, $b) { /** * Retrieve the default properties for the defined element type. */ -function _element_info($type, $refresh = null) { +function _element_info($type, $refresh = NULL) { static $cache; $basic_defaults = array( @@ -1054,7 +1054,7 @@ function theme_form($element) { */ function theme_textarea($element) { $class = array('form-textarea'); - if ($element['#resizable'] !== false) { + if ($element['#resizable'] !== FALSE) { drupal_add_js('misc/textarea.js'); $class[] = 'resizable'; } diff --git a/includes/image.inc b/includes/image.inc index cea0be011e3d96a61e8825b11c958bcce3b7d092..f14afa9c0f2832ad4118dd828219f13fd383fa3d 100644 --- a/includes/image.inc +++ b/includes/image.inc @@ -36,7 +36,7 @@ function image_get_toolkit() { include_once $toolkit_file; } elseif (!image_gd_check_settings()) { - $toolkit = false; + $toolkit = FALSE; } } @@ -59,7 +59,7 @@ function image_toolkit_invoke($method, $params = array()) { } else { watchdog('php', t("The selected image handling toolkit '%toolkit' can not correctly process '%function'.", array('%toolkit' => "$toolkit", '%function' => "$function")), WATCHDOG_ERROR); - return false; + return FALSE; } } else { @@ -82,10 +82,10 @@ function image_toolkit_invoke($method, $params = array()) { */ function image_get_info($file) { if (!is_file($file)) { - return false; + return FALSE; } - $details = false; + $details = FALSE; $data = @getimagesize($file); $file_size = @filesize($file); @@ -111,14 +111,14 @@ function image_get_info($file) { * @param $width The target width * @param $height The target height * - * @return True or false, based on success + * @return True or FALSE, based on success */ function image_scale($source, $destination, $width, $height) { $info = image_get_info($source); // don't scale up if ($width > $info['width'] && $height > $info['height']) { - return false; + return FALSE; } $aspect = $info['height'] / $info['width']; @@ -185,7 +185,7 @@ function image_gd_settings() { } else { form_set_error('image_toolkit', t("The built-in GD image toolkit requires that the GD module for PHP be installed and configured properly. For more information see %url.", array('%url' => 'http://php.net/image'))); - return false; + return FALSE; } } @@ -198,10 +198,10 @@ function image_gd_check_settings() { if ($check = get_extension_funcs('gd')) { if (in_array('imagegd2', $check)) { // GD2 support is available. - return true; + return TRUE; } } - return false; + return FALSE; } /** @@ -209,17 +209,17 @@ function image_gd_check_settings() { */ function image_gd_resize($source, $destination, $width, $height) { if (!file_exists($source)) { - return false; + return FALSE; } $info = image_get_info($source); if (!$info) { - return false; + return FALSE; } $im = image_gd_open($source, $info['extension']); if (!$im) { - return false; + return FALSE; } $res = imageCreateTrueColor($width, $height); @@ -237,17 +237,17 @@ function image_gd_resize($source, $destination, $width, $height) { */ function image_gd_rotate($source, $destination, $degrees, $bg_color = 0) { if (!function_exists('imageRotate')) { - return false; + return FALSE; } $info = image_get_info($source); if (!$info) { - return false; + return FALSE; } $im = image_gd_open($source, $info['extension']); if (!$im) { - return false; + return FALSE; } $res = imageRotate($im, $degrees, $bg_color); @@ -262,7 +262,7 @@ function image_gd_rotate($source, $destination, $degrees, $bg_color = 0) { function image_gd_crop($source, $destination, $x, $y, $width, $height) { $info = image_get_info($source); if (!$info) { - return false; + return FALSE; } $im = image_gd_open($source, $info['extension']); @@ -283,7 +283,7 @@ function image_gd_open($file, $extension) { $extension = str_replace('jpg', 'jpeg', $extension); $open_func = 'imageCreateFrom'. $extension; if (!function_exists($open_func)) { - return false; + return FALSE; } return $open_func($file); } @@ -295,7 +295,7 @@ function image_gd_close($res, $destination, $extension) { $extension = str_replace('jpg', 'jpeg', $extension); $close_func = 'image'. $extension; if (!function_exists($close_func)) { - return false; + return FALSE; } return $close_func($res, $destination); } diff --git a/includes/locale.inc b/includes/locale.inc index 0894988bd442bd740239ba5447ab4c56f033c62c..48b9df2fb8caf767bfad62fbca3ba2ddc46e77e8 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -530,7 +530,7 @@ function _locale_import_read_po($file, $mode, $lang) { } $line = trim(substr($line, 12)); $quoted = _locale_import_parse_quoted($line); - if ($quoted === false) { + if ($quoted === FALSE) { drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } @@ -548,7 +548,7 @@ function _locale_import_read_po($file, $mode, $lang) { } $line = trim(substr($line, 5)); $quoted = _locale_import_parse_quoted($line); - if ($quoted === false) { + if ($quoted === FALSE) { drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } @@ -560,7 +560,7 @@ function _locale_import_read_po($file, $mode, $lang) { drupal_set_message(t('The translation file %filename contains an error: "msgstr[]" is unexpected on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } - if (strpos($line, "]") === false) { + if (strpos($line, "]") === FALSE) { drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } @@ -568,7 +568,7 @@ function _locale_import_read_po($file, $mode, $lang) { $plural = substr($frombracket, 1, strpos($frombracket, "]") - 1); $line = trim(strstr($line, " ")); $quoted = _locale_import_parse_quoted($line); - if ($quoted === false) { + if ($quoted === FALSE) { drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } @@ -582,7 +582,7 @@ function _locale_import_read_po($file, $mode, $lang) { } $line = trim(substr($line, 6)); $quoted = _locale_import_parse_quoted($line); - if ($quoted === false) { + if ($quoted === FALSE) { drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } @@ -591,7 +591,7 @@ function _locale_import_read_po($file, $mode, $lang) { } elseif ($line != "") { $quoted = _locale_import_parse_quoted($line); - if ($quoted === false) { + if ($quoted === FALSE) { drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } @@ -861,7 +861,7 @@ function _locale_import_parse_arithmetic($string) { $opstk[] = $ctok; // Parentheses are not needed } else { - return false; + return FALSE; } } diff --git a/includes/menu.inc b/includes/menu.inc index c32ca0bc7cc43b6c3e3dfc6cfbbbab643875dcfd..f9363fefc9619ee5edfdbaadaddffa784551bb8e 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -551,7 +551,7 @@ function menu_get_active_breadcrumb() { } /** - * Returns true when the menu item is in the active trail. + * Returns TRUE when the menu item is in the active trail. */ function menu_in_active_trail($mid) { $trail = _menu_get_active_trail(); @@ -560,7 +560,7 @@ function menu_in_active_trail($mid) { } /** - * Returns true when the menu item is in the active trail within a + * Returns TRUE when the menu item is in the active trail within a * specific subsection of the menu tree. * * @param $mid diff --git a/includes/pager.inc b/includes/pager.inc index 9f36f2ab887e30e298261be0c75c88f04cb5c6bf..040e955acf2387a9f1514c582209be3832519e59 100644 --- a/includes/pager.inc +++ b/includes/pager.inc @@ -383,7 +383,7 @@ function theme_pager_link($text, $page_new, $element, $parameters = array(), $at // Set each pager link title if (!isset($attributes['title'])) { - static $titles = null; + static $titles = NULL; if (!isset($titles)) { $titles = array( t('« first') => t('Go to first page'), diff --git a/includes/theme.inc b/includes/theme.inc index 53bd126bf156cd53c0c89fb65db415db49183098..715a42786f11465f38f7108e9bc331f5327cef68 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -173,7 +173,7 @@ function theme() { * @param $function * The name of the theme function to test. * @return - * The name of the theme function that should be used, or false if no function exists. + * The name of the theme function that should be used, or FALSE if no function exists. */ function theme_get_function($function) { global $theme, $theme_engine; @@ -196,7 +196,7 @@ function theme_get_function($function) { // call Drupal function return 'theme_'. $function; } - return false; + return FALSE; } /** @@ -530,7 +530,7 @@ function theme_links($links, $delimiter = ' | ') { * @param $attributes * Associative array of attributes to be placed in the img tag. * @param $getsize - * If set to true, the image's dimension are fetched and added as width/height attributes. + * If set to TRUE, the image's dimension are fetched and added as width/height attributes. * @return * A string containing the image tag. */ diff --git a/includes/unicode.inc b/includes/unicode.inc index 6714437b221ffdde93e1efff7290c2498178bdd9..26b9c212e862950cf1eed33040c0c01cd26fdf99 100644 --- a/includes/unicode.inc +++ b/includes/unicode.inc @@ -23,7 +23,7 @@ function unicode_check() { * @param $errors * Whether to report any fatal errors with form_set_error(). */ -function _unicode_check($errors = false) { +function _unicode_check($errors = FALSE) { // Set the standard C locale to ensure consistent, ASCII-only string handling. setlocale(LC_CTYPE, 'C'); @@ -77,7 +77,7 @@ function _unicode_check($errors = false) { * Return the required Unicode status and errors for admin/settings. */ function unicode_settings() { - $status = _unicode_check(true); + $status = _unicode_check(TRUE); $options = array(UNICODE_SINGLEBYTE => t('Standard PHP: operations on Unicode strings are emulated on a best-effort basis. Install the PHP mbstring extension for improved Unicode support.', array('%url' => 'http://www.php.net/mbstring')), UNICODE_MULTIBYTE => t('Multi-byte: operations on Unicode strings are supported through the PHP mbstring extension.', array('%url' => 'http://www.php.net/mbstring')), UNICODE_ERROR => t('Invalid: the current configuration is incompatible with Drupal.')); @@ -106,11 +106,11 @@ function unicode_settings() { function drupal_xml_parser_create(&$data) { // Default XML encoding is UTF-8 $encoding = 'utf-8'; - $bom = false; + $bom = FALSE; // Check for UTF-8 byte order mark (PHP5's XML parser doesn't handle it). if (!strncmp($data, "\xEF\xBB\xBF", 3)) { - $bom = true; + $bom = TRUE; $data = substr($data, 3); } @@ -123,7 +123,7 @@ function drupal_xml_parser_create(&$data) { $php_supported = array('utf-8', 'iso-8859-1', 'us-ascii'); if (!in_array(strtolower($encoding), $php_supported)) { $out = drupal_convert_to_utf8($data, $encoding); - if ($out !== false) { + if ($out !== FALSE) { $encoding = 'utf-8'; $data = ereg_replace('^(<\?xml[^>]+encoding)="([^"]+)"', '\\1="utf-8"', $out); } diff --git a/includes/xmlrpcs.inc b/includes/xmlrpcs.inc index 8fe46ce4e696d82c316a8a32af06489256adaf24..96f9a46d80dea852273ebde3922e3ba3428ae80e 100644 --- a/includes/xmlrpcs.inc +++ b/includes/xmlrpcs.inc @@ -97,7 +97,7 @@ function xmlrpc_server($callbacks) { * @param $message * description of error, used only if integer error code was passed */ -function xmlrpc_server_error($error, $message = false) { +function xmlrpc_server_error($error, $message = FALSE) { if ($message && !is_object($error)) { $error = xmlrpc_error($error, $message); } @@ -156,7 +156,7 @@ function xmlrpc_server_call($xmlrpc_server, $methodname, $args) { // If the method has a signature, validate the request against the signature if (is_array($signature)) { - $ok = true; + $ok = TRUE; $return_type = array_shift($signature); // Check the number of arguments if (count($args) != count($signature)) { @@ -169,30 +169,30 @@ function xmlrpc_server_call($xmlrpc_server, $methodname, $args) { case 'int': case 'i4': if (is_array($arg) || !is_int($arg)) { - $ok = false; + $ok = FALSE; } break; case 'base64': case 'string': if (!is_string($arg)) { - $ok = false; + $ok = FALSE; } break; case 'boolean': - if ($arg !== false && $arg !== true) { - $ok = false; + if ($arg !== FALSE && $arg !== TRUE) { + $ok = FALSE; } break; case 'float': case 'double': if (!is_float($arg)) { - $ok = false; + $ok = FALSE; } break; case 'date': case 'dateTime.iso8601': if (!$arg->is_date) { - $ok = false; + $ok = FALSE; } break; } @@ -219,10 +219,10 @@ function xmlrpc_server_multicall($methodcalls) { $return = array(); $xmlrpc_server = xmlrpc_server_get(); foreach ($methodcalls as $call) { - $ok = true; + $ok = TRUE; if (!isset($call['methodName']) || !isset($call['params'])) { $result = xmlrpc_error(3, t('Invalid syntax for system.multicall.')); - $ok = false; + $ok = FALSE; } $method = $call['methodName']; $params = $call['params']; diff --git a/modules/aggregator.module b/modules/aggregator.module index 74e1386619f01849c3512fa0b1ad1c3affa7ce27..142c1c13597aa5c1c9f1341634e719a2279cec5a 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -1069,11 +1069,11 @@ function _aggregator_page_list($sql, $op, $header = '') { $selected[] = $category->cid; } } - $done = true; + $done = TRUE; $form['categories'][$item->iid] = array( '#type' => variable_get('aggregator_category_selector', 'checkboxes'), '#default_value' => $selected, '#options' => $categories, - '#size' => 10, '#multiple' => true + '#size' => 10, '#multiple' => TRUE ); } } diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 74e1386619f01849c3512fa0b1ad1c3affa7ce27..142c1c13597aa5c1c9f1341634e719a2279cec5a 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -1069,11 +1069,11 @@ function _aggregator_page_list($sql, $op, $header = '') { $selected[] = $category->cid; } } - $done = true; + $done = TRUE; $form['categories'][$item->iid] = array( '#type' => variable_get('aggregator_category_selector', 'checkboxes'), '#default_value' => $selected, '#options' => $categories, - '#size' => 10, '#multiple' => true + '#size' => 10, '#multiple' => TRUE ); } } diff --git a/modules/blogapi.module b/modules/blogapi.module index 3818248582d8626106e653f5de32658d077aafab..ab8b648c17a3094b52970b2200aa4388c3a2694e 100644 --- a/modules/blogapi.module +++ b/modules/blogapi.module @@ -151,7 +151,7 @@ function blogapi_blogger_get_users_blogs($appid, $username, $password) { $types = _blogapi_get_node_types(); $structs = array(); foreach ($types as $type) { - $structs[] = array('url' => url('blog/' . $user->uid, NULL, NULL, true), 'blogid' => $type, 'blogName' => $user->name . ": " . $type); + $structs[] = array('url' => url('blog/' . $user->uid, NULL, NULL, TRUE), 'blogid' => $type, 'blogName' => $user->name . ": " . $type); } return $structs; } @@ -174,7 +174,7 @@ function blogapi_blogger_get_user_info($appkey, $username, $password) { 'firstname' => $name[0], 'nickname' => $user->name, 'email' => $user->mail, - 'url' => url('blog/' . $user->uid, NULL, NULL, true)); + 'url' => url('blog/' . $user->uid, NULL, NULL, TRUE)); } else { return blogapi_error($user); @@ -285,7 +285,7 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont node_save($node); if ($node->nid) { watchdog('content', t('%type: updated %title using blog API.', array('%type' => ''. t($node->type) .'', '%title' => theme('placeholder', $node->title))), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid")); - return true; + return TRUE; } return blogapi_error(t('Error storing post.')); @@ -302,7 +302,7 @@ function blogapi_blogger_get_post($appkey, $postid, $username, $password) { $node = node_load($postid); - return _blogapi_get_post($node, true); + return _blogapi_get_post($node, TRUE); } /** @@ -315,7 +315,7 @@ function blogapi_blogger_delete_post($appkey, $postid, $username, $password, $pu } node_delete($postid); - return true; + return TRUE; } /** @@ -433,7 +433,7 @@ function blogapi_mt_get_post_categories($postid, $username, $password) { foreach (module_invoke('taxonomy', 'get_parents', $term->tid, 'tid') as $parent) { $term_name = $parent->name . '/' . $term_name; } - $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid, 'isPrimary' => true); + $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid, 'isPrimary' => TRUE); } return $categories; } @@ -502,7 +502,7 @@ function blogap_mti_publish_post($postid, $username, $password) { node_save($node); - return true; + return TRUE; } /** @@ -630,7 +630,7 @@ function blogapi_rsd() { */ function _blogapi_mt_extra(&$node, $struct) { if (is_array($node)) { - $was_array = true; + $was_array = TRUE; $node = (object)$node; } @@ -687,14 +687,14 @@ function _blogapi_mt_extra(&$node, $struct) { } } -function _blogapi_get_post($node, $bodies = true) { +function _blogapi_get_post($node, $bodies = TRUE) { $xmlrpcval = array ( 'userid' => $node->name, 'dateCreated' => xmlrpc_date($node->created), 'title' => $node->title, 'postid' => $node->nid, - 'link' => url('node/'.$node->nid, NULL, NULL, true), - 'permaLink' => url('node/'.$node->nid, NULL, NULL, true), + 'link' => url('node/'.$node->nid, NULL, NULL, TRUE), + 'permaLink' => url('node/'.$node->nid, NULL, NULL, TRUE), ); if ($bodies) { if ($node->comment = 1) { diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module index 3818248582d8626106e653f5de32658d077aafab..ab8b648c17a3094b52970b2200aa4388c3a2694e 100644 --- a/modules/blogapi/blogapi.module +++ b/modules/blogapi/blogapi.module @@ -151,7 +151,7 @@ function blogapi_blogger_get_users_blogs($appid, $username, $password) { $types = _blogapi_get_node_types(); $structs = array(); foreach ($types as $type) { - $structs[] = array('url' => url('blog/' . $user->uid, NULL, NULL, true), 'blogid' => $type, 'blogName' => $user->name . ": " . $type); + $structs[] = array('url' => url('blog/' . $user->uid, NULL, NULL, TRUE), 'blogid' => $type, 'blogName' => $user->name . ": " . $type); } return $structs; } @@ -174,7 +174,7 @@ function blogapi_blogger_get_user_info($appkey, $username, $password) { 'firstname' => $name[0], 'nickname' => $user->name, 'email' => $user->mail, - 'url' => url('blog/' . $user->uid, NULL, NULL, true)); + 'url' => url('blog/' . $user->uid, NULL, NULL, TRUE)); } else { return blogapi_error($user); @@ -285,7 +285,7 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont node_save($node); if ($node->nid) { watchdog('content', t('%type: updated %title using blog API.', array('%type' => ''. t($node->type) .'', '%title' => theme('placeholder', $node->title))), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid")); - return true; + return TRUE; } return blogapi_error(t('Error storing post.')); @@ -302,7 +302,7 @@ function blogapi_blogger_get_post($appkey, $postid, $username, $password) { $node = node_load($postid); - return _blogapi_get_post($node, true); + return _blogapi_get_post($node, TRUE); } /** @@ -315,7 +315,7 @@ function blogapi_blogger_delete_post($appkey, $postid, $username, $password, $pu } node_delete($postid); - return true; + return TRUE; } /** @@ -433,7 +433,7 @@ function blogapi_mt_get_post_categories($postid, $username, $password) { foreach (module_invoke('taxonomy', 'get_parents', $term->tid, 'tid') as $parent) { $term_name = $parent->name . '/' . $term_name; } - $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid, 'isPrimary' => true); + $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid, 'isPrimary' => TRUE); } return $categories; } @@ -502,7 +502,7 @@ function blogap_mti_publish_post($postid, $username, $password) { node_save($node); - return true; + return TRUE; } /** @@ -630,7 +630,7 @@ function blogapi_rsd() { */ function _blogapi_mt_extra(&$node, $struct) { if (is_array($node)) { - $was_array = true; + $was_array = TRUE; $node = (object)$node; } @@ -687,14 +687,14 @@ function _blogapi_mt_extra(&$node, $struct) { } } -function _blogapi_get_post($node, $bodies = true) { +function _blogapi_get_post($node, $bodies = TRUE) { $xmlrpcval = array ( 'userid' => $node->name, 'dateCreated' => xmlrpc_date($node->created), 'title' => $node->title, 'postid' => $node->nid, - 'link' => url('node/'.$node->nid, NULL, NULL, true), - 'permaLink' => url('node/'.$node->nid, NULL, NULL, true), + 'link' => url('node/'.$node->nid, NULL, NULL, TRUE), + 'permaLink' => url('node/'.$node->nid, NULL, NULL, TRUE), ); if ($bodies) { if ($node->comment = 1) { diff --git a/modules/book.module b/modules/book.module index c7f18d8727c4d0c2503fda58c951f22454abe36a..43d71edcafb457186c64fba767f7548c4a34f377 100644 --- a/modules/book.module +++ b/modules/book.module @@ -427,7 +427,7 @@ function book_next($node) { } /** - * Returns the content of a given node. If $teaser if true, returns + * Returns the content of a given node. If $teaser if TRUE, returns * the teaser rather than full content. Displays the most recently * approved revision of a node (if any) unless we have to display this * page in the context of the moderation queue. @@ -802,7 +802,7 @@ function book_node_visitor_html_pre($node, $depth, $nid) { $node = node_invoke($node, 'content'); } // Allow modules to change $node->body before viewing. - node_invoke_nodeapi($node, 'print', $node->body, false); + node_invoke_nodeapi($node, 'print', $node->body, FALSE); $output .= "
nid ."\" class=\"section-$depth\">\n"; $output .= "

". check_plain($node->title) ."

\n"; diff --git a/modules/book/book.module b/modules/book/book.module index c7f18d8727c4d0c2503fda58c951f22454abe36a..43d71edcafb457186c64fba767f7548c4a34f377 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -427,7 +427,7 @@ function book_next($node) { } /** - * Returns the content of a given node. If $teaser if true, returns + * Returns the content of a given node. If $teaser if TRUE, returns * the teaser rather than full content. Displays the most recently * approved revision of a node (if any) unless we have to display this * page in the context of the moderation queue. @@ -802,7 +802,7 @@ function book_node_visitor_html_pre($node, $depth, $nid) { $node = node_invoke($node, 'content'); } // Allow modules to change $node->body before viewing. - node_invoke_nodeapi($node, 'print', $node->body, false); + node_invoke_nodeapi($node, 'print', $node->body, FALSE); $output .= "
nid ."\" class=\"section-$depth\">\n"; $output .= "

". check_plain($node->title) ."

\n"; diff --git a/modules/filter.module b/modules/filter.module index e3c65344c3f5a3e7b9b62d9dc953a94e86cf0989..9f3f15db896bac3464c7f961a733baa63b2322a7 100644 --- a/modules/filter.module +++ b/modules/filter.module @@ -146,7 +146,7 @@ function filter_perm() { /** * Implementation of hook_filter_tips(). */ -function filter_filter_tips($delta, $format, $long = false) { +function filter_filter_tips($delta, $format, $long = FALSE) { global $base_url; switch ($delta) { case 0: @@ -294,7 +294,7 @@ function filter_admin_overview() { // Overview of all formats. $formats = filter_formats(); - $error = false; + $error = FALSE; $rows = array(); foreach ($formats as $id => $format) { @@ -383,7 +383,7 @@ function filter_admin_delete_submit($form_id, $form_values) { db_query("UPDATE {comments} SET format = %d WHERE format = %d", $default, $form_values['format']); db_query("UPDATE {boxes} SET format = %d WHERE format = %d", $default, $form_values['format']); - cache_clear_all('filter:'. $form_values['format'], true); + cache_clear_all('filter:'. $form_values['format'], TRUE); drupal_set_message(t('Deleted input format %format.', array('%format' => theme('placeholder', $form_values['name'])))); return 'admin/filters'; @@ -445,9 +445,9 @@ function filter_admin_format_form($format = NULL) { $form['format'] = array('#type' => 'hidden', '#value' => $format->format); // Composition tips (guidelines) - $tips = _filter_tips($format->format, false); + $tips = _filter_tips($format->format, FALSE); $extra = l(t('More information about formatting options'), 'filter/tips'); - $tiplist = theme('filter_tips', $tips, false, $extra); + $tiplist = theme('filter_tips', $tips, FALSE, $extra); if (!$tiplist) { $tiplist = t('

No guidelines available.

'); } @@ -508,7 +508,7 @@ function filter_admin_format_form_submit($form_id, $form_values) { } // We store the roles as a string for ease of use. - // We should always set all roles to true when saving a default role. + // We should always set all roles to TRUE when saving a default role. // We use leading and trailing comma's to allow easy substring matching. $roles = array(); if (isset($form_values['roles'])) { @@ -522,7 +522,7 @@ function filter_admin_format_form_submit($form_id, $form_values) { db_query("UPDATE {filter_formats} SET cache = %d, name='%s', roles = '%s' WHERE format = %d", $cache, $name, $roles, $format); - cache_clear_all('filter:'. $format, true); + cache_clear_all('filter:'. $format, TRUE); // If a new filter was added, return to the main list of filters. Otherwise, stay on edit filter page to show new changes. if ($new) { @@ -580,7 +580,7 @@ function filter_admin_order_submit($form_id, $form_values) { } drupal_set_message(t('The filter ordering has been saved.')); - cache_clear_all('filter:'. $form_values['format'], true); + cache_clear_all('filter:'. $form_values['format'], TRUE); } /** @@ -739,7 +739,7 @@ function filter_list_format($format) { * set to TRUE so the user's permissions are checked. */ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) { - // When $check = true, do an access check on $format. + // When $check = TRUE, do an access check on $format. if (isset($text) && (!$check || filter_access($format))) { $format = filter_resolve_format($format); @@ -816,7 +816,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents = '#default_value' => $value, '#return_value' => $format->format, '#parents' => $parents, - '#description' => theme('filter_tips', _filter_tips($format->format, false)), + '#description' => theme('filter_tips', _filter_tips($format->format, FALSE)), ); } } @@ -824,10 +824,10 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents = // Only one format available: use a hidden form item and only show tips. $format = array_shift($formats); $form[$format->format] = array('#type' => 'value', '#value' => $format->format, '#parents' => $parents); - $tips = _filter_tips(variable_get('filter_default_format', 1), false); + $tips = _filter_tips(variable_get('filter_default_format', 1), FALSE); $form['format']['guidelines'] = array( '#title' => t('Formatting guidelines'), - '#value' => theme('filter_tips', $tips, false, $extra), + '#value' => theme('filter_tips', $tips, FALSE, $extra), ); } $form[] = array( @@ -848,12 +848,12 @@ function filter_form_validate($form) { } /** - * Returns true if the user is allowed to access this format. + * Returns TRUE if the user is allowed to access this format. */ function filter_access($format) { $format = filter_resolve_format($format); if (user_access('administer filters') || ($format == variable_get('filter_default_format', 1))) { - return true; + return TRUE; } else { $formats = filter_formats(); @@ -870,10 +870,10 @@ function filter_access($format) { function filter_tips_long() { $format = arg(2); if ($format) { - $output = theme('filter_tips', _filter_tips($format, true), true); + $output = theme('filter_tips', _filter_tips($format, TRUE), TRUE); } else { - $output = theme('filter_tips', _filter_tips(-1, true), true); + $output = theme('filter_tips', _filter_tips(-1, TRUE), TRUE); } return $output; } @@ -881,7 +881,7 @@ function filter_tips_long() { /** * Helper function for fetching filter tips. */ -function _filter_tips($format, $long = false) { +function _filter_tips($format, $long = FALSE) { if ($format == -1) { $formats = filter_formats(); } @@ -910,7 +910,7 @@ function _filter_tips($format, $long = false) { * * @ingroup themeable */ -function theme_filter_tips($tips, $long = false, $extra = '') { +function theme_filter_tips($tips, $long = FALSE, $extra = '') { $output = ''; $multiple = count($tips) > 1; @@ -1057,7 +1057,7 @@ function _filter_autop($text) { $chunks = preg_split('@(]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE); // Note: PHP ensures the array consists of alternating delimiters and literals // and begins and ends with a literal (inserting NULL as required). - $ignore = false; + $ignore = FALSE; $ignoretag = ''; $output = ''; foreach ($chunks as $i => $chunk) { @@ -1067,13 +1067,13 @@ function _filter_autop($text) { list($tag) = split('[ >]', substr($chunk, 2 - $open), 2); if (!$ignore) { if ($open) { - $ignore = true; + $ignore = TRUE; $ignoretag = $tag; } } // Only allow a matching tag to close it. else if (!$open && $ignoretag == $tag) { - $ignore = false; + $ignore = FALSE; $ignoretag = ''; } } diff --git a/modules/filter/filter.module b/modules/filter/filter.module index e3c65344c3f5a3e7b9b62d9dc953a94e86cf0989..9f3f15db896bac3464c7f961a733baa63b2322a7 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -146,7 +146,7 @@ function filter_perm() { /** * Implementation of hook_filter_tips(). */ -function filter_filter_tips($delta, $format, $long = false) { +function filter_filter_tips($delta, $format, $long = FALSE) { global $base_url; switch ($delta) { case 0: @@ -294,7 +294,7 @@ function filter_admin_overview() { // Overview of all formats. $formats = filter_formats(); - $error = false; + $error = FALSE; $rows = array(); foreach ($formats as $id => $format) { @@ -383,7 +383,7 @@ function filter_admin_delete_submit($form_id, $form_values) { db_query("UPDATE {comments} SET format = %d WHERE format = %d", $default, $form_values['format']); db_query("UPDATE {boxes} SET format = %d WHERE format = %d", $default, $form_values['format']); - cache_clear_all('filter:'. $form_values['format'], true); + cache_clear_all('filter:'. $form_values['format'], TRUE); drupal_set_message(t('Deleted input format %format.', array('%format' => theme('placeholder', $form_values['name'])))); return 'admin/filters'; @@ -445,9 +445,9 @@ function filter_admin_format_form($format = NULL) { $form['format'] = array('#type' => 'hidden', '#value' => $format->format); // Composition tips (guidelines) - $tips = _filter_tips($format->format, false); + $tips = _filter_tips($format->format, FALSE); $extra = l(t('More information about formatting options'), 'filter/tips'); - $tiplist = theme('filter_tips', $tips, false, $extra); + $tiplist = theme('filter_tips', $tips, FALSE, $extra); if (!$tiplist) { $tiplist = t('

No guidelines available.

'); } @@ -508,7 +508,7 @@ function filter_admin_format_form_submit($form_id, $form_values) { } // We store the roles as a string for ease of use. - // We should always set all roles to true when saving a default role. + // We should always set all roles to TRUE when saving a default role. // We use leading and trailing comma's to allow easy substring matching. $roles = array(); if (isset($form_values['roles'])) { @@ -522,7 +522,7 @@ function filter_admin_format_form_submit($form_id, $form_values) { db_query("UPDATE {filter_formats} SET cache = %d, name='%s', roles = '%s' WHERE format = %d", $cache, $name, $roles, $format); - cache_clear_all('filter:'. $format, true); + cache_clear_all('filter:'. $format, TRUE); // If a new filter was added, return to the main list of filters. Otherwise, stay on edit filter page to show new changes. if ($new) { @@ -580,7 +580,7 @@ function filter_admin_order_submit($form_id, $form_values) { } drupal_set_message(t('The filter ordering has been saved.')); - cache_clear_all('filter:'. $form_values['format'], true); + cache_clear_all('filter:'. $form_values['format'], TRUE); } /** @@ -739,7 +739,7 @@ function filter_list_format($format) { * set to TRUE so the user's permissions are checked. */ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) { - // When $check = true, do an access check on $format. + // When $check = TRUE, do an access check on $format. if (isset($text) && (!$check || filter_access($format))) { $format = filter_resolve_format($format); @@ -816,7 +816,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents = '#default_value' => $value, '#return_value' => $format->format, '#parents' => $parents, - '#description' => theme('filter_tips', _filter_tips($format->format, false)), + '#description' => theme('filter_tips', _filter_tips($format->format, FALSE)), ); } } @@ -824,10 +824,10 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents = // Only one format available: use a hidden form item and only show tips. $format = array_shift($formats); $form[$format->format] = array('#type' => 'value', '#value' => $format->format, '#parents' => $parents); - $tips = _filter_tips(variable_get('filter_default_format', 1), false); + $tips = _filter_tips(variable_get('filter_default_format', 1), FALSE); $form['format']['guidelines'] = array( '#title' => t('Formatting guidelines'), - '#value' => theme('filter_tips', $tips, false, $extra), + '#value' => theme('filter_tips', $tips, FALSE, $extra), ); } $form[] = array( @@ -848,12 +848,12 @@ function filter_form_validate($form) { } /** - * Returns true if the user is allowed to access this format. + * Returns TRUE if the user is allowed to access this format. */ function filter_access($format) { $format = filter_resolve_format($format); if (user_access('administer filters') || ($format == variable_get('filter_default_format', 1))) { - return true; + return TRUE; } else { $formats = filter_formats(); @@ -870,10 +870,10 @@ function filter_access($format) { function filter_tips_long() { $format = arg(2); if ($format) { - $output = theme('filter_tips', _filter_tips($format, true), true); + $output = theme('filter_tips', _filter_tips($format, TRUE), TRUE); } else { - $output = theme('filter_tips', _filter_tips(-1, true), true); + $output = theme('filter_tips', _filter_tips(-1, TRUE), TRUE); } return $output; } @@ -881,7 +881,7 @@ function filter_tips_long() { /** * Helper function for fetching filter tips. */ -function _filter_tips($format, $long = false) { +function _filter_tips($format, $long = FALSE) { if ($format == -1) { $formats = filter_formats(); } @@ -910,7 +910,7 @@ function _filter_tips($format, $long = false) { * * @ingroup themeable */ -function theme_filter_tips($tips, $long = false, $extra = '') { +function theme_filter_tips($tips, $long = FALSE, $extra = '') { $output = ''; $multiple = count($tips) > 1; @@ -1057,7 +1057,7 @@ function _filter_autop($text) { $chunks = preg_split('@(]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE); // Note: PHP ensures the array consists of alternating delimiters and literals // and begins and ends with a literal (inserting NULL as required). - $ignore = false; + $ignore = FALSE; $ignoretag = ''; $output = ''; foreach ($chunks as $i => $chunk) { @@ -1067,13 +1067,13 @@ function _filter_autop($text) { list($tag) = split('[ >]', substr($chunk, 2 - $open), 2); if (!$ignore) { if ($open) { - $ignore = true; + $ignore = TRUE; $ignoretag = $tag; } } // Only allow a matching tag to close it. else if (!$open && $ignoretag == $tag) { - $ignore = false; + $ignore = FALSE; $ignoretag = ''; } } diff --git a/modules/forum.module b/modules/forum.module index 4ba752d73440c8e0b1c40b9083bb04124a7b035d..07eba7922316fac78d67c045afd5cc3b9ed902dc 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -520,7 +520,7 @@ function forum_form_submit($form_id, $form_values) { $type = t('forum container'); } else { - $container = false; + $container = FALSE; $type = t('forum'); } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 4ba752d73440c8e0b1c40b9083bb04124a7b035d..07eba7922316fac78d67c045afd5cc3b9ed902dc 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -520,7 +520,7 @@ function forum_form_submit($form_id, $form_values) { $type = t('forum container'); } else { - $container = false; + $container = FALSE; $type = t('forum'); } diff --git a/modules/node.module b/modules/node.module index 129659abd7db6181f6c3f60d349bdaf52dab1804..93b51985eed2046034578d0f1e38c6278d2f82f0 100644 --- a/modules/node.module +++ b/modules/node.module @@ -401,12 +401,12 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) { function node_save(&$node) { global $user; - $node->is_new = false; + $node->is_new = FALSE; // Apply filters to some default node fields: if (empty($node->nid)) { // Insert a new node. - $node->is_new = true; + $node->is_new = TRUE; $node->nid = db_next_id('{node}_nid'); $node->vid = db_next_id('{node_revisions}_vid');; @@ -593,7 +593,7 @@ function node_perm() { /** * Implementation of hook_search(). */ -function node_search($op = 'search', $keys = null) { +function node_search($op = 'search', $keys = NULL) { switch ($op) { case 'name': return t('content'); @@ -666,7 +666,7 @@ function node_search($op = 'search', $keys = null) { $arguments2 = array(); $join2 = ''; // Used to avoid joining on node_comment_statistics twice - $stats_join = false; + $stats_join = FALSE; if ($weight = (int)variable_get('node_rank_relevance', 5)) { // Average relevance values hover around 0.15 $ranking[] = '%d * i.relevance'; @@ -678,7 +678,7 @@ function node_search($op = 'search', $keys = null) { $arguments2[] = $weight; $arguments2[] = (int)variable_get('node_cron_last', 0); $join2 .= ' INNER JOIN {node} n ON n.nid = i.sid LEFT JOIN {node_comment_statistics} c ON c.nid = i.sid'; - $stats_join = true; + $stats_join = TRUE; } if (module_exist('comment') && $weight = (int)variable_get('node_rank_comments', 5)) { // Inverse law that maps the highest reply count on the site to 1 and 0 to 0. @@ -711,13 +711,13 @@ function node_search($op = 'search', $keys = null) { // Get node output (filtered and with module-specific fields). if (node_hook($node, 'view')) { - node_invoke($node, 'view', false, false); + node_invoke($node, 'view', FALSE, FALSE); } else { - $node = node_prepare($node, false); + $node = node_prepare($node, FALSE); } // Allow modules to change $node->body before viewing. - node_invoke_nodeapi($node, 'view', false, false); + node_invoke_nodeapi($node, 'view', FALSE, FALSE); // Fetch comments for snippet $node->body .= module_invoke('comment', 'nodeapi', $node, 'update index'); @@ -1203,7 +1203,7 @@ function node_multiple_delete_confirm() { $edit = $_POST['edit']; $form['nodes'] = array('#prefix' => '', '#tree' => TRUE); - // array_filter returns only elements with true values + // array_filter returns only elements with TRUE values foreach (array_filter($edit['nodes']) as $nid => $value) { $title = db_result(db_query('SELECT title FROM {node} WHERE nid = %d', $nid)); $form['nodes'][$nid] = array('#type' => 'hidden', '#value' => $nid, '#prefix' => '
  • ', '#suffix' => check_plain($title) ."
  • \n"); @@ -1457,7 +1457,7 @@ function node_feed($nodes = 0, $channel = array()) { // Allow modules to add additional item fields $extra = node_invoke_nodeapi($item, 'rss item'); - $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false')))); + $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'FALSE')))); foreach ($extra as $element) { if ($element['namespace']) { $namespaces = array_merge($namespaces, $element['namespace']); @@ -2113,13 +2113,13 @@ function node_update_index() { // Get node output (filtered and with module-specific fields). if (node_hook($node, 'view')) { - node_invoke($node, 'view', false, false); + node_invoke($node, 'view', FALSE, FALSE); } else { - $node = node_prepare($node, false); + $node = node_prepare($node, FALSE); } // Allow modules to change $node->body before viewing. - node_invoke_nodeapi($node, 'view', false, false); + node_invoke_nodeapi($node, 'view', FALSE, FALSE); $text = '

    '. check_plain($node->title) .'

    '. $node->body; diff --git a/modules/node/node.module b/modules/node/node.module index 129659abd7db6181f6c3f60d349bdaf52dab1804..93b51985eed2046034578d0f1e38c6278d2f82f0 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -401,12 +401,12 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) { function node_save(&$node) { global $user; - $node->is_new = false; + $node->is_new = FALSE; // Apply filters to some default node fields: if (empty($node->nid)) { // Insert a new node. - $node->is_new = true; + $node->is_new = TRUE; $node->nid = db_next_id('{node}_nid'); $node->vid = db_next_id('{node_revisions}_vid');; @@ -593,7 +593,7 @@ function node_perm() { /** * Implementation of hook_search(). */ -function node_search($op = 'search', $keys = null) { +function node_search($op = 'search', $keys = NULL) { switch ($op) { case 'name': return t('content'); @@ -666,7 +666,7 @@ function node_search($op = 'search', $keys = null) { $arguments2 = array(); $join2 = ''; // Used to avoid joining on node_comment_statistics twice - $stats_join = false; + $stats_join = FALSE; if ($weight = (int)variable_get('node_rank_relevance', 5)) { // Average relevance values hover around 0.15 $ranking[] = '%d * i.relevance'; @@ -678,7 +678,7 @@ function node_search($op = 'search', $keys = null) { $arguments2[] = $weight; $arguments2[] = (int)variable_get('node_cron_last', 0); $join2 .= ' INNER JOIN {node} n ON n.nid = i.sid LEFT JOIN {node_comment_statistics} c ON c.nid = i.sid'; - $stats_join = true; + $stats_join = TRUE; } if (module_exist('comment') && $weight = (int)variable_get('node_rank_comments', 5)) { // Inverse law that maps the highest reply count on the site to 1 and 0 to 0. @@ -711,13 +711,13 @@ function node_search($op = 'search', $keys = null) { // Get node output (filtered and with module-specific fields). if (node_hook($node, 'view')) { - node_invoke($node, 'view', false, false); + node_invoke($node, 'view', FALSE, FALSE); } else { - $node = node_prepare($node, false); + $node = node_prepare($node, FALSE); } // Allow modules to change $node->body before viewing. - node_invoke_nodeapi($node, 'view', false, false); + node_invoke_nodeapi($node, 'view', FALSE, FALSE); // Fetch comments for snippet $node->body .= module_invoke('comment', 'nodeapi', $node, 'update index'); @@ -1203,7 +1203,7 @@ function node_multiple_delete_confirm() { $edit = $_POST['edit']; $form['nodes'] = array('#prefix' => '', '#tree' => TRUE); - // array_filter returns only elements with true values + // array_filter returns only elements with TRUE values foreach (array_filter($edit['nodes']) as $nid => $value) { $title = db_result(db_query('SELECT title FROM {node} WHERE nid = %d', $nid)); $form['nodes'][$nid] = array('#type' => 'hidden', '#value' => $nid, '#prefix' => '
  • ', '#suffix' => check_plain($title) ."
  • \n"); @@ -1457,7 +1457,7 @@ function node_feed($nodes = 0, $channel = array()) { // Allow modules to add additional item fields $extra = node_invoke_nodeapi($item, 'rss item'); - $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false')))); + $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'FALSE')))); foreach ($extra as $element) { if ($element['namespace']) { $namespaces = array_merge($namespaces, $element['namespace']); @@ -2113,13 +2113,13 @@ function node_update_index() { // Get node output (filtered and with module-specific fields). if (node_hook($node, 'view')) { - node_invoke($node, 'view', false, false); + node_invoke($node, 'view', FALSE, FALSE); } else { - $node = node_prepare($node, false); + $node = node_prepare($node, FALSE); } // Allow modules to change $node->body before viewing. - node_invoke_nodeapi($node, 'view', false, false); + node_invoke_nodeapi($node, 'view', FALSE, FALSE); $text = '

    '. check_plain($node->title) .'

    '. $node->body; diff --git a/modules/poll.module b/modules/poll.module index 9247f2ed0864ac293c6655547e15cd346c565cbb..1f2494da33c699aca97f5325e7f28f821f3df995 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -513,7 +513,7 @@ function poll_cancel(&$node) { // Subtract from the votes. db_query("UPDATE {poll_choices} SET chvotes = chvotes - 1 WHERE nid = %d AND chorder = %d", $node->nid, $choice); - $node->allowvotes = true; + $node->allowvotes = TRUE; $node->choice[$choice]['chvotes']--; drupal_set_message(t('Your vote was canceled.')); } diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 9247f2ed0864ac293c6655547e15cd346c565cbb..1f2494da33c699aca97f5325e7f28f821f3df995 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -513,7 +513,7 @@ function poll_cancel(&$node) { // Subtract from the votes. db_query("UPDATE {poll_choices} SET chvotes = chvotes - 1 WHERE nid = %d AND chorder = %d", $node->nid, $choice); - $node->allowvotes = true; + $node->allowvotes = TRUE; $node->choice[$choice]['chvotes']--; drupal_set_message(t('Your vote was canceled.')); } diff --git a/modules/profile.module b/modules/profile.module index 067da9f3f4e16401732f0104c46feef6b3dbd415..4a36e208b927d2badc956818e46a59dc370c093d 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -137,7 +137,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) { if ($fields) { $fields = _profile_update_user_fields($fields, $account); - $output .= theme('profile_block', $account, $fields, true); + $output .= theme('profile_block', $account, $fields, TRUE); } if (isset($use_fields['user_profile']) && $use_fields['user_profile']) { @@ -562,8 +562,8 @@ function profile_view_field($user, $field) { 'm' => sprintf('%02d', $value['month']), 'M' => map_month($value['month']), 'Y' => $value['year'], - 'H:i' => null, - 'g:ia' => null); + 'H:i' => NULL, + 'g:ia' => NULL); return strtr($format, $replace); case 'list': $values = split("[,\n\r]", $value); @@ -749,7 +749,7 @@ function profile_validate_profile($edit, $category) { while ($field = db_fetch_object($result)) { if ($edit[$field->name]) { if ($field->type == 'url') { - if (!valid_url($edit[$field->name], true)) { + if (!valid_url($edit[$field->name], TRUE)) { form_set_error($field->name, t('The value provided for %field is not a valid URL.', array('%field' => theme('placeholder', $field->title)))); } } diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 067da9f3f4e16401732f0104c46feef6b3dbd415..4a36e208b927d2badc956818e46a59dc370c093d 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -137,7 +137,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) { if ($fields) { $fields = _profile_update_user_fields($fields, $account); - $output .= theme('profile_block', $account, $fields, true); + $output .= theme('profile_block', $account, $fields, TRUE); } if (isset($use_fields['user_profile']) && $use_fields['user_profile']) { @@ -562,8 +562,8 @@ function profile_view_field($user, $field) { 'm' => sprintf('%02d', $value['month']), 'M' => map_month($value['month']), 'Y' => $value['year'], - 'H:i' => null, - 'g:ia' => null); + 'H:i' => NULL, + 'g:ia' => NULL); return strtr($format, $replace); case 'list': $values = split("[,\n\r]", $value); @@ -749,7 +749,7 @@ function profile_validate_profile($edit, $category) { while ($field = db_fetch_object($result)) { if ($edit[$field->name]) { if ($field->type == 'url') { - if (!valid_url($edit[$field->name], true)) { + if (!valid_url($edit[$field->name], TRUE)) { form_set_error($field->name, t('The value provided for %field is not a valid URL.', array('%field' => theme('placeholder', $field->title)))); } } diff --git a/modules/search.module b/modules/search.module index 4a81a8fdb50c585dc20848808dc4cf68556fd4e5..b94adfffa6f322b4f0e052e34468b9f7e72c47d1 100644 --- a/modules/search.module +++ b/modules/search.module @@ -187,7 +187,7 @@ function search_settings_form_validate($form_id, &$form) { } // If these settings change, the index needs to be rebuilt. if ((variable_get('minimum_word_size', 3) != $form['minimum_word_size']) || - (variable_get('overlap_cjk', true) != $form['overlap_cjk'])) { + (variable_get('overlap_cjk', TRUE) != $form['overlap_cjk'])) { drupal_set_message(t('The index will be rebuilt.')); search_wipe(); } @@ -223,7 +223,7 @@ function search_settings() { $form['indexing_settings'] = array('#type' => 'fieldset', '#title' => t('Indexing settings')); $form['indexing_settings']['info'] = array('#type' => 'markup', '#value' => ''. t('

    Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.

    The default settings should be appropriate for the majority of sites.

    ') .'
    '); $form['indexing_settings']['minimum_word_size'] = array('#type' => 'textfield', '#title' => t('Minimum word length to index'), '#default_value' => variable_get('minimum_word_size', 3), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).')); - $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', true), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.')); + $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', TRUE), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.')); // Per module settings $form = array_merge($form, module_invoke_all('search', 'admin')); @@ -275,10 +275,10 @@ function search_wipe($sid = NULL, $type = NULL, $reindex = FALSE) { * during indexing (cron). Words which are dirty have outdated total counts in * the search_total table, and need to be recounted. */ -function search_dirty($word = null) { +function search_dirty($word = NULL) { static $dirty = array(); - if ($word !== null) { - $dirty[$word] = true; + if ($word !== NULL) { + $dirty[$word] = TRUE; } else { return $dirty; @@ -341,7 +341,7 @@ function search_simplify($text) { search_preprocess($text); // Simple CJK handling - if (variable_get('overlap_cjk', true)) { + if (variable_get('overlap_cjk', TRUE)) { $text = preg_replace_callback('/['. PREG_CLASS_CJK .']+/u', 'search_expand_cjk', $text); } @@ -397,8 +397,8 @@ function search_expand_cjk($matches) { * Splits a string into tokens for indexing. */ function search_index_split($text) { - static $last = null; - static $lastsplit = null; + static $last = NULL; + static $lastsplit = NULL; if ($last == $text) { return $lastsplit; @@ -477,8 +477,8 @@ function search_index($sid, $type, $text) { // Note: PHP ensures the array consists of alternating delimiters and literals // and begins and ends with a literal (inserting $null as required). - $tag = false; // Odd/even counter. Tag or no tag. - $link = false; // State variable for link analyser + $tag = FALSE; // Odd/even counter. Tag or no tag. + $link = FALSE; // State variable for link analyser $score = 1; // Starting score per word $accum = ' '; // Accumulator for cleaned up data $tagstack = array(); // Stack with open tags @@ -505,7 +505,7 @@ function search_index($sid, $type, $text) { $score = max(1, $score - $tags[array_shift($tagstack)]); } if ($tagname == 'a') { - $link = false; + $link = FALSE; } } else { @@ -530,7 +530,7 @@ function search_index($sid, $type, $text) { // Note: ignore links to uncachable nodes to avoid redirect bugs. $node = db_fetch_object(db_query('SELECT n.title, n.nid, n.vid, r.format FROM {node} n INNER JOIN {node_revisions} r ON n.vid = r.vid WHERE n.nid = %d', $linknid)); if (filter_format_allowcache($node->format)) { - $link = true; + $link = TRUE; $linktitle = $node->title; } } @@ -647,13 +647,13 @@ function search_parse_query($text) { } // Classify tokens - $or = false; + $or = FALSE; foreach ($matches as $match) { - $phrase = false; + $phrase = FALSE; // Strip off phrase quotes if ($match[2]{0} == '"') { $match[2] = substr($match[2], 1, -1); - $phrase = true; + $phrase = TRUE; } // Simplify keyword according to indexing rules and external preprocessors $words = search_simplify($match[2]); @@ -672,7 +672,7 @@ function search_parse_query($text) { $last = array($last); } $keys['positive'][] = $last; - $or = true; + $or = TRUE; continue; } // Plain keyword @@ -685,7 +685,7 @@ function search_parse_query($text) { $keys['positive'] = array_merge($keys['positive'], $words); } } - $or = false; + $or = FALSE; } // Convert keywords into SQL statements. @@ -699,7 +699,7 @@ function search_parse_query($text) { // Group of ORed terms if (is_array($key) && count($key)) { $queryor = array(); - $any = false; + $any = FALSE; foreach ($key as $or) { list($q, $count) = _search_parse_query($or, $arguments2); $any |= $count; @@ -727,7 +727,7 @@ function search_parse_query($text) { } // Negative matches foreach ($keys['negative'] as $key) { - list($q) = _search_parse_query($key, $arguments2, true); + list($q) = _search_parse_query($key, $arguments2, TRUE); if ($q) { $query[] = $q; $arguments[] = $key; @@ -744,7 +744,7 @@ function search_parse_query($text) { /** * Helper function for search_parse_query(); */ -function _search_parse_query(&$word, &$scores, $not = false) { +function _search_parse_query(&$word, &$scores, $not = FALSE) { $count = 0; // Determine the scorewords of this word/phrase if (!$not) { @@ -1134,9 +1134,9 @@ function search_excerpt($keys, $text) { // $q) and behind it (position $s) if (preg_match('/'. $boundary . $key . $boundary .'/iu', $text, $match, PREG_OFFSET_CAPTURE, $included[$key])) { $p = $match[0][1]; - if (($q = strpos($text, ' ', max(0, $p - 60))) !== false) { + if (($q = strpos($text, ' ', max(0, $p - 60))) !== FALSE) { $end = substr($text, $p, 80); - if (($s = strrpos($end, ' ')) !== false) { + if (($s = strrpos($end, ' ')) !== FALSE) { $ranges[$q] = $p + $s; $length += $p + $s - $q; $included[$key] = $p + 1; diff --git a/modules/search/search.module b/modules/search/search.module index 4a81a8fdb50c585dc20848808dc4cf68556fd4e5..b94adfffa6f322b4f0e052e34468b9f7e72c47d1 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -187,7 +187,7 @@ function search_settings_form_validate($form_id, &$form) { } // If these settings change, the index needs to be rebuilt. if ((variable_get('minimum_word_size', 3) != $form['minimum_word_size']) || - (variable_get('overlap_cjk', true) != $form['overlap_cjk'])) { + (variable_get('overlap_cjk', TRUE) != $form['overlap_cjk'])) { drupal_set_message(t('The index will be rebuilt.')); search_wipe(); } @@ -223,7 +223,7 @@ function search_settings() { $form['indexing_settings'] = array('#type' => 'fieldset', '#title' => t('Indexing settings')); $form['indexing_settings']['info'] = array('#type' => 'markup', '#value' => ''. t('

    Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.

    The default settings should be appropriate for the majority of sites.

    ') .'
    '); $form['indexing_settings']['minimum_word_size'] = array('#type' => 'textfield', '#title' => t('Minimum word length to index'), '#default_value' => variable_get('minimum_word_size', 3), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).')); - $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', true), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.')); + $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', TRUE), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.')); // Per module settings $form = array_merge($form, module_invoke_all('search', 'admin')); @@ -275,10 +275,10 @@ function search_wipe($sid = NULL, $type = NULL, $reindex = FALSE) { * during indexing (cron). Words which are dirty have outdated total counts in * the search_total table, and need to be recounted. */ -function search_dirty($word = null) { +function search_dirty($word = NULL) { static $dirty = array(); - if ($word !== null) { - $dirty[$word] = true; + if ($word !== NULL) { + $dirty[$word] = TRUE; } else { return $dirty; @@ -341,7 +341,7 @@ function search_simplify($text) { search_preprocess($text); // Simple CJK handling - if (variable_get('overlap_cjk', true)) { + if (variable_get('overlap_cjk', TRUE)) { $text = preg_replace_callback('/['. PREG_CLASS_CJK .']+/u', 'search_expand_cjk', $text); } @@ -397,8 +397,8 @@ function search_expand_cjk($matches) { * Splits a string into tokens for indexing. */ function search_index_split($text) { - static $last = null; - static $lastsplit = null; + static $last = NULL; + static $lastsplit = NULL; if ($last == $text) { return $lastsplit; @@ -477,8 +477,8 @@ function search_index($sid, $type, $text) { // Note: PHP ensures the array consists of alternating delimiters and literals // and begins and ends with a literal (inserting $null as required). - $tag = false; // Odd/even counter. Tag or no tag. - $link = false; // State variable for link analyser + $tag = FALSE; // Odd/even counter. Tag or no tag. + $link = FALSE; // State variable for link analyser $score = 1; // Starting score per word $accum = ' '; // Accumulator for cleaned up data $tagstack = array(); // Stack with open tags @@ -505,7 +505,7 @@ function search_index($sid, $type, $text) { $score = max(1, $score - $tags[array_shift($tagstack)]); } if ($tagname == 'a') { - $link = false; + $link = FALSE; } } else { @@ -530,7 +530,7 @@ function search_index($sid, $type, $text) { // Note: ignore links to uncachable nodes to avoid redirect bugs. $node = db_fetch_object(db_query('SELECT n.title, n.nid, n.vid, r.format FROM {node} n INNER JOIN {node_revisions} r ON n.vid = r.vid WHERE n.nid = %d', $linknid)); if (filter_format_allowcache($node->format)) { - $link = true; + $link = TRUE; $linktitle = $node->title; } } @@ -647,13 +647,13 @@ function search_parse_query($text) { } // Classify tokens - $or = false; + $or = FALSE; foreach ($matches as $match) { - $phrase = false; + $phrase = FALSE; // Strip off phrase quotes if ($match[2]{0} == '"') { $match[2] = substr($match[2], 1, -1); - $phrase = true; + $phrase = TRUE; } // Simplify keyword according to indexing rules and external preprocessors $words = search_simplify($match[2]); @@ -672,7 +672,7 @@ function search_parse_query($text) { $last = array($last); } $keys['positive'][] = $last; - $or = true; + $or = TRUE; continue; } // Plain keyword @@ -685,7 +685,7 @@ function search_parse_query($text) { $keys['positive'] = array_merge($keys['positive'], $words); } } - $or = false; + $or = FALSE; } // Convert keywords into SQL statements. @@ -699,7 +699,7 @@ function search_parse_query($text) { // Group of ORed terms if (is_array($key) && count($key)) { $queryor = array(); - $any = false; + $any = FALSE; foreach ($key as $or) { list($q, $count) = _search_parse_query($or, $arguments2); $any |= $count; @@ -727,7 +727,7 @@ function search_parse_query($text) { } // Negative matches foreach ($keys['negative'] as $key) { - list($q) = _search_parse_query($key, $arguments2, true); + list($q) = _search_parse_query($key, $arguments2, TRUE); if ($q) { $query[] = $q; $arguments[] = $key; @@ -744,7 +744,7 @@ function search_parse_query($text) { /** * Helper function for search_parse_query(); */ -function _search_parse_query(&$word, &$scores, $not = false) { +function _search_parse_query(&$word, &$scores, $not = FALSE) { $count = 0; // Determine the scorewords of this word/phrase if (!$not) { @@ -1134,9 +1134,9 @@ function search_excerpt($keys, $text) { // $q) and behind it (position $s) if (preg_match('/'. $boundary . $key . $boundary .'/iu', $text, $match, PREG_OFFSET_CAPTURE, $included[$key])) { $p = $match[0][1]; - if (($q = strpos($text, ' ', max(0, $p - 60))) !== false) { + if (($q = strpos($text, ' ', max(0, $p - 60))) !== FALSE) { $end = substr($text, $p, 80); - if (($s = strrpos($end, ' ')) !== false) { + if (($s = strrpos($end, ' ')) !== FALSE) { $ranges[$q] = $p + $s; $length += $p + $s - $q; $included[$key] = $p + 1; diff --git a/modules/system.module b/modules/system.module index 7a4c7158864036ae6f3a25d6db21fcce938c1df8..b306b7e824e163b7a59a75f917d5d82614595a31 100644 --- a/modules/system.module +++ b/modules/system.module @@ -204,7 +204,7 @@ function system_theme_select_form($description = '', $default_value = '', $weigh $info->key = $info->name == variable_get('theme_default', 'bluemarine') ? '' : $info->name; $info->screenshot = dirname($info->filename) . '/screenshot.png'; - $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), false) : t('no screenshot'); + $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot'); $form['themes'][$info->key]['screenshot'] = array('#type' => 'markup', '#value' => $screenshot); $form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename) . ($info->name == variable_get('theme_default', 'bluemarine') ? t('
    (site default theme)') : '')); @@ -375,7 +375,7 @@ function system_view_general() { // Image handling: $toolkits_available = image_get_available_toolkits(); if (count($toolkits_available) > 1) { - $form['image'] = array('#type' => 'fieldset', '#title' => t('Image handling'), '#collapsible' => TRUE, '#collapsed' => true); + $form['image'] = array('#type' => 'fieldset', '#title' => t('Image handling'), '#collapsible' => TRUE, '#collapsed' => TRUE); $form['image']['image_toolkit'] = array( '#type' => 'radios', '#title' => t('Select an image processing toolkit'), '#default_value' => variable_get('image_toolkit', image_get_toolkit()), '#options' => $toolkits_available @@ -814,7 +814,7 @@ function system_themes() { foreach ($themes as $info) { $info->screenshot = dirname($info->filename) . '/screenshot.png'; - $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), false) : t('no screenshot'); + $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot'); $form[$info->name]['screenshot'] = array('#type' => 'markup', '#value' => $screenshot); $form[$info->name]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename)); @@ -1107,11 +1107,11 @@ function system_theme_settings($key = '') { // Some features are not always available $disabled = array(); if (!variable_get('user_pictures', 0)) { - $disabled['toggle_node_user_picture'] = true; - $disabled['toggle_comment_user_picture'] = true; + $disabled['toggle_node_user_picture'] = TRUE; + $disabled['toggle_comment_user_picture'] = TRUE; } if (!module_exist('search')) { - $disabled['toggle_search'] = true; + $disabled['toggle_search'] = TRUE; } $form['theme_settings'] = array( diff --git a/modules/system/system.module b/modules/system/system.module index 7a4c7158864036ae6f3a25d6db21fcce938c1df8..b306b7e824e163b7a59a75f917d5d82614595a31 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -204,7 +204,7 @@ function system_theme_select_form($description = '', $default_value = '', $weigh $info->key = $info->name == variable_get('theme_default', 'bluemarine') ? '' : $info->name; $info->screenshot = dirname($info->filename) . '/screenshot.png'; - $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), false) : t('no screenshot'); + $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot'); $form['themes'][$info->key]['screenshot'] = array('#type' => 'markup', '#value' => $screenshot); $form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename) . ($info->name == variable_get('theme_default', 'bluemarine') ? t('
    (site default theme)') : '')); @@ -375,7 +375,7 @@ function system_view_general() { // Image handling: $toolkits_available = image_get_available_toolkits(); if (count($toolkits_available) > 1) { - $form['image'] = array('#type' => 'fieldset', '#title' => t('Image handling'), '#collapsible' => TRUE, '#collapsed' => true); + $form['image'] = array('#type' => 'fieldset', '#title' => t('Image handling'), '#collapsible' => TRUE, '#collapsed' => TRUE); $form['image']['image_toolkit'] = array( '#type' => 'radios', '#title' => t('Select an image processing toolkit'), '#default_value' => variable_get('image_toolkit', image_get_toolkit()), '#options' => $toolkits_available @@ -814,7 +814,7 @@ function system_themes() { foreach ($themes as $info) { $info->screenshot = dirname($info->filename) . '/screenshot.png'; - $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), false) : t('no screenshot'); + $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot'); $form[$info->name]['screenshot'] = array('#type' => 'markup', '#value' => $screenshot); $form[$info->name]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename)); @@ -1107,11 +1107,11 @@ function system_theme_settings($key = '') { // Some features are not always available $disabled = array(); if (!variable_get('user_pictures', 0)) { - $disabled['toggle_node_user_picture'] = true; - $disabled['toggle_comment_user_picture'] = true; + $disabled['toggle_node_user_picture'] = TRUE; + $disabled['toggle_comment_user_picture'] = TRUE; } if (!module_exist('search')) { - $disabled['toggle_search'] = true; + $disabled['toggle_search'] = TRUE; } $form['theme_settings'] = array( diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 23349c322a2fc7d158c99ef6982a245c5881b70d..4e17af388cbd20cfb58be0ae677d52db13c6943c 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -959,7 +959,7 @@ function taxonomy_term_count_nodes($tid, $type = 0) { static $count; if (!isset($count[$type])) { - // $type == 0 always evaluates true is $type is a string + // $type == 0 always evaluates TRUE is $type is a string if (is_numeric($type)) { $result = db_query(db_rewrite_sql('SELECT t.tid, COUNT(n.nid) AS c FROM {term_node} t INNER JOIN {node} n ON t.nid = n.nid WHERE n.status = 1 GROUP BY t.tid')); } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 23349c322a2fc7d158c99ef6982a245c5881b70d..4e17af388cbd20cfb58be0ae677d52db13c6943c 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -959,7 +959,7 @@ function taxonomy_term_count_nodes($tid, $type = 0) { static $count; if (!isset($count[$type])) { - // $type == 0 always evaluates true is $type is a string + // $type == 0 always evaluates TRUE is $type is a string if (is_numeric($type)) { $result = db_query(db_rewrite_sql('SELECT t.tid, COUNT(n.nid) AS c FROM {term_node} t INNER JOIN {node} n ON t.nid = n.nid WHERE n.status = 1 GROUP BY t.tid')); } diff --git a/modules/upload.module b/modules/upload.module index 78c1c47b9dc70e4f7a8d8b543444d706d400103c..fa1c6482ee9da19d1a0bad35d601be00be2c10e6 100644 --- a/modules/upload.module +++ b/modules/upload.module @@ -86,7 +86,7 @@ function upload_menu($may_cache) { $filename = file_create_filename($file->filename, file_create_path()); if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) { // strip file_directory_path() from filename. @see file_create_url - if (strpos($filename, file_directory_path()) !== false) { + if (strpos($filename, file_directory_path()) !== FALSE) { $filename = trim(substr($filename, strlen(file_directory_path())), '\\/'); } $filename = 'system/files/' . $filename; @@ -334,7 +334,7 @@ function _upload_validate(&$node) { $file = (object)$file; // Validate new uploads. - if (strpos($fid, 'upload') !== false && !$file->remove) { + if (strpos($fid, 'upload') !== FALSE && !$file->remove) { global $user; // Bypass validation for uid = 1. @@ -424,7 +424,7 @@ function upload_nodeapi(&$node, $op, $teaser) { if (!variable_get('clean_url', 0)) { $previews = array(); foreach ($node->files as $file) { - if (strpos($file->fid, 'upload') !== false) { + if (strpos($file->fid, 'upload') !== FALSE) { $previews[] = $file; } } @@ -465,7 +465,7 @@ function upload_nodeapi(&$node, $op, $teaser) { break; case 'search result': - return is_array($node->files) ? format_plural(count($node->files), '1 attachment', '%count attachments') : null; + return is_array($node->files) ? format_plural(count($node->files), '1 attachment', '%count attachments') : NULL; case 'rss item': if (is_array($node->files)) { @@ -607,7 +607,7 @@ function upload_save($node) { // will be required. if ($file->remove) { // Remove file previews... - if (strpos($file->fid, 'upload') !== false) { + if (strpos($file->fid, 'upload') !== FALSE) { file_delete($file->filepath); } @@ -624,7 +624,7 @@ function upload_save($node) { } // New file upload - elseif (strpos($file->fid, 'upload') !== false) { + elseif (strpos($file->fid, 'upload') !== FALSE) { if ($file = file_save_upload($file, $file->filename)) { $file->fid = db_next_id('{files}_fid'); db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', %d)", $file->fid, $node->nid, $file->filename, $file->filepath, $file->filemime, $file->filesize); @@ -688,7 +688,7 @@ function _upload_form($node) { $form['files']['#theme'] = 'upload_form_current'; $form['files']['#tree'] = TRUE; foreach ($node->files as $key => $file) { - $description = file_create_url((strpos($file->fid, 'upload') === false ? $file->filepath : file_create_filename($file->filename, file_create_path()))); + $description = file_create_url((strpos($file->fid, 'upload') === FALSE ? $file->filepath : file_create_filename($file->filename, file_create_path()))); $description = "". check_plain($description) .""; $form['files'][$key]['description'] = array('#type' => 'textfield', '#default_value' => (strlen($file->description)) ? $file->description : $file->filename, '#maxlength' => 256, '#description' => $description ); diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 78c1c47b9dc70e4f7a8d8b543444d706d400103c..fa1c6482ee9da19d1a0bad35d601be00be2c10e6 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -86,7 +86,7 @@ function upload_menu($may_cache) { $filename = file_create_filename($file->filename, file_create_path()); if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) { // strip file_directory_path() from filename. @see file_create_url - if (strpos($filename, file_directory_path()) !== false) { + if (strpos($filename, file_directory_path()) !== FALSE) { $filename = trim(substr($filename, strlen(file_directory_path())), '\\/'); } $filename = 'system/files/' . $filename; @@ -334,7 +334,7 @@ function _upload_validate(&$node) { $file = (object)$file; // Validate new uploads. - if (strpos($fid, 'upload') !== false && !$file->remove) { + if (strpos($fid, 'upload') !== FALSE && !$file->remove) { global $user; // Bypass validation for uid = 1. @@ -424,7 +424,7 @@ function upload_nodeapi(&$node, $op, $teaser) { if (!variable_get('clean_url', 0)) { $previews = array(); foreach ($node->files as $file) { - if (strpos($file->fid, 'upload') !== false) { + if (strpos($file->fid, 'upload') !== FALSE) { $previews[] = $file; } } @@ -465,7 +465,7 @@ function upload_nodeapi(&$node, $op, $teaser) { break; case 'search result': - return is_array($node->files) ? format_plural(count($node->files), '1 attachment', '%count attachments') : null; + return is_array($node->files) ? format_plural(count($node->files), '1 attachment', '%count attachments') : NULL; case 'rss item': if (is_array($node->files)) { @@ -607,7 +607,7 @@ function upload_save($node) { // will be required. if ($file->remove) { // Remove file previews... - if (strpos($file->fid, 'upload') !== false) { + if (strpos($file->fid, 'upload') !== FALSE) { file_delete($file->filepath); } @@ -624,7 +624,7 @@ function upload_save($node) { } // New file upload - elseif (strpos($file->fid, 'upload') !== false) { + elseif (strpos($file->fid, 'upload') !== FALSE) { if ($file = file_save_upload($file, $file->filename)) { $file->fid = db_next_id('{files}_fid'); db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', %d)", $file->fid, $node->nid, $file->filename, $file->filepath, $file->filemime, $file->filesize); @@ -688,7 +688,7 @@ function _upload_form($node) { $form['files']['#theme'] = 'upload_form_current'; $form['files']['#tree'] = TRUE; foreach ($node->files as $key => $file) { - $description = file_create_url((strpos($file->fid, 'upload') === false ? $file->filepath : file_create_filename($file->filename, file_create_path()))); + $description = file_create_url((strpos($file->fid, 'upload') === FALSE ? $file->filepath : file_create_filename($file->filename, file_create_path()))); $description = "". check_plain($description) .""; $form['files'][$key]['description'] = array('#type' => 'textfield', '#default_value' => (strlen($file->description)) ? $file->description : $file->filename, '#maxlength' => 256, '#description' => $description ); diff --git a/modules/user.module b/modules/user.module index 02ee1bc667f4b167aa5823b6f7619fd61e723325..d53bf74aa4e845a7b3a18eb16d4687fc280487dd 100644 --- a/modules/user.module +++ b/modules/user.module @@ -96,7 +96,7 @@ function user_load($array = array()) { * * @param $array * An array of fields and values to save. For example array('name' => 'My name'); - * Setting a field to null deletes it from the data column. + * Setting a field to NULL deletes it from the data column. * * @param $category * (optional) The category for storing profile information in. @@ -121,7 +121,7 @@ function user_save($account, $array = array(), $category = 'account') { } else if ($key != 'roles') { // Roles is a special case: it used below. - if ($value === null) { + if ($value === NULL) { unset($data[$key]); } else { @@ -198,7 +198,7 @@ function user_save($account, $array = array(), $category = 'account') { // Build and save the serialized data field now $data = array(); foreach ($array as $key => $value) { - if ((substr($key, 0, 4) !== 'auth') && ($key != 'roles') && (!in_array($key, $user_fields)) && ($value !== null)) { + if ((substr($key, 0, 4) !== 'auth') && ($key != 'roles') && (!in_array($key, $user_fields)) && ($value !== NULL)) { $data[$key] = $value; } } @@ -372,7 +372,7 @@ function user_access($string, $account = NULL) { /** * Checks for usernames blocked by user administration * - * @return boolean true for blocked users, false for active + * @return boolean TRUE for blocked users, FALSE for active */ function user_is_blocked($name) { $allow = db_fetch_object(db_query("SELECT * FROM {users} WHERE status = 1 AND name = LOWER('%s')", $name)); @@ -458,7 +458,7 @@ function user_file_download($file) { /** * Implementation of hook_search(). */ -function user_search($op = 'search', $keys = null) { +function user_search($op = 'search', $keys = NULL) { switch ($op) { case 'name': if (user_access('access user profiles')) { @@ -637,7 +637,7 @@ function theme_user_picture($account) { if (isset($picture)) { $alt = t('%user\'s picture', array('%user' => $account->name ? $account->name : variable_get('anonymous', 'Anonymous'))); - $picture = theme('image', $picture, $alt, $alt, '', false); + $picture = theme('image', $picture, $alt, $alt, '', FALSE); if (!empty($account->uid) && user_access('access user profiles')) { $picture = l($picture, "user/$account->uid", array('title' => t('View user profile.')), NULL, NULL, FALSE, TRUE); } diff --git a/modules/user/user.module b/modules/user/user.module index 02ee1bc667f4b167aa5823b6f7619fd61e723325..d53bf74aa4e845a7b3a18eb16d4687fc280487dd 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -96,7 +96,7 @@ function user_load($array = array()) { * * @param $array * An array of fields and values to save. For example array('name' => 'My name'); - * Setting a field to null deletes it from the data column. + * Setting a field to NULL deletes it from the data column. * * @param $category * (optional) The category for storing profile information in. @@ -121,7 +121,7 @@ function user_save($account, $array = array(), $category = 'account') { } else if ($key != 'roles') { // Roles is a special case: it used below. - if ($value === null) { + if ($value === NULL) { unset($data[$key]); } else { @@ -198,7 +198,7 @@ function user_save($account, $array = array(), $category = 'account') { // Build and save the serialized data field now $data = array(); foreach ($array as $key => $value) { - if ((substr($key, 0, 4) !== 'auth') && ($key != 'roles') && (!in_array($key, $user_fields)) && ($value !== null)) { + if ((substr($key, 0, 4) !== 'auth') && ($key != 'roles') && (!in_array($key, $user_fields)) && ($value !== NULL)) { $data[$key] = $value; } } @@ -372,7 +372,7 @@ function user_access($string, $account = NULL) { /** * Checks for usernames blocked by user administration * - * @return boolean true for blocked users, false for active + * @return boolean TRUE for blocked users, FALSE for active */ function user_is_blocked($name) { $allow = db_fetch_object(db_query("SELECT * FROM {users} WHERE status = 1 AND name = LOWER('%s')", $name)); @@ -458,7 +458,7 @@ function user_file_download($file) { /** * Implementation of hook_search(). */ -function user_search($op = 'search', $keys = null) { +function user_search($op = 'search', $keys = NULL) { switch ($op) { case 'name': if (user_access('access user profiles')) { @@ -637,7 +637,7 @@ function theme_user_picture($account) { if (isset($picture)) { $alt = t('%user\'s picture', array('%user' => $account->name ? $account->name : variable_get('anonymous', 'Anonymous'))); - $picture = theme('image', $picture, $alt, $alt, '', false); + $picture = theme('image', $picture, $alt, $alt, '', FALSE); if (!empty($account->uid) && user_access('access user profiles')) { $picture = l($picture, "user/$account->uid", array('title' => t('View user profile.')), NULL, NULL, FALSE, TRUE); } diff --git a/update.php b/update.php index a6b32e7dc4d6a600311381daa5058af2ed74ea33..7390b273a793abcfd72b8cb0e7c0d4ba32bd17bd 100644 --- a/update.php +++ b/update.php @@ -690,11 +690,11 @@ function update_convert_table_utf8($table) { break; case 'finished': - $output = update_finished_page(true); + $output = update_finished_page(TRUE); break; case 'error': - $output = update_finished_page(false); + $output = update_finished_page(FALSE); break; case 'do_update':