diff --git a/INSTALL.txt b/INSTALL.txt index 1e80540..4154324 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -21,13 +21,12 @@ are created automatically. REQUIREMENTS ------------ -Drupal requires a web server, PHP4 (4.3.5 or greater) or PHP5 (through 5.2.x -only; 5.3.x and later versions are not supported) (http://php.net/) and either -MySQL (http://www.mysql.com/) or PostgreSQL (http://www.postgresql.org/). The -Apache web server and MySQL database are recommended; other web server and -database combinations such as IIS and PostgreSQL have been tested to a lesser -extent. When using MySQL, version 4.1 or greater is recommended to assure you -can safely transfer the database. +Drupal requires a web server, PHP4 (4.3.5 or greater) or PHP5 (http://php.net/) +and either MySQL (http://www.mysql.com/) or PostgreSQL +(http://www.postgresql.org/). The Apache web server and MySQL database are +recommended; other web server and database combinations such as IIS and +PostgreSQL have been tested to a lesser extent. When using MySQL, version 4.1 or +greater is recommended to assure you can safely transfer the database. For more detailed information about Drupal requirements, see "Requirements" (http://drupal.org/requirements) in the Drupal Handbook. diff --git a/includes/common.inc b/includes/common.inc index d1bcb2f..75ffc93 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -24,6 +24,13 @@ define('SAVED_UPDATED', 2); define('SAVED_DELETED', 3); /** + * Create E_DEPRECATED constant for older PHP versions (<5.3). + */ +if (!defined('E_DEPRECATED')) { + define('E_DEPRECATED', 8192); +} + +/** * Set content for a specified region. * * @param $region @@ -588,7 +595,7 @@ function error_handler($errno, $message, $filename, $line) { return; } - if ($errno & (E_ALL ^ E_NOTICE)) { + if ($errno & (E_ALL & ~E_NOTICE & ~E_DEPRECATED)) { $types = array(1 => 'error', 2 => 'warning', 4 => 'parse error', 8 => 'notice', 16 => 'core error', 32 => 'core warning', 64 => 'compile error', 128 => 'compile warning', 256 => 'user error', 512 => 'user warning', 1024 => 'user notice', 2048 => 'strict warning', 4096 => 'recoverable fatal error'); $entry = $types[$errno] .': '. $message .' in '. $filename .' on line '. $line .'.'; diff --git a/includes/file.inc b/includes/file.inc index ee65d62..6ef5fae 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -642,7 +642,7 @@ function file_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS'), $ca if (is_dir("$dir/$file") && $recurse) { $files = array_merge($files, file_scan_directory("$dir/$file", $mask, $nomask, $callback, $recurse, $key, $min_depth, $depth + 1)); } - elseif ($depth >= $min_depth && ereg($mask, $file)) { + elseif ($depth >= $min_depth && @ereg($mask, $file)) { $filename = "$dir/$file"; $basename = basename($file); $name = substr($basename, 0, strrpos($basename, '.')); diff --git a/includes/module.inc b/includes/module.inc index 34dcc43..feca604 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -378,8 +378,9 @@ function module_implements($hook, $sort = FALSE, $refresh = FALSE) { */ function module_invoke() { $args = func_get_args(); - $module = array_shift($args); - $hook = array_shift($args); + $module = $args[0]; + $hook = $args[1]; + unset($args[0], $args[1]); $function = $module .'_'. $hook; if (module_hook($module, $hook)) { return call_user_func_array($function, $args); diff --git a/includes/theme.inc b/includes/theme.inc index 38ec6e6..ea2a4ff 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -167,6 +167,10 @@ function theme() { $functions[$function] = theme_get_function($function); } if ($functions[$function]) { + // Force the arguments to pass through by reference. + foreach($args as $i => &$arg){ + $args[$i] = &$arg; + } $output = call_user_func_array($functions[$function], $args); // Add final markup to the full page. if ($function == 'page' || $function == 'book_export_html') { diff --git a/includes/unicode.inc b/includes/unicode.inc index 71b40af..92ff1f8 100644 --- a/includes/unicode.inc +++ b/includes/unicode.inc @@ -134,7 +134,7 @@ function drupal_xml_parser_create(&$data) { } // Check for an encoding declaration in the XML prolog if no BOM was found. - if (!$bom && ereg('^<\?xml[^>]+encoding="([^"]+)"', $data, $match)) { + if (!$bom && @ereg('^<\?xml[^>]+encoding="([^"]+)"', $data, $match)) { $encoding = $match[1]; } diff --git a/modules/block/block.module b/modules/block/block.module index 24a8351..24fe67c 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -588,7 +588,7 @@ function block_box_save($edit, $delta = NULL) { * Allow users to decide which custom blocks to display when they visit * the site. */ -function block_user($type, $edit, &$account, $category = NULL) { +function block_user($type, $edit, $account, $category = NULL) { switch ($type) { case 'form': if ($category == 'account') { diff --git a/modules/comment/comment.info b/modules/comment/comment.info index 63139a1..3fe8919 100644 --- a/modules/comment/comment.info +++ b/modules/comment/comment.info @@ -1,4 +1,4 @@ name = Comment -description = Allows users to comment on and discuss published content. +description = "Allows users to comment on and discuss published content." package = Core - optional version = VERSION diff --git a/modules/contact/contact.info b/modules/contact/contact.info index 08cc5ab..e04d289 100644 --- a/modules/contact/contact.info +++ b/modules/contact/contact.info @@ -1,4 +1,4 @@ name = Contact -description = Enables the use of both personal and site-wide contact forms. +description = "Enables the use of both personal and site-wide contact forms." package = Core - optional version = VERSION diff --git a/modules/drupal/drupal.info b/modules/drupal/drupal.info index b5dfda6..0f59027 100644 --- a/modules/drupal/drupal.info +++ b/modules/drupal/drupal.info @@ -1,4 +1,4 @@ name = Drupal -description = Lets you register your site with a central server and improve ranking of Drupal projects by posting information on your installed modules and themes; also enables users to log in using a Drupal ID. +description = "Lets you register your site with a central server and improve ranking of Drupal projects by posting information on your installed modules and themes; also enables users to log in using a Drupal ID." package = Core - optional version = VERSION diff --git a/modules/node/node.info b/modules/node/node.info index 0f6a279..b01c5e3 100644 --- a/modules/node/node.info +++ b/modules/node/node.info @@ -1,4 +1,4 @@ name = Node -description = Allows content to be submitted to the site and displayed on pages. +description = "Allows content to be submitted to the site and displayed on pages." package = Core - required version = VERSION diff --git a/modules/node/node.module b/modules/node/node.module index 556b32c..f1ff4f0 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1005,7 +1005,7 @@ function node_search($op = 'search', $keys = NULL) { /** * Implementation of hook_user(). */ -function node_user($op, &$edit, &$user) { +function node_user($op, $edit, &$user) { if ($op == 'delete') { db_query('UPDATE {node} SET uid = 0 WHERE uid = %d', $user->uid); db_query('UPDATE {node_revisions} SET uid = 0 WHERE uid = %d', $user->uid); diff --git a/modules/poll/poll.info b/modules/poll/poll.info index c446051..466985e 100644 --- a/modules/poll/poll.info +++ b/modules/poll/poll.info @@ -1,4 +1,4 @@ name = Poll -description = Allows your site to capture votes on different topics in the form of multiple choice questions. +description = "Allows your site to capture votes on different topics in the form of multiple choice questions." package = Core - optional version = VERSION diff --git a/modules/system/system.module b/modules/system/system.module index 96b9b05..d3f97b9 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -324,7 +324,7 @@ function system_menu($may_cache) { * * Allows users to individually set their theme and time zone. */ -function system_user($type, $edit, &$user, $category = NULL) { +function system_user($type, $edit, $user, $category = NULL) { if ($type == 'form' && $category == 'account') { $form['theme_select'] = system_theme_select_form(t('Selecting a different theme will change the look and feel of the site.'), $edit['theme'], 2); @@ -1863,7 +1863,7 @@ function _system_sort_requirements($a, $b) { /** * Theme status report */ -function theme_status_report(&$requirements) { +function theme_status_report($requirements) { $i = 0; $output = ''; foreach ($requirements as $requirement) { diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 883b326..45575f3 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -814,7 +814,7 @@ function _upload_form($node) { /** * Theme the attachments list. */ -function theme_upload_form_current(&$form) { +function theme_upload_form_current($form) { $header = array(t('Delete'), t('List'), t('Description'), t('Size')); foreach (element_children($form) as $key) { diff --git a/modules/user/user.module b/modules/user/user.module index 17354c4..55bab38 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -259,7 +259,7 @@ function user_validate_name($name) { if (substr($name, 0, 1) == ' ') return t('The username cannot begin with a space.'); if (substr($name, -1) == ' ') return t('The username cannot end with a space.'); if (strpos($name, ' ') !== FALSE) return t('The username cannot contain multiple spaces in a row.'); - if (ereg("[^\x80-\xF7 [:alnum:]@_.-]", $name)) return t('The username contains an illegal character.'); + if (@ereg("[^\x80-\xF7 [:alnum:]@_.-]", $name)) return t('The username contains an illegal character.'); if (preg_match('/[\x{80}-\x{A0}'. // Non-printable ISO-8859-1 + NBSP '\x{AD}'. // Soft-hyphen '\x{2000}-\x{200F}'. // Various space characters @@ -463,7 +463,7 @@ function user_search($op = 'search', $keys = NULL) { /** * Implementation of hook_user(). */ -function user_user($type, &$edit, &$user, $category = NULL) { +function user_user($type, $edit, $user, $category = NULL) { if ($type == 'view') { $items['history'] = array('title' => t('Member for'), 'value' => format_interval(time() - $user->created), @@ -1042,7 +1042,9 @@ function user_logout() { // Destroy the current session: session_destroy(); - module_invoke_all('user', 'logout', NULL, $user); + // Only variables can be passed by reference workaround. + $null = NULL; + user_module_invoke('logout', $null, $user); // Load the anonymous user $user = drupal_anonymous_user(); @@ -1504,7 +1506,7 @@ function user_delete($edit, $uid) { $array = array('%name' => $account->name, '%email' => '<'. $account->mail .'>'); watchdog('user', t('Deleted user: %name %email.', $array), WATCHDOG_NOTICE); drupal_set_message(t('%name has been deleted.', $array)); - module_invoke_all('user', 'delete', $edit, $account); + user_module_invoke('delete', $edit, $account); } function user_edit_validate($form_id, $form_values) { @@ -1544,8 +1546,11 @@ function user_view($uid = 0) { } // Retrieve and merge all profile fields: $fields = array(); + $null = NULL; foreach (module_list() as $module) { - if ($data = module_invoke($module, 'user', 'view', '', $account)) { + $function = $module .'_user'; + // $null and $account need to be passed by reference. + if (function_exists($function) && ($data = $function('view', $null, $account, ''))) { foreach ($data as $category => $items) { foreach ($items as $key => $item) { $item['class'] = "$module-". $item['class']; @@ -2455,8 +2460,12 @@ function user_help_page() { function _user_categories($account) { $categories = array(); + // Only variables can be passed by reference workaround. + $null = NULL; foreach (module_list() as $module) { - if ($data = module_invoke($module, 'user', 'categories', NULL, $account, '')) { + $function = $module .'_user'; + // $null and $account need to be passed by reference. + if (function_exists($function) && ($data = $function('categories', $null, $account, ''))) { $categories = array_merge($data, $categories); } } @@ -2478,7 +2487,9 @@ function _user_sort($a, $b) { function _user_forms(&$edit, $account, $category, $hook = 'form') { $groups = array(); foreach (module_list() as $module) { - if ($data = module_invoke($module, 'user', $hook, $edit, $account, $category)) { + $function = $module .'_user'; + // $edit and $account need to be passed by reference. + if (function_exists($function) && ($data = $function($hook, $edit, $account, $category))) { $groups = array_merge_recursive($data, $groups); } } diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index abf1307..e88b9e8 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -72,7 +72,7 @@ function watchdog_cron() { /** * Implementation of hook_user(). */ -function watchdog_user($op, &$edit, &$user) { +function watchdog_user($op, $edit, $user) { if ($op == 'delete') { db_query('UPDATE {watchdog} SET uid = 0 WHERE uid = %d', $user->uid); }