mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-03 18:12:40 +00:00
Make formatting tag removal smarter.
Instead of removing all tags, only known formatting tags. Fixes #2203
This commit is contained in:
parent
18a34c03a4
commit
98a8f44fa7
2 changed files with 15 additions and 1 deletions
|
@ -178,7 +178,8 @@ class ConsoleOutput {
|
|||
return $text;
|
||||
}
|
||||
if ($this->_outputAs == self::PLAIN) {
|
||||
return strip_tags($text);
|
||||
$tags = implode('|', array_keys(self::$_styles));
|
||||
return preg_replace('#</?(?:' . $tags . ')>#', '', $text);
|
||||
}
|
||||
return preg_replace_callback(
|
||||
'/<(?<tag>[a-z0-9-_]+)>(?<text>.*?)<\/(\1)>/ims', array($this, '_replaceTags'), $text
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue