From 86433b5d3b6cf2bf9b55e3874d4da5c53f6d2a52 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 5 Aug 2012 00:42:14 +0200 Subject: [PATCH 1/3] [ticket/10876] Revert "add newline after php tag"-regex back to 3.0 version The old regex just results in some additional new lines in the output. So this is only beautifying and considered unworthy in respect to the dying php servers we observed on windows. PHPBB3-10876 --- phpBB/includes/template/filter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/template/filter.php b/phpBB/includes/template/filter.php index ad2e35de6a..95a4ec5c76 100644 --- a/phpBB/includes/template/filter.php +++ b/phpBB/includes/template/filter.php @@ -209,7 +209,7 @@ class phpbb_template_filter extends php_user_filter */ - $data = preg_replace('~(?).)+(?)$~m', "$1\n", $data); + $data = preg_replace('#\?\>([\r\n])#', '?>\1\1', $data); $data = str_replace('/**/?>', "?>\n", $data); $data = str_replace('?> Date: Tue, 21 Aug 2012 11:41:27 +0200 Subject: [PATCH 2/3] [ticket/10876] Update regex to a version which still matches our tests PHPBB3-10876 --- phpBB/includes/template/filter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/template/filter.php b/phpBB/includes/template/filter.php index 95a4ec5c76..abee32c8f7 100644 --- a/phpBB/includes/template/filter.php +++ b/phpBB/includes/template/filter.php @@ -209,7 +209,7 @@ class phpbb_template_filter extends php_user_filter */ - $data = preg_replace('#\?\>([\r\n])#', '?>\1\1', $data); + $data = preg_replace('~(?)$~m', "$1\n", $data); $data = str_replace('/**/?>', "?>\n", $data); $data = str_replace('?> Date: Thu, 6 Sep 2012 18:27:49 -0500 Subject: [PATCH 3/3] [ticket/11092] phpbb_gen_download_links strict standards errors Two strict standards errors in phpbb_gen_download_links PHPBB3-11092 --- phpBB/includes/functions_compress.php | 4 +++- phpBB/includes/functions_display.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index 8e07e6d1b8..4675394633 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -159,8 +159,10 @@ class compress /** * Return available methods + * + * @return array Array of strings of available compression methods (.tar, .tar.gz, .zip, etc.) */ - function methods() + public static function methods() { $methods = array('.tar'); $available_methods = array('.tar.gz' => 'zlib', '.tar.bz2' => 'bz2', '.zip' => 'zlib'); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 881c95907b..8328b9ee7a 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1410,7 +1410,8 @@ function phpbb_gen_download_links($param_key, $param_val, $phpbb_root_path, $php foreach ($methods as $method) { - $type = array_pop(explode('.', $method)); + $exploded = explode('.', $method); + $type = array_pop($exploded); $params = array('archive' => $method); $params[$param_key] = $param_val;