Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.113.2.8 diff -u -p -r1.113.2.8 install.php --- install.php 25 Feb 2009 11:47:36 -0000 1.113.2.8 +++ install.php 25 Mar 2009 15:43:18 -0000 @@ -412,7 +412,7 @@ function install_settings_form_submit($f * Find all .profile files. */ function install_find_profiles() { - return file_scan_directory('./profiles', '\.profile$', array('.', '..', 'CVS'), 0, TRUE, 'name', 0); + return file_scan_directory('./profiles', '/\.profile$/', array('.', '..', 'CVS'), 0, TRUE, 'name', 0); } /** @@ -497,7 +497,7 @@ function install_select_profile_form(&$f * Find all .po files for the current profile. */ function install_find_locales($profilename) { - $locales = file_scan_directory('./profiles/'. $profilename .'/translations', '\.po$', array('.', '..', 'CVS'), 0, FALSE); + $locales = file_scan_directory('./profiles/'. $profilename .'/translations', '/\.po$/', array('.', '..', 'CVS'), 0, FALSE); array_unshift($locales, (object) array('name' => 'en')); return $locales; } Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.756.2.48 diff -u -p -r1.756.2.48 common.inc --- includes/common.inc 25 Feb 2009 23:16:45 -0000 1.756.2.48 +++ includes/common.inc 25 Mar 2009 15:43:28 -0000 @@ -1997,7 +1997,7 @@ function _drupal_load_stylesheet($matche * Delete all cached CSS files. */ function drupal_clear_css_cache() { - file_scan_directory(file_create_path('css'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE); + file_scan_directory(file_create_path('css'), '/.*/', array('.', '..', 'CVS'), 'file_delete', TRUE); } /** @@ -2371,7 +2371,7 @@ function drupal_build_js_cache($files, $ * Delete all cached JS files. */ function drupal_clear_js_cache() { - file_scan_directory(file_create_path('js'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE); + file_scan_directory(file_create_path('js'), '/.*/', array('.', '..', 'CVS'), 'file_delete', TRUE); variable_set('javascript_parsed', array()); } Index: includes/file.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/file.inc,v retrieving revision 1.121.2.5 diff -u -p -r1.121.2.5 file.inc --- includes/file.inc 20 Oct 2008 09:42:31 -0000 1.121.2.5 +++ includes/file.inc 25 Mar 2009 15:43:39 -0000 @@ -623,7 +623,7 @@ function file_validate_extensions($file, // Bypass validation for uid = 1. if ($user->uid != 1) { - $regex = '/\.('. ereg_replace(' +', '|', preg_quote($extensions)) .')$/i'; + $regex = '/\.('. str_replace(' +', '|', preg_quote($extensions)) .')$/i'; if (!preg_match($regex, $file->filename)) { $errors[] = t('Only files with the following extensions are allowed: %files-allowed.', array('%files-allowed' => $extensions)); } @@ -892,7 +892,7 @@ function file_scan_directory($dir, $mask // Give priority to files in this folder by merging them in after any subdirectory files. $files = array_merge(file_scan_directory("$dir/$file", $mask, $nomask, $callback, $recurse, $key, $min_depth, $depth + 1), $files); } - elseif ($depth >= $min_depth && ereg($mask, $file)) { + elseif ($depth >= $min_depth && preg_match($mask, $file)) { // Always use this match over anything already set in $files with the same $$key. $filename = "$dir/$file"; $basename = basename($file); Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.265.2.19 diff -u -p -r1.265.2.19 form.inc --- includes/form.inc 22 Feb 2009 18:12:46 -0000 1.265.2.19 +++ includes/form.inc 25 Mar 2009 15:43:42 -0000 @@ -292,6 +292,10 @@ function form_get_cache($form_build_id, */ function drupal_execute($form_id, &$form_state) { $args = func_get_args(); + + // Make sure $form_state is passed around by reference. + $args[1] = &$form_state; + $form = call_user_func_array('drupal_retrieve_form', $args); $form['#post'] = $form_state['values']; drupal_prepare_form($form_id, $form, $form_state); Index: includes/install.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/install.inc,v retrieving revision 1.56.2.4 diff -u -p -r1.56.2.4 install.inc --- includes/install.inc 16 Feb 2009 10:25:02 -0000 1.56.2.4 +++ includes/install.inc 25 Mar 2009 15:43:42 -0000 @@ -252,7 +252,7 @@ function drupal_rewrite_settings($settin function drupal_get_install_files($module_list = array()) { $installs = array(); foreach ($module_list as $module) { - $installs = array_merge($installs, drupal_system_listing($module .'.install$', 'modules')); + $installs = array_merge($installs, drupal_system_listing('/'. $module .'.install$/', 'modules')); } return $installs; } @@ -285,7 +285,7 @@ function drupal_verify_profile($profile, // Get a list of modules that exist in Drupal's assorted subdirectories. $present_modules = array(); - foreach (drupal_system_listing('\.module$', 'modules', 'name', 0) as $present_module) { + foreach (drupal_system_listing('/\.module$/', 'modules', 'name', 0) as $present_module) { $present_modules[] = $present_module->name; } Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.174.2.7 diff -u -p -r1.174.2.7 locale.inc --- includes/locale.inc 6 Jan 2009 15:36:51 -0000 1.174.2.7 +++ includes/locale.inc 25 Mar 2009 15:43:49 -0000 @@ -2513,7 +2513,7 @@ function locale_batch_by_language($langc // with names ending with $langcode.po. This allows for filenames // like node-module.de.po to let translators use small files and // be able to import in smaller chunks. - $files = array_merge($files, file_scan_directory(dirname($component->filename) .'/translations', '(^|\.)'. $langcode .'\.po$', array('.', '..', 'CVS'), 0, FALSE)); + $files = array_merge($files, file_scan_directory(dirname($component->filename) .'/translations', '/(^|\.)'. $langcode .'\.po$/', array('.', '..', 'CVS'), 0, FALSE)); $components[] = $component->name; } @@ -2545,7 +2545,7 @@ function locale_batch_by_component($comp // as $langcode.po or with names ending with $langcode.po. This allows // for filenames like node-module.de.po to let translators use small // files and be able to import in smaller chunks. - $files = array_merge($files, file_scan_directory(dirname($component->filename) .'/translations', '(^|\.)('. $language_list .')\.po$', array('.', '..', 'CVS'), 0, FALSE)); + $files = array_merge($files, file_scan_directory(dirname($component->filename) .'/translations', '/(^|\.)('. $language_list .')\.po$/', array('.', '..', 'CVS'), 0, FALSE)); } } return _locale_batch_build($files, $finished); Index: includes/module.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/module.inc,v retrieving revision 1.115.2.1 diff -u -p -r1.115.2.1 module.inc --- includes/module.inc 16 Feb 2009 10:32:10 -0000 1.115.2.1 +++ includes/module.inc 25 Mar 2009 15:43:50 -0000 @@ -95,7 +95,7 @@ function module_list($refresh = FALSE, $ */ function module_rebuild_cache() { // Get current list of modules - $files = drupal_system_listing('\.module$', 'modules', 'name', 0); + $files = drupal_system_listing('/\.module$/', 'modules', 'name', 0); // Extract current files from database. system_get_files_database($files, 'module'); Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.415.2.19 diff -u -p -r1.415.2.19 theme.inc --- includes/theme.inc 25 Feb 2009 21:02:16 -0000 1.415.2.19 +++ includes/theme.inc 25 Mar 2009 15:43:55 -0000 @@ -814,7 +814,7 @@ function drupal_find_theme_templates($ca $subtheme_paths = isset($theme_paths[$theme]) ? $theme_paths[$theme] : array(); // Escape the periods in the extension. - $regex = str_replace('.', '\.', $extension) .'$'; + $regex = '/'. str_replace('.', '\.', $extension) .'$/'; // Because drupal_system_listing works the way it does, we check for real // templates separately from checking for patterns. $files = drupal_system_listing($regex, $path, 'name', 0); Index: includes/unicode.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/unicode.inc,v retrieving revision 1.29 diff -u -p -r1.29 unicode.inc --- includes/unicode.inc 28 Dec 2007 12:02:50 -0000 1.29 +++ includes/unicode.inc 25 Mar 2009 15:44:03 -0000 @@ -135,7 +135,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 && preg_match('/^<\?xml[^>]+encoding="(.+?)"/', $data, $match)) { $encoding = $match[1]; } @@ -145,7 +145,7 @@ function drupal_xml_parser_create(&$data $out = drupal_convert_to_utf8($data, $encoding); if ($out !== FALSE) { $encoding = 'utf-8'; - $data = ereg_replace('^(<\?xml[^>]+encoding)="([^"]+)"', '\\1="utf-8"', $out); + $data = preg_replace('/^(<\?xml[^>]+encoding)="(.+?)"/', '\\1="utf-8"', $out); } else { watchdog('php', 'Could not convert XML encoding %s to UTF-8.', array('%s' => $encoding), WATCHDOG_WARNING); Index: modules/blogapi/blogapi.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.module,v retrieving revision 1.115.2.5 diff -u -p -r1.115.2.5 blogapi.module --- modules/blogapi/blogapi.module 8 Oct 2008 20:12:17 -0000 1.115.2.5 +++ modules/blogapi/blogapi.module 25 Mar 2009 15:44:04 -0000 @@ -689,13 +689,14 @@ function blogapi_validate_user($username * For the blogger API, extract the node title from the contents field. */ function blogapi_blogger_title(&$contents) { - if (eregi('