File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -25,13 +25,11 @@ public function addValue(string $name, mixed $value): self {
2525 }
2626
2727 public function compile (): string {
28- if ( preg_match_all ('/{{([^.]+?)}}/ ' , $ this ->input , $ output ,
28+ while ( preg_match ('/{{([^.]+?)}}/ ' , $ this ->input , $ output ,
2929 PREG_OFFSET_CAPTURE )){
30- for ($ i = 0 , $ count = count ($ output [0 ]); $ i < $ count ; $ i ++){
31- $ this ->input = substr ($ this ->input , 0 , $ output [0 ][$ i ][1 ])
32- .exec ($ this , $ output [1 ][$ i ][0 ])
33- .substr ($ this ->input , $ output [0 ][$ i ][1 ]+$ output [1 ][$ i ][1 ], strlen ($ this ->input ));
34- }
30+ $ this ->input = substr ($ this ->input , 0 , $ output [0 ][1 ])
31+ .exec ($ this , $ output [1 ][0 ])
32+ .substr ($ this ->input , $ output [0 ][1 ]+strlen ($ output [0 ][0 ]), strlen ($ this ->input ));
3533 }
3634
3735 return $ this ->input ;
You can’t perform that action at this time.
0 commit comments