diff --git a/modules/aggregator.module b/modules/aggregator.module index be29a899511..c9833e5fd19 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -326,7 +326,7 @@ function import_refresh($feed) { } // extract the XML file's encoding (the XML parser in PHP4 doesn't do this by itself): - if (ereg('encoding="([^"]+)"', $data, $match)) { + if (ereg('^[^>]+encoding="([^"]+)"', $data, $match)) { $encoding = $match[1]; } diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index be29a899511..c9833e5fd19 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -326,7 +326,7 @@ function import_refresh($feed) { } // extract the XML file's encoding (the XML parser in PHP4 doesn't do this by itself): - if (ereg('encoding="([^"]+)"', $data, $match)) { + if (ereg('^[^>]+encoding="([^"]+)"', $data, $match)) { $encoding = $match[1]; } diff --git a/modules/import.module b/modules/import.module index be29a899511..c9833e5fd19 100644 --- a/modules/import.module +++ b/modules/import.module @@ -326,7 +326,7 @@ function import_refresh($feed) { } // extract the XML file's encoding (the XML parser in PHP4 doesn't do this by itself): - if (ereg('encoding="([^"]+)"', $data, $match)) { + if (ereg('^[^>]+encoding="([^"]+)"', $data, $match)) { $encoding = $match[1]; }