diff options
| author | lolcat <will@lolcat.ca> | 2025-08-10 17:22:58 -0400 |
|---|---|---|
| committer | lolcat <will@lolcat.ca> | 2025-08-10 17:22:58 -0400 |
| commit | 7c970031d06d8ec1addcb530dc71e2dc7da95178 (patch) | |
| tree | 75807cd674d8aaa2ef41905692cd0c5c82c75e3e | |
| parent | 2c2bd28a9ffbe6e55c9e6c1554f9c00f6bb31c3e (diff) | |
fix #2 for real this time
| -rw-r--r-- | lib/frontend.php | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/lib/frontend.php b/lib/frontend.php index 4b98849..9f819ba 100644 --- a/lib/frontend.php +++ b/lib/frontend.php @@ -402,24 +402,30 @@ class frontend{ $text = trim( - str_replace( - [ - "<br />", - " ", - "<pre>", - "</pre>" - ], - [ - "\n", - " ", - "", - "" - ], - explode( - "<?php", - highlight_string("<?php " . $text, true), - 2 - )[1] + preg_replace( + '/<code [^>]+>/', + "", + str_replace( + [ + "<br />", + " ", + "<pre>", + "</pre>", + "</code>" + ], + [ + "\n", + " ", + "", + "", + "" + ], + explode( + "<?php", + highlight_string("<?php " . $text, true), + 2 + )[1] + ) ) ); |
