From 25b3d36fe166053be8fd39cebccef5732d7f9f8a Mon Sep 17 00:00:00 2001 From: Roman Pronskiy Date: Fri, 20 Nov 2020 13:11:06 +0200 Subject: [PATCH] Add highlighting for code blocks --- include/layout.inc | 11 +++++++++++ releases/8_0_x.php | 10 ++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/layout.inc b/include/layout.inc index e994ebe91..9f2509b05 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -46,6 +46,17 @@ function highlight_php($code, $return = FALSE) else { echo $highlighted; } } +// Same as highlight_php() but does not require ')+/", '', $highlighted_code, 1); + + if ($return) { return $highlighted_code; } + else { echo $highlighted_code; } +} + // Stats pages still need this function commonHeader($title) { site_header($title); } diff --git a/releases/8_0_x.php b/releases/8_0_x.php index 8d8aff699..c22dc257f 100644 --- a/releases/8_0_x.php +++ b/releases/8_0_x.php @@ -46,14 +46,20 @@ site_header("PHP 8.0.0 Release Announcement", array(
PHP 7
-
htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
+
+ +
PHP 8
-
htmlspecialchars($string, double_encode: false);
+