Ver código fonte

fix #2 for real this time

lolcat 11 meses atrás
pai
commit
7c970031d0
1 arquivos alterados com 24 adições e 18 exclusões
  1. 24 18
      lib/frontend.php

+ 24 - 18
lib/frontend.php

@@ -402,24 +402,30 @@ class frontend{
 		
 		$text =
 			trim(
-				str_replace(
-					[
-						"<br />",
-						"&nbsp;",
-						"<pre>",
-						"</pre>"
-					],
-					[
-						"\n",
-						" ",
-						"",
-						""
-					],
-					explode(
-						"&lt;?php",
-						highlight_string("<?php " . $text, true),
-						2
-					)[1]
+				preg_replace(
+					'/<code [^>]+>/',
+					"",
+					str_replace(
+						[
+							"<br />",
+							"&nbsp;",
+							"<pre>",
+							"</pre>",
+							"</code>"
+						],
+						[
+							"\n",
+							" ",
+							"",
+							"",
+							""
+						],
+						explode(
+							"&lt;?php",
+							highlight_string("<?php " . $text, true),
+							2
+						)[1]
+					)
 				)
 			);