Skip to content

Commit

Permalink
Fix missing class when parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
StefansArya committed Apr 7, 2019
1 parent 818bac6 commit a0a1607
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ScarletsQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand Down Expand Up @@ -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]);
Expand Down

0 comments on commit a0a1607

Please sign in to comment.