Commit e93f8be8 authored by Dries's avatar Dries

- Patch #72204 by nedjo: upper-cased all TRUE/FALSE/NULL constants.

parent 59aa2ae8
......@@ -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'));
......@@ -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;
......
......@@ -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");
}
}
......
......@@ -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)) {
......
......@@ -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('<script type="text/javascript" src="'. base_path() .'misc/drupal.js'. $postfix .'"></script>');
$sent['misc/drupal.js'] = true;
$sent['misc/drupal.js'] = TRUE;
}
if (!isset($sent[$file])) {
drupal_set_html_head('<script type="text/javascript" src="'. check_url(base_path() . $file) . $postfix .'"></script>');
$sent[$file] = true;
$sent[$file] = TRUE;
}
}
......
......@@ -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));
......
......@@ -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
*/
......
......@@ -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';
}
......
......@@ -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' => "<em>$toolkit</em>", '%function' => "<em>$function</em>")), 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' => '<a href="http://php.net/image">http://php.net/image</a>')));
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);
}
......
......@@ -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;
}
}
......
......@@ -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
......
......@@ -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'),
......
......@@ -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.
*/
......
......@@ -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 <a href="%url">PHP mbstring extension</a> for improved Unicode support.', array('%url' => 'http://www.php.net/mbstring')),
UNICODE_MULTIBYTE => t('Multi-byte: operations on Unicode strings are supported through the <a href="%url">PHP mbstring extension</a>.', 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);
}
......
......@@ -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'];
......
......@@ -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
);
}
}
......
......@@ -1069,11 +1069,11 @@ function _aggregator_page_list($sql, $op, $header = '') {
$selected[] = $category->cid;
}
}
$done = true;
$done = TRUE;
$form['categories'][$item->iid] = array(