@@ -49,6 +49,10 @@ discard block |
||
49 | 49 | return $result; |
50 | 50 | } |
51 | 51 | |
52 | + /** |
|
53 | + * @param string $function |
|
54 | + * @param \DOMElement $element |
|
55 | + */ |
|
52 | 56 | private function parseString($function, $element) { |
53 | 57 | $result = []; |
54 | 58 | if ($function && in_array($function[0], ['\'', '"'])) { |
@@ -102,6 +106,9 @@ discard block |
||
102 | 106 | else return call_user_func_array([$obj, $func], $params); |
103 | 107 | } |
104 | 108 | |
109 | + /** |
|
110 | + * @param string $remaining |
|
111 | + */ |
|
105 | 112 | private function parseNextValue($remaining, $result, $element) { |
106 | 113 | if (strlen($remaining) > 0 && $remaining[0] == ',') $result = array_merge($result, $this->parse(trim(substr($remaining, 1)), $element)); |
107 | 114 | return $result; |
@@ -23,8 +23,8 @@ |
||
23 | 23 | $end = strpos($str, '"', $pos+1); |
24 | 24 | if (!$end) break; |
25 | 25 | while ($str[$end-1] == '\\') $end = strpos($str, '"', $end+1); |
26 | - $strings['$___STR' . ++$num] = substr($str, $pos, $end-$pos+1); |
|
27 | - $str = substr_replace($str, '$___STR' . $num, $pos, $end-$pos+1); |
|
26 | + $strings['$___STR'.++$num] = substr($str, $pos, $end-$pos+1); |
|
27 | + $str = substr_replace($str, '$___STR'.$num, $pos, $end-$pos+1); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | return [$str, $strings]; |
@@ -21,8 +21,12 @@ |
||
21 | 21 | $strings = []; |
22 | 22 | while (isset($str[$pos]) && ($pos = strpos($str, '"', $pos)) !== false) { |
23 | 23 | $end = strpos($str, '"', $pos+1); |
24 | - if (!$end) break; |
|
25 | - while ($str[$end-1] == '\\') $end = strpos($str, '"', $end+1); |
|
24 | + if (!$end) { |
|
25 | + break; |
|
26 | + } |
|
27 | + while ($str[$end-1] == '\\') { |
|
28 | + $end = strpos($str, '"', $end+1); |
|
29 | + } |
|
26 | 30 | $strings['$___STR' . ++$num] = substr($str, $pos, $end-$pos+1); |
27 | 31 | $str = substr_replace($str, '$___STR' . $num, $pos, $end-$pos+1); |
28 | 32 | } |