| Conditions | 7 | 
| Paths | 24 | 
| Total Lines | 26 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 19 | public function filter($value) | ||
| 20 |     { | ||
| 21 |         if (!$this->getAllowMultibyte()) { | ||
| 22 | $transliterator = $this->getTransliterator(); | ||
| 23 | |||
| 24 |             if ($transliterator) { | ||
| 25 | $value = $transliterator->toASCII($value); | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | $replacements = $this->getReplacements(); | ||
| 30 | |||
| 31 |         if ($this->getAllowMultibyte() && isset($replacements['/[^A-Za-z0-9\-]+/u'])) { | ||
| 32 | unset($replacements['/[^A-Za-z0-9\-]+/u']); | ||
| 33 | } | ||
| 34 | |||
| 35 |         foreach ($replacements as $regex => $replace) { | ||
| 36 | $value = preg_replace($regex, $replace, $value); | ||
| 37 | } | ||
| 38 | |||
| 39 |         if ($this->getAllowMultibyte()) { | ||
| 40 | $value = rawurlencode($value); | ||
| 41 | } | ||
| 42 | |||
| 43 | return $value; | ||
| 44 | } | ||
| 45 | } | ||
| 46 |