diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2003-12-30 06:28:01 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2003-12-30 06:28:01 +0000 |
commit | 205aa25e9b395a47b2995011739307070f1090c9 (patch) | |
tree | 8284ca98d58eada6ce8873334bbf856bd79b91ce | |
parent | 7ba70547c27900214c0eee0111df2ebc53a25986 (diff) | |
download | brdo-205aa25e9b395a47b2995011739307070f1090c9.tar.gz brdo-205aa25e9b395a47b2995011739307070f1090c9.tar.bz2 |
- Improved regexp for encoding extraction
-rw-r--r-- | modules/aggregator.module | 2 | ||||
-rw-r--r-- | modules/aggregator/aggregator.module | 2 | ||||
-rw-r--r-- | modules/import.module | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module index c9833e5fd..0dbde5585 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('^<\?xml[^>]+encoding="([^"]+)"', $data, $match)) { $encoding = $match[1]; } diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index c9833e5fd..0dbde5585 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('^<\?xml[^>]+encoding="([^"]+)"', $data, $match)) { $encoding = $match[1]; } diff --git a/modules/import.module b/modules/import.module index c9833e5fd..0dbde5585 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('^<\?xml[^>]+encoding="([^"]+)"', $data, $match)) { $encoding = $match[1]; } |