@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | // if this is not a standard Response, return right away |
| 29 | - if(!$response instanceof Response) { |
|
| 29 | + if (!$response instanceof Response) { |
|
| 30 | 30 | return $response; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | private function replaceShortcodes($html) |
| 44 | 44 | { |
| 45 | 45 | preg_match_all('/\[\[BLOCK\((.*)\)\]\]/U', $html, $matches); |
| 46 | - $replaceBlocks = []; |
|
| 47 | - foreach ($matches[1] as $blockIndex => $blockName) { |
|
| 46 | + $replaceBlocks = [ ]; |
|
| 47 | + foreach ($matches[ 1 ] as $blockIndex => $blockName) { |
|
| 48 | 48 | // prevent loading same block twice |
| 49 | - if (isset($replaceBlocks[$matches[0][$blockIndex]])) { |
|
| 49 | + if (isset($replaceBlocks[ $matches[ 0 ][ $blockIndex ] ])) { |
|
| 50 | 50 | continue; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $replaceBlocks[$matches[0][$blockIndex]] = $this->blockRepository->get($blockName); |
|
| 53 | + $replaceBlocks[ $matches[ 0 ][ $blockIndex ] ] = $this->blockRepository->get($blockName); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return str_replace(array_keys($replaceBlocks), $replaceBlocks, $html); |