@@ -14,13 +14,13 @@ |
||
14 | 14 | |
15 | 15 | class StandardXEquivTextToMateCatCustomPH extends AbstractHandler { |
16 | 16 | |
17 | - public function transform( $segment ) { |
|
17 | + public function transform($segment) { |
|
18 | 18 | |
19 | - preg_match_all( '|<x[^>]*?equiv-text="([^"]*?)"[^>]*?/>|', $segment, $xTags, PREG_SET_ORDER ); |
|
20 | - foreach ( $xTags as $group ) { |
|
19 | + preg_match_all('|<x[^>]*?equiv-text="([^"]*?)"[^>]*?/>|', $segment, $xTags, PREG_SET_ORDER); |
|
20 | + foreach ($xTags as $group) { |
|
21 | 21 | $segment = preg_replace( |
22 | - '/' . preg_quote( $group[ 0 ], '/' ) . '/', |
|
23 | - '<ph id="' . $this->getPipeline()->getNextId() . '" ctype="' . CTypeEnum::ORIGINAL_X . '" x-orig="' . base64_encode( $group[ 0 ] ) . '" equiv-text="base64:' . base64_encode( $group[ 1 ] ) . '"/>', |
|
22 | + '/'.preg_quote($group[0], '/').'/', |
|
23 | + '<ph id="'.$this->getPipeline()->getNextId().'" ctype="'.CTypeEnum::ORIGINAL_X.'" x-orig="'.base64_encode($group[0]).'" equiv-text="base64:'.base64_encode($group[1]).'"/>', |
|
24 | 24 | $segment, |
25 | 25 | 1 |
26 | 26 | ); |