- Improved regexp for encoding extraction
parent
e8265f0759
commit
7ba70547c2
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue