- Improved regexp for encoding extraction

4.4.x
Steven Wittens 2003-12-30 06:24:28 +00:00
parent e8265f0759
commit 7ba70547c2
3 changed files with 3 additions and 3 deletions

View File

@ -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];
}

View File

@ -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];
}

View File

@ -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];
}