From 42135d048e5e6f31532066fbb6fb32d2226d1a5c Mon Sep 17 00:00:00 2001 From: notfire Date: Sun, 9 Mar 2025 21:12:54 -0400 Subject: [PATCH] add gallery3 downloadalbum module fix for php8 --- patches/gallery3-downloadalbum-php8-fix.patch | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 patches/gallery3-downloadalbum-php8-fix.patch diff --git a/patches/gallery3-downloadalbum-php8-fix.patch b/patches/gallery3-downloadalbum-php8-fix.patch new file mode 100644 index 0000000..7439eba --- /dev/null +++ b/patches/gallery3-downloadalbum-php8-fix.patch @@ -0,0 +1,29 @@ +# for use with https://github.com/gallery/gallery3-contrib +diff --git a/3.0/modules/downloadalbum/controllers/downloadalbum.php b/3.0/modules/downloadalbum/controllers/downloadalbum.php +index fd70c9e3..dde7db7c 100644 +--- a/3.0/modules/downloadalbum/controllers/downloadalbum.php ++++ b/3.0/modules/downloadalbum/controllers/downloadalbum.php +@@ -220,7 +220,7 @@ class downloadalbum_Controller extends Controller { + ob_end_clean(); + } + // Clear any output +- Event::add('system.display', create_function('', 'Kohana::$output = "";')); ++ //Event::add('system.display', create_function('', 'Kohana::$output = "";')); + } + + /** +@@ -292,10 +292,10 @@ class downloadalbum_Controller extends Controller { + private function fixBug45028($hash) { + $output = $hash; + +- if( version_compare(PHP_VERSION, '5.2.7', '<') ) { +- $str = str_pad(dechex($hash), 8, '0', STR_PAD_LEFT); +- $output = hexdec($str{6}.$str{7}.$str{4}.$str{5}.$str{2}.$str{3}.$str{0}.$str{1}); +- } ++ //if( version_compare(PHP_VERSION, '5.2.7', '<') ) { ++ // $str = str_pad(dechex($hash), 8, '0', STR_PAD_LEFT); ++ // $output = hexdec($str{6}.$str{7}.$str{4}.$str{5}.$str{2}.$str{3}.$str{0}.$str{1}); ++ //} + + return $output; + }