|
@@ -349,13 +349,14 @@ class XmlDeserializationVisitor extends AbstractVisitor
|
|
|
|
|
|
/**
|
|
/**
|
|
* Retrieves internalSubset even in bugfixed php versions
|
|
* Retrieves internalSubset even in bugfixed php versions
|
|
|
|
+ *
|
|
* @param \DOMDocumentType $child
|
|
* @param \DOMDocumentType $child
|
|
- * @param $data
|
|
|
|
|
|
+ * @param string $data
|
|
* @return string
|
|
* @return string
|
|
*/
|
|
*/
|
|
private function getDomDocumentTypeEntitySubset(\DOMDocumentType $child, $data)
|
|
private function getDomDocumentTypeEntitySubset(\DOMDocumentType $child, $data)
|
|
{
|
|
{
|
|
- if(!$this->isBugFixedPhpVersion()){
|
|
|
|
|
|
+ if((PHP_VERSION_ID >= 50513) || (PHP_VERSION_ID >= 50429 && PHP_VERSION_ID < 50500)){
|
|
return str_replace(array("\n", "\r"), '', $child->internalSubset);
|
|
return str_replace(array("\n", "\r"), '', $child->internalSubset);
|
|
}
|
|
}
|
|
$startPos = $endPos = stripos($data, '<!doctype');
|
|
$startPos = $endPos = stripos($data, '<!doctype');
|
|
@@ -375,14 +376,4 @@ class XmlDeserializationVisitor extends AbstractVisitor
|
|
$internalSubset = str_replace(array("[ <!", "> ]>"), array('[<!', '>]>'), $internalSubset);
|
|
$internalSubset = str_replace(array("[ <!", "> ]>"), array('[<!', '>]>'), $internalSubset);
|
|
return $internalSubset;
|
|
return $internalSubset;
|
|
}
|
|
}
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Whether or not PHP internalSubset bug is fixed in current version
|
|
|
|
- * @return boolean
|
|
|
|
- * @link https://bugs.php.net/bug.php?id=67081
|
|
|
|
- **/
|
|
|
|
- private function isBugFixedPhpVersion()
|
|
|
|
- {
|
|
|
|
- return (PHP_VERSION_ID >= 50513) || (PHP_VERSION_ID >= 50429 && PHP_VERSION_ID < 50500);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|