From a0a1607ca40b8f29f21a68014c27d9c6f059665e Mon Sep 17 00:00:00 2001 From: StefansArya Date: Sun, 7 Apr 2019 09:52:05 +0700 Subject: [PATCH] Fix missing class when parsing --- ScarletsQuery.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ScarletsQuery.php b/ScarletsQuery.php index b34369d..d643cb2 100644 --- a/ScarletsQuery.php +++ b/ScarletsQuery.php @@ -65,7 +65,8 @@ private static function parseTree(&$lastTree, $lastIndex, &$elements, $elementCo if(count($attributes) === 1) $attributes = []; else{ - $attributes[1] = str_replace(["\'", '\"'], '\\%1#', $attributes[1]); + $attributes[1] = str_replace(["\'", '\"'], ['\\%1#', '\\%2#'], $attributes[1]); + $attributes[1] = str_replace("'", '"', $attributes[1]); $attributes_ = explode('="', $attributes[1]); $attributes = []; @@ -93,7 +94,7 @@ private static function parseTree(&$lastTree, $lastIndex, &$elements, $elementCo continue; } - $attributes[$attr] = str_replace('\\%1#', '\"', $data); + $attributes[$attr] = str_replace(['\\%1#', '\\%2#'], "'", $data); // Prepare next $attr = trim($attributes_[$a][count($attributes_[$a]) - 1]);