Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.611.2.26 diff -u -r1.611.2.26 common.inc --- includes/common.inc 4 Mar 2010 00:16:02 -0000 1.611.2.26 +++ includes/common.inc 19 Aug 2010 18:14:30 -0000 @@ -25,6 +25,13 @@ 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 @@ -589,7 +596,7 @@ 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 .'.'; Index: includes/file.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/file.inc,v retrieving revision 1.90.2.7 diff -u -r1.90.2.7 file.inc --- includes/file.inc 26 Jan 2009 14:22:45 -0000 1.90.2.7 +++ includes/file.inc 19 Aug 2010 18:14:30 -0000 @@ -643,7 +643,7 @@ 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, '.')); Index: includes/module.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/module.inc,v retrieving revision 1.93.2.2 diff -u -r1.93.2.2 module.inc --- includes/module.inc 21 Jul 2007 00:54:18 -0000 1.93.2.2 +++ includes/module.inc 19 Aug 2010 18:14:30 -0000 @@ -379,13 +379,15 @@ */ 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); } } + /** * Invoke a hook in all enabled modules that implement it. * Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.337.2.9 diff -u -r1.337.2.9 theme.inc --- includes/theme.inc 13 May 2009 19:41:56 -0000 1.337.2.9 +++ includes/theme.inc 19 Aug 2010 18:14:30 -0000 @@ -168,6 +168,10 @@ $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') { Index: includes/unicode.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/unicode.inc,v retrieving revision 1.23.2.2 diff -u -r1.23.2.2 unicode.inc --- includes/unicode.inc 21 May 2007 01:09:21 -0000 1.23.2.2 +++ includes/unicode.inc 19 Aug 2010 18:14:30 -0000 @@ -135,7 +135,7 @@ } // 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]; } Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.246.2.11 diff -u -r1.246.2.11 block.module --- modules/block/block.module 14 Jan 2009 05:43:04 -0000 1.246.2.11 +++ modules/block/block.module 19 Aug 2010 18:14:30 -0000 @@ -589,7 +589,7 @@ * 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') { Index: modules/comment/comment.info =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.info,v retrieving revision 1.3 diff -u -r1.3 comment.info --- modules/comment/comment.info 21 Nov 2006 20:55:34 -0000 1.3 +++ modules/comment/comment.info 19 Aug 2010 18:14:30 -0000 @@ -1,5 +1,5 @@ ; $Id: comment.info,v 1.3 2006/11/21 20:55:34 dries Exp $ 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 Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.520.2.15 diff -u -r1.520.2.15 comment.module --- modules/comment/comment.module 11 Aug 2010 20:37:49 -0000 1.520.2.15 +++ modules/comment/comment.module 19 Aug 2010 18:14:31 -0000 @@ -450,7 +450,7 @@ * * Provides signature customization for the user's comments. */ -function comment_user($type, $edit, &$user, $category = NULL) { +function comment_user($type, $edit, $user, $category = NULL) { if ($type == 'form' && $category == 'account') { // when user tries to edit his own data $form['comment_settings'] = array( Index: modules/drupal/drupal.info =================================================================== RCS file: /cvs/drupal/drupal/modules/drupal/Attic/drupal.info,v retrieving revision 1.3 diff -u -r1.3 drupal.info --- modules/drupal/drupal.info 21 Nov 2006 20:55:34 -0000 1.3 +++ modules/drupal/drupal.info 19 Aug 2010 18:14:31 -0000 @@ -1,5 +1,5 @@ ; $Id: drupal.info,v 1.3 2006/11/21 20:55:34 dries Exp $ 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 Index: modules/node/node.info =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.info,v retrieving revision 1.3 diff -u -r1.3 node.info --- modules/node/node.info 21 Nov 2006 20:55:34 -0000 1.3 +++ modules/node/node.info 19 Aug 2010 18:14:31 -0000 @@ -1,5 +1,5 @@ ; $Id: node.info,v 1.3 2006/11/21 20:55:34 dries Exp $ 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 Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.776.2.33 diff -u -r1.776.2.33 node.module --- modules/node/node.module 14 Jan 2009 23:32:14 -0000 1.776.2.33 +++ modules/node/node.module 19 Aug 2010 18:14:31 -0000 @@ -1006,7 +1006,7 @@ /** * 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); Index: modules/poll/poll.info =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.info,v retrieving revision 1.3 diff -u -r1.3 poll.info --- modules/poll/poll.info 21 Nov 2006 20:55:35 -0000 1.3 +++ modules/poll/poll.info 19 Aug 2010 18:14:31 -0000 @@ -1,5 +1,5 @@ ; $Id: poll.info,v 1.3 2006/11/21 20:55:35 dries Exp $ 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 Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.440.2.64 diff -u -r1.440.2.64 system.module --- modules/system/system.module 11 Aug 2010 21:30:39 -0000 1.440.2.64 +++ modules/system/system.module 19 Aug 2010 18:14:32 -0000 @@ -325,7 +325,7 @@ * * 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); @@ -1864,7 +1864,7 @@ /** * Theme status report */ -function theme_status_report(&$requirements) { +function theme_status_report($requirements) { $i = 0; $output = ''; foreach ($requirements as $requirement) { Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/Attic/upload.module,v retrieving revision 1.148.2.6 diff -u -r1.148.2.6 upload.module --- modules/upload/upload.module 11 Aug 2010 20:37:49 -0000 1.148.2.6 +++ modules/upload/upload.module 19 Aug 2010 18:14:32 -0000 @@ -815,7 +815,7 @@ /** * 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) { Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.745.2.36 diff -u -r1.745.2.36 user.module --- modules/user/user.module 16 Sep 2009 19:33:40 -0000 1.745.2.36 +++ modules/user/user.module 19 Aug 2010 18:14:32 -0000 @@ -260,7 +260,7 @@ 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 @@ -464,7 +464,7 @@ /** * 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), @@ -1043,7 +1043,9 @@ // 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(); @@ -1505,7 +1507,7 @@ $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) { @@ -1545,8 +1547,11 @@ } // 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']; @@ -2456,8 +2461,12 @@ 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); } } @@ -2479,7 +2488,9 @@ 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); } } Index: modules/watchdog/watchdog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/watchdog/Attic/watchdog.module,v retrieving revision 1.165.2.1 diff -u -r1.165.2.1 watchdog.module --- modules/watchdog/watchdog.module 23 Jan 2007 19:07:33 -0000 1.165.2.1 +++ modules/watchdog/watchdog.module 19 Aug 2010 18:14:32 -0000 @@ -73,7 +73,7 @@ /** * 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); }