summaryrefslogtreecommitdiff
path: root/includes/unicode.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/unicode.inc')
-rw-r--r--includes/unicode.inc4
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);