From 10d8b352c16cc57ad318224a3e41902f8c77be27 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 13 Jun 2019 16:57:23 +0100 Subject: [PATCH 1/7] allow tags with apostrophes to be accelerated --- core/imageboard/image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/imageboard/image.php b/core/imageboard/image.php index 5d31ff90..79afc524 100644 --- a/core/imageboard/image.php +++ b/core/imageboard/image.php @@ -157,7 +157,7 @@ class Image $yays = 0; $nays = 0; foreach ($tags as $tag) { - if (!preg_match("/^-?[a-zA-Z0-9_-]+$/", $tag)) { + if (!preg_match("/^-?[a-zA-Z0-9_'-]+$/", $tag)) { return null; } if ($tag[0] == "-") { From 1d1536b1eeb8ea980c6a321400e755c8dd2d31bf Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 13 Jun 2019 16:57:58 +0100 Subject: [PATCH 2/7] assert_options is deprecated for php7 --- core/_install.php | 2 -- core/util.php | 16 ---------------- 2 files changed, 18 deletions(-) diff --git a/core/_install.php b/core/_install.php index 527708fa..dcc622be 100644 --- a/core/_install.php +++ b/core/_install.php @@ -56,8 +56,6 @@ date_default_timezone_set('UTC');
 ");
-    debug_print_backtrace();
-    print("
"); - */ -} - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * Request initialisation stuff * @@ -396,11 +385,6 @@ function _sanitise_environment(): void ini_set('assert.exception', 1); // throw exceptions when failed if (DEBUG) { error_reporting(E_ALL); - assert_options(ASSERT_ACTIVE, 1); - assert_options(ASSERT_BAIL, 1); - assert_options(ASSERT_WARNING, 0); - assert_options(ASSERT_QUIET_EVAL, 1); - assert_options(ASSERT_CALLBACK, 'score_assert_handler'); } $_shm_ctx = new Context(); From 68c3e5ea42a18891ddfddb5df20eb7bc15266bf9 Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Sun, 9 Jun 2019 14:17:13 -0500 Subject: [PATCH 3/7] Changed cron upload so that an unrecognised file type results in an error instead of a success --- ext/cron_uploader/main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/cron_uploader/main.php b/ext/cron_uploader/main.php index 6168e776..dbcf549c 100644 --- a/ext/cron_uploader/main.php +++ b/ext/cron_uploader/main.php @@ -339,7 +339,7 @@ class CronUploader extends Extension // Generate info message $infomsg = ""; // Will contain info message if ($event->image_id == -1) { - $infomsg = "File type not recognised. Filename: {$filename}"; + throw new Exception("File type not recognised. Filename: {$filename}"); } else { $infomsg = "Image uploaded. ID: {$event->image_id} - Filename: {$filename} - Tags: {$tags}"; } From 8cdab6623a9d754f9b692fb09749a257fcbd114d Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Tue, 11 Jun 2019 09:05:54 -0500 Subject: [PATCH 4/7] Changed clamp function to allow null values --- core/polyfills.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/polyfills.php b/core/polyfills.php index e543bb5a..9c6ccac8 100644 --- a/core/polyfills.php +++ b/core/polyfills.php @@ -507,7 +507,7 @@ function no_escape(string $input): string return $input; } -function clamp(int $val, int $min=null, int $max=null): int +function clamp(?int $val, ?int $min=null, ?int $max=null): int { if (!is_numeric($val) || (!is_null($min) && $val < $min)) { $val = $min; From 6006a83229e2ffbf7185e05224de48655b4fdf22 Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Tue, 11 Jun 2019 09:08:16 -0500 Subject: [PATCH 5/7] Added