diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-09-05 09:25:52 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-09-05 09:25:52 +0000 |
commit | 2b0766503392aaf91837b64ca6a0a3c6d2f035ce (patch) | |
tree | 0f22a3b443809d12fe13b563b615ed7a0e0df0f5 /includes/unicode.inc | |
parent | 4231e3e98ba477e34a424bbc2e766e6f3ba42411 (diff) | |
download | brdo-2b0766503392aaf91837b64ca6a0a3c6d2f035ce.tar.gz brdo-2b0766503392aaf91837b64ca6a0a3c6d2f035ce.tar.bz2 |
- Patch #64967 by Arancaytar, meba: ereg -> preg for performance reasons and future compatilbility. PHP6 is rumoured to drop ereg support.
Diffstat (limited to 'includes/unicode.inc')
-rw-r--r-- | includes/unicode.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/unicode.inc b/includes/unicode.inc index 93a522d09..b01e3bcfd 100644 --- a/includes/unicode.inc +++ b/includes/unicode.inc @@ -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); |