summaryrefslogtreecommitdiff
path: root/www-apps/gallery/files
diff options
context:
space:
mode:
authorMarcin Deranek <marcin.deranek@slonko.net>2018-06-09 09:10:42 +0200
committerMarcin Deranek <marcin.deranek@slonko.net>2018-06-09 09:10:42 +0200
commitbd074a594f8cc116e52b486f89de86cc1e656b9f (patch)
tree6f2b18f5cb13101d63d5eb38d83fbe1e7c61cbbd /www-apps/gallery/files
parent0f3704a87c67bbc2dfed0175445a865b8b0cf3ec (diff)
downloadportage-bd074a594f8cc116e52b486f89de86cc1e656b9f.tar.gz
portage-bd074a594f8cc116e52b486f89de86cc1e656b9f.tar.bz2
portage-bd074a594f8cc116e52b486f89de86cc1e656b9f.zip
Gallery2 with latest PHP 7.x patches
Diffstat (limited to 'www-apps/gallery/files')
-rw-r--r--www-apps/gallery/files/0001-Fixing-PHP-7-issues.patch625
-rw-r--r--www-apps/gallery/files/0002-Adding-more-static-s-to-get-rid-of-PHP-7-warnings.patch179
2 files changed, 0 insertions, 804 deletions
diff --git a/www-apps/gallery/files/0001-Fixing-PHP-7-issues.patch b/www-apps/gallery/files/0001-Fixing-PHP-7-issues.patch
deleted file mode 100644
index 43f047c..0000000
--- a/www-apps/gallery/files/0001-Fixing-PHP-7-issues.patch
+++ /dev/null
@@ -1,625 +0,0 @@
-From b180528e518ecd35c8f47e301db8d816f3ed480d Mon Sep 17 00:00:00 2001
-From: Greg Stoll <greg@gregstoll.com>
-Date: Tue, 28 Mar 2017 15:17:53 -0500
-Subject: [PATCH 1/2] Fixing PHP 7 issues
-
-The real fixes are replacing uses of preg_replace with the 'e' mode with
-preg_replace_callback and the change to
-modules/core/clases/GalleryStorage/GalleryStorageExtras to add {}. The
-rest is just declaring functions static to avoid noisy warning messages,
-but there are plenty more that could be added.
----
- .gitignore | 3 ++
- lib/adodb/adodb-time.inc.php | 1 -
- lib/adodb/adodb.inc.php | 2 +-
- lib/bbcode/stringparser.class.php | 2 +-
- lib/smarty/Smarty_Compiler.class.php | 12 ++++-
- lib/support/GallerySetupUtilities.class | 26 +++++-----
- modules/core/classes/GalleryCoreApi.class | 16 +++---
- modules/core/classes/GalleryDataCache.class | 16 +++---
- .../GalleryStorage/GalleryStorageExtras.class | 2 +-
- modules/core/classes/GalleryUtilities.class | 59 ++++++++++++----------
- 10 files changed, 77 insertions(+), 62 deletions(-)
- create mode 100644 .gitignore
-
-diff --git a/.gitignore b/.gitignore
-new file mode 100644
-index 0000000..3503017
---- /dev/null
-+++ b/.gitignore
-@@ -0,0 +1,3 @@
-+config.php
-+login.txt
-+*.swp
-diff --git a/lib/adodb/adodb-time.inc.php b/lib/adodb/adodb-time.inc.php
-index 575578c..eb6c415 100644
---- a/lib/adodb/adodb-time.inc.php
-+++ b/lib/adodb/adodb-time.inc.php
-@@ -1006,7 +1006,6 @@ function adodb_tz_offset($gmt,$isphp5)
- return sprintf('%s%02d%02d',($gmt<=0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60);
- else
- return sprintf('%s%02d%02d',($gmt<0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60);
-- break;
- }
-
-
-diff --git a/lib/adodb/adodb.inc.php b/lib/adodb/adodb.inc.php
-index 092e46e..2ff4486 100644
---- a/lib/adodb/adodb.inc.php
-+++ b/lib/adodb/adodb.inc.php
-@@ -373,7 +373,7 @@
- * All error messages go through this bottleneck function.
- * You can define your own handler by defining the function name in ADODB_OUTP.
- */
-- function outp($msg,$newline=true)
-+ static function outp($msg,$newline=true)
- {
- global $ADODB_FLUSH,$ADODB_OUTP;
-
-diff --git a/lib/bbcode/stringparser.class.php b/lib/bbcode/stringparser.class.php
-index 46f78f3..b0a0619 100644
---- a/lib/bbcode/stringparser.class.php
-+++ b/lib/bbcode/stringparser.class.php
-@@ -1248,7 +1248,7 @@ class StringParser_Node {
- * @param object $node The node to destroy
- * @return bool True on success, else false.
- */
-- function destroyNode (&$node) {
-+ static function destroyNode (&$node) {
- if ($node === null) {
- return false;
- }
-diff --git a/lib/smarty/Smarty_Compiler.class.php b/lib/smarty/Smarty_Compiler.class.php
-index f09f8de..a62c624 100644
---- a/lib/smarty/Smarty_Compiler.class.php
-+++ b/lib/smarty/Smarty_Compiler.class.php
-@@ -262,12 +262,20 @@ class Smarty_Compiler extends Smarty {
- reset($this->_folded_blocks);
-
- /* replace special blocks by "{php}" */
-- $source_content = preg_replace($search.'e', "'"
-+ $source_content = preg_replace_callback($search,
-+ function($matches) {
-+ return $this->_quote_replace($this->left_delimiter) . 'php'
-+ . str_repeat("\n", substr_count($matches[0], "\n"))
-+ . $this->_quote_replace($this->right_delimiter);
-+ }
-+ , $source_content);
-+
-+ /*$source_content = preg_replace($search.'e', "'"
- . $this->_quote_replace($this->left_delimiter) . 'php'
- . "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'"
- . $this->_quote_replace($this->right_delimiter)
- . "'"
-- , $source_content);
-+ , $source_content);*/
-
- /* Gather all template tags. */
- preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match);
-diff --git a/lib/support/GallerySetupUtilities.class b/lib/support/GallerySetupUtilities.class
-index 6a6da7b..4f8cc7e 100644
---- a/lib/support/GallerySetupUtilities.class
-+++ b/lib/support/GallerySetupUtilities.class
-@@ -54,7 +54,7 @@ class GallerySetupUtilities {
- *
- * @static
- */
-- function regenerateSession() {
-+ static function regenerateSession() {
- /* 1. Generate a new session id */
- $newSessionId = md5(uniqid(substr(rand() . serialize($_REQUEST), 0, 114)));
- $sessionData = array();
-@@ -84,7 +84,7 @@ class GallerySetupUtilities {
- *
- * @static
- */
-- function areCookiesSupported() {
-+ static function areCookiesSupported() {
- static $areCookiesSupported;
-
- /* Remember the state since we might unset $_COOKIE */
-@@ -101,7 +101,7 @@ class GallerySetupUtilities {
- * @return int the number of attempts or false if there was an error
- * @static
- */
-- function getLoginAttempts() {
-+ static function getLoginAttempts() {
- /* Init if needed (like from lib/support; upgrader already init'ed) */
- global $gallery;
- if (!isset($gallery)) {
-@@ -139,7 +139,7 @@ class GallerySetupUtilities {
- * @return true on success, false on error
- * @static
- */
-- function setLoginAttempts($attempts) {
-+ static function setLoginAttempts($attempts) {
- /* Init if needed (like from lib/support; upgrader already init'ed) */
- global $gallery;
- if (!isset($gallery)) {
-@@ -182,7 +182,7 @@ class GallerySetupUtilities {
- * @param bool $updateDatabase true if you want to also reset the login attempts (default: true)
- * @static
- */
-- function authenticateThisSession($resetLoginAttempts=true) {
-+ static function authenticateThisSession($resetLoginAttempts=true) {
- $_SESSION['authenticated'] = true;
- if ($resetLoginAttempts) {
- GallerySetupUtilities::setLoginAttempts(0);
-@@ -196,7 +196,7 @@ class GallerySetupUtilities {
- * @return true if this session is authenticated
- * @static
- */
-- function isSessionAuthenticated() {
-+ static function isSessionAuthenticated() {
- return !empty($_SESSION['authenticated']);
- }
-
-@@ -205,7 +205,7 @@ class GallerySetupUtilities {
- *
- * @static
- */
-- function redirectBackToSelf() {
-+ static function redirectBackToSelf() {
- require_once(dirname(__FILE__) . '/../../modules/core/classes/GalleryUrlGenerator.class');
- $urlGenerator = new GalleryUrlGenerator();
- $url = $urlGenerator->getCurrentUrl();
-@@ -224,7 +224,7 @@ class GallerySetupUtilities {
- * @return string the path to the config dir
- * @static
- */
-- function getConfigDir() {
-+ static function getConfigDir() {
- if (defined('GALLERY_CONFIG_DIR')) {
- return GALLERY_CONFIG_DIR;
- }
-@@ -237,7 +237,7 @@ class GallerySetupUtilities {
- * @return array the config values from config.php
- * @static
- */
-- function getGalleryConfig() {
-+ static function getGalleryConfig() {
- $gallery = new GallerySetupUtilitiesStub();
-
- /* Load config.php */
-@@ -256,7 +256,7 @@ class GallerySetupUtilities {
- * @return string the authentication key
- * @static
- */
-- function getAuthenticationKey() {
-+ static function getAuthenticationKey() {
- return isset($_SESSION['authKey']) ? $_SESSION['authKey'] : null;
- }
-
-@@ -265,7 +265,7 @@ class GallerySetupUtilities {
- * @param string $key the authentication key
- * @static
- */
-- function setAuthenticationKey($key) {
-+ static function setAuthenticationKey($key) {
- $_SESSION['authKey'] = $key;
- }
-
-@@ -274,7 +274,7 @@ class GallerySetupUtilities {
- * @param string a random value
- * @static
- */
-- function generateAuthenticationKey() {
-+ static function generateAuthenticationKey() {
- for ($len = 64, $rand='';
- strlen($rand) < $len;
- $rand .= chr(!mt_rand(0,2) ? mt_rand(48,57) :
-@@ -308,7 +308,7 @@ class GallerySetupUtilities {
- *
- * @static
- */
-- function startSession() {
-+ static function startSession() {
- /* Set our own session name */
- if (@ini_get('session.auto_start')) {
- session_unset();
-diff --git a/modules/core/classes/GalleryCoreApi.class b/modules/core/classes/GalleryCoreApi.class
-index 6edcdf4..27d5b20 100644
---- a/modules/core/classes/GalleryCoreApi.class
-+++ b/modules/core/classes/GalleryCoreApi.class
-@@ -295,7 +295,7 @@ class GalleryCoreApi {
- * @return array GalleryStatus a status code
- * string a value
- */
-- function getPluginParameter($pluginType, $pluginId, $parameterName, $itemId=0) {
-+ static function getPluginParameter($pluginType, $pluginId, $parameterName, $itemId=0) {
- GalleryCoreApi::requireOnce(
- 'modules/core/classes/helpers/GalleryPluginHelper_simple.class');
- return GalleryPluginHelper_simple::getParameter($pluginType, $pluginId,
-@@ -363,7 +363,7 @@ class GalleryCoreApi {
- * 'requiredModuleApi' => array,
- * 'version' => string)
- */
-- function fetchPluginStatus($pluginType, $ignoreCache=false) {
-+ static function fetchPluginStatus($pluginType, $ignoreCache=false) {
- GalleryCoreApi::requireOnce(
- 'modules/core/classes/helpers/GalleryPluginHelper_simple.class');
- return GalleryPluginHelper_simple::fetchPluginStatus($pluginType, $ignoreCache);
-@@ -376,7 +376,7 @@ class GalleryCoreApi {
- * @return array GalleryStatus a status code
- * array of (pluginId => ('active' => boolean))
- */
-- function fetchPluginList($pluginType) {
-+ static function fetchPluginList($pluginType) {
- GalleryCoreApi::requireOnce(
- 'modules/core/classes/helpers/GalleryPluginHelper_simple.class');
- return GalleryPluginHelper_simple::fetchPluginList($pluginType);
-@@ -2355,7 +2355,7 @@ class GalleryCoreApi {
- * mixed one GalleryEntity or an array of GalleryEntities
- * @deprecated $requiredEntityType will no longer be optional after the next major API change
- */
-- function loadEntitiesById($ids, $requiredEntityType=null) {
-+ static function loadEntitiesById($ids, $requiredEntityType=null) {
- GalleryCoreApi::requireOnce(
- 'modules/core/classes/helpers/GalleryEntityHelper_simple.class');
- return GalleryEntityHelper_simple::loadEntitiesById($ids, $requiredEntityType);
-@@ -2708,7 +2708,7 @@ class GalleryCoreApi {
- * @param string $sourceEncoding source encoding (eg. 'ISO-8859-1'), defaults to system charset
- * @return string the result
- */
-- function convertToUtf8($inputString, $sourceEncoding=null) {
-+ static function convertToUtf8($inputString, $sourceEncoding=null) {
- GalleryCoreApi::requireOnce(
- 'modules/core/classes/helpers/GalleryCharsetHelper_simple.class');
- return GalleryCharsetHelper_simple::convertToUtf8($inputString, $sourceEncoding);
-@@ -2734,7 +2734,7 @@ class GalleryCoreApi {
- * @param int $length the length of the substring, not optional
- * @return string a multibyte safe substring of input value
- */
-- function utf8Substring($string, $start, $length) {
-+ static function utf8Substring($string, $start, $length) {
- GalleryCoreApi::requireOnce(
- 'modules/core/classes/helpers/GalleryCharsetHelper_simple.class');
- return GalleryCharsetHelper_simple::utf8Substring($string, $start, $length);
-@@ -2747,7 +2747,7 @@ class GalleryCoreApi {
- * @param int $length the length in bytes (not in characters), not optional
- * @return string a multibyte safe substring of input value
- */
-- function utf8Strcut($string, $start, $length) {
-+ static function utf8Strcut($string, $start, $length) {
- GalleryCoreApi::requireOnce(
- 'modules/core/classes/helpers/GalleryCharsetHelper_simple.class');
- return GalleryCharsetHelper_simple::utf8Strcut($string, $start, $length);
-@@ -2817,7 +2817,7 @@ class GalleryCoreApi {
- * @param string $file
- * @param boolean $skipBaseDirectoryDetection deprecated
- */
-- function requireOnce($file, $skipBaseDirectoryDetection=false) {
-+ static function requireOnce($file, $skipBaseDirectoryDetection=false) {
- static $loaded;
- if (!isset($loaded[$file])) {
- $loaded[$file] = 1;
-diff --git a/modules/core/classes/GalleryDataCache.class b/modules/core/classes/GalleryDataCache.class
-index 07f26f4..dd6d5ec 100644
---- a/modules/core/classes/GalleryDataCache.class
-+++ b/modules/core/classes/GalleryDataCache.class
-@@ -40,7 +40,7 @@ class GalleryDataCache {
- * @staticvar cache the singleton cache
- * @access private
- */
-- function &_getCache() {
-+ static function &_getCache() {
- static $cache;
- if (!isset($cache)) {
- $cache['maxKeys'] = 800;
-@@ -81,7 +81,7 @@ class GalleryDataCache {
- * @param mixed $data
- * @param boolean $protected should this key survive a reset call?
- */
-- function put($key, $data, $protected=false) {
-+ static function put($key, $data, $protected=false) {
- $cache =& GalleryDataCache::_getCache();
- if (!$cache['memoryCacheEnabled']) {
- return;
-@@ -182,7 +182,7 @@ class GalleryDataCache {
- * @param string $key
- * @return mixed the cached data
- */
-- function get($key) {
-+ static function get($key) {
- $cache =& GalleryDataCache::_getCache();
- if (!$cache['memoryCacheEnabled']) {
- return null;
-@@ -199,7 +199,7 @@ class GalleryDataCache {
- * @param string $key
- * @return boolean true if the cache contains the key given
- */
-- function containsKey($key) {
-+ static function containsKey($key) {
- $cache =& GalleryDataCache::_getCache();
- if (!$cache['memoryCacheEnabled']) {
- return false;
-@@ -268,7 +268,7 @@ class GalleryDataCache {
- * @param array $pathInfo the path info
- * @return mixed object data
- */
-- function &getFromDisk($pathInfo) {
-+ static function &getFromDisk($pathInfo) {
- $null = null;
- $cache =& GalleryDataCache::_getCache();
- if (!$cache['fileCacheEnabled']) {
-@@ -341,7 +341,7 @@ class GalleryDataCache {
- * @param array $requiredClasses classes that must be loaded in order to retrieve this data
- * @see GalleryDataCache::getCachePath
- */
-- function putToDisk($pathInfo, &$data, $requiredClasses=array()) {
-+ static function putToDisk($pathInfo, &$data, $requiredClasses=array()) {
- $cache =& GalleryDataCache::_getCache();
- if (!$cache['fileCacheEnabled']) {
- return;
-@@ -373,7 +373,7 @@ class GalleryDataCache {
- * @param int $id
- * @return array the tuple
- */
-- function getCacheTuple($id) {
-+ static function getCacheTuple($id) {
- $id = "$id";
- if ($id > 100) {
- return array($id[0], $id[1]);
-@@ -395,7 +395,7 @@ class GalleryDataCache {
- *
- * @return string the path
- */
-- function getCachePath($pathInfo) {
-+ static function getCachePath($pathInfo) {
- global $gallery;
-
- $base = $gallery->getConfig('data.gallery.cache');
-diff --git a/modules/core/classes/GalleryStorage/GalleryStorageExtras.class b/modules/core/classes/GalleryStorage/GalleryStorageExtras.class
-index 9a12ecd..9214b8c 100644
---- a/modules/core/classes/GalleryStorage/GalleryStorageExtras.class
-+++ b/modules/core/classes/GalleryStorage/GalleryStorageExtras.class
-@@ -190,7 +190,7 @@ class GalleryStorageExtras /* the other half of GalleryStorage */ {
- $value = $this->_gs->_normalizeValue($row[$i], $memberData[$i], true);
-
- /* Store the value in the object */
-- $entity->$callbacks[$i] = $value;
-+ $entity->{$callbacks[$i]} = $value;
- $entity->_persistentStatus['originalValue'][$callbacks[$i]] = $value;
- }
-
-diff --git a/modules/core/classes/GalleryUtilities.class b/modules/core/classes/GalleryUtilities.class
-index 0e394fa..eeae67d 100644
---- a/modules/core/classes/GalleryUtilities.class
-+++ b/modules/core/classes/GalleryUtilities.class
-@@ -43,7 +43,7 @@ class GalleryUtilities {
- * @param string $filename
- * @return array the file basename, the file extension
- */
-- function getFileNameComponents($filename) {
-+ static function getFileNameComponents($filename) {
-
- $pos = strrpos($filename, '.');
-
-@@ -69,7 +69,7 @@ class GalleryUtilities {
- * @param string $filename
- * @return array the file extension
- */
-- function getFileExtension($filename) {
-+ static function getFileExtension($filename) {
- list ($base, $extension) = GalleryUtilities::getFileNameComponents($filename);
- return $extension;
- }
-@@ -81,7 +81,7 @@ class GalleryUtilities {
- * @param string $filename
- * @return array the file base
- */
-- function getFileBase($filename) {
-+ static function getFileBase($filename) {
- list ($base, $extension) = GalleryUtilities::getFileNameComponents($filename);
- return $base;
- }
-@@ -92,7 +92,7 @@ class GalleryUtilities {
- * @param boolean $prefix (optional) false to omit Gallery variable prefix (not recommended)
- * @return array file data
- */
-- function getFile($key, $prefix=true) {
-+ static function getFile($key, $prefix=true) {
- $file = array();
- if ($prefix) {
- $key = GALLERY_FORM_VARIABLE_PREFIX . $key;
-@@ -235,7 +235,7 @@ class GalleryUtilities {
- * @param one or more string parameters
- * @return mixed a single string value or many values
- */
-- function getRequestVariables() {
-+ static function getRequestVariables() {
- $values = array();
- foreach (func_get_args() as $argName) {
- $values[] = GalleryUtilities::_getRequestVariable(
-@@ -255,7 +255,7 @@ class GalleryUtilities {
- * Return all request variables with the Gallery variable prefix.
- * @return array request variable name => value
- */
-- function getAllRequestVariables() {
-+ static function getAllRequestVariables() {
- $values = array();
- $prefixLength = strlen(GALLERY_FORM_VARIABLE_PREFIX);
- foreach ($_POST as $key => $value) {
-@@ -283,7 +283,7 @@ class GalleryUtilities {
- * @param one or more string parameters
- * @return mixed a single string value or many values
- */
-- function getRequestVariablesNoPrefix() {
-+ static function getRequestVariablesNoPrefix() {
- $values = array();
- foreach (func_get_args() as $argName) {
- $values[] = GalleryUtilities::_getRequestVariable($argName);
-@@ -304,7 +304,7 @@ class GalleryUtilities {
- * @param string $value
- * @param boolean $prefix (optional) false to omit Gallery variable prefix (not recommended)
- */
-- function putRequestVariable($key, $value, $prefix=true) {
-+ static function putRequestVariable($key, $value, $prefix=true) {
- if ($prefix) {
- $key = GALLERY_FORM_VARIABLE_PREFIX . $key;
- }
-@@ -373,7 +373,7 @@ class GalleryUtilities {
- * @param array $array the source
- * @access private
- */
-- function _internalRemoveRequestVariable($keyPath, &$array) {
-+ static function _internalRemoveRequestVariable($keyPath, &$array) {
- $key = array_shift($keyPath);
- while (!empty($keyPath)) {
- if (empty($array[$key])) {
-@@ -401,7 +401,7 @@ class GalleryUtilities {
- * @param int $count the number of markers to return
- * @return string
- */
-- function makeMarkers($count, $markerFragment='?') {
-+ static function makeMarkers($count, $markerFragment='?') {
- if (is_array($count)) {
- $count = count($count);
- }
-@@ -427,7 +427,7 @@ class GalleryUtilities {
- * @param array $options (optional) options to pass to UrlGenerator
- * @return string a URL
- */
-- function convertPathToUrl($path, $options=array()) {
-+ static function convertPathToUrl($path, $options=array()) {
- global $gallery;
- $platform =& $gallery->getPlatform();
- $dirbase = $platform->realpath(dirname(__FILE__) . '/../../..') . '/';
-@@ -458,7 +458,7 @@ class GalleryUtilities {
- * @param int $targetHeight (optional) target height, defaults to same as width
- * @return array(width, height)
- */
-- function shrinkDimensionsToFit($width, $height, $targetWidth, $targetHeight=null) {
-+ static function shrinkDimensionsToFit($width, $height, $targetWidth, $targetHeight=null) {
- if (!isset($targetHeight)) {
- $targetHeight = $targetWidth;
- }
-@@ -499,7 +499,7 @@ class GalleryUtilities {
- * @param int $precision defaults to zero
- * @return string rounded value
- */
-- function roundToString($floatValue, $precision=0) {
-+ static function roundToString($floatValue, $precision=0) {
- return str_replace(',', '.', round($floatValue, $precision));
- }
-
-@@ -701,7 +701,7 @@ class GalleryUtilities {
- * @param boolean $adaptForMagicQuotes (optional) false to skip undoing the damage caused
- * by magic_quotes
- */
-- function sanitizeInputValues(&$value, $adaptForMagicQuotes=true) {
-+ static function sanitizeInputValues(&$value, $adaptForMagicQuotes=true) {
- if (is_array($value)) {
- foreach (array_keys($value) as $key) {
- $newKey = $key;
-@@ -739,7 +739,7 @@ class GalleryUtilities {
- * @param boolean $adaptForMagicQuotes (optional) false to skip redoing the damage caused
- * by magic_quotes
- */
-- function unsanitizeInputValues(&$value, $adaptForMagicQuotes=true) {
-+ static function unsanitizeInputValues(&$value, $adaptForMagicQuotes=true) {
- if (is_array($value)) {
- foreach (array_keys($value) as $key) {
- GalleryUtilities::unsanitizeInputValues($value[$key], $adaptForMagicQuotes);
-@@ -763,9 +763,14 @@ class GalleryUtilities {
- * @param string $string the input string with UTF-8 entities
- * @return string the UTF-8 string
- */
-- function unicodeEntitiesToUtf8($string) {
-- $string = preg_replace('/&#([xa-f\d]+);/mei',
-- "GalleryUtilities::unicodeValueToUtf8Value('\\1')", $string);
-+ static function unicodeEntitiesToUtf8($string) {
-+ $string = preg_replace_callback('/&#([xa-f\d]+);/mi',
-+ function($matches) {
-+ return GalleryUtilities::unicodeValueToUtf8Value($matches[1]);
-+ }
-+ , $string);
-+ /*$string = preg_replace('/&#([xa-f\d]+);/mei',
-+ "GalleryUtilities::unicodeValueToUtf8Value('\\1')", $string);*/
- return $string;
- }
-
-@@ -777,7 +782,7 @@ class GalleryUtilities {
- * @return string a multibyte safe substring of input value
- * @deprecated Please use GalleryCoreApi::utf8Substring instead
- */
-- function utf8Substring($string, $start, $length) {
-+ static function utf8Substring($string, $start, $length) {
- return GalleryCoreApi::utf8Substring($string, $start, $length);
- }
-
-@@ -788,7 +793,7 @@ class GalleryUtilities {
- * @param int $num the unicode value
- * @return string the UTF-8 string
- */
-- function unicodeValueToUtf8Value($num) {
-+ static function unicodeValueToUtf8Value($num) {
- if ($num[0] == 'x') {
- /* Convert hex to decimal */
- $num = hexdec(substr($num, 1));
-@@ -870,7 +875,7 @@ class GalleryUtilities {
- * @return string a single value
- * @access private
- */
-- function _getRequestVariable($key) {
-+ static function _getRequestVariable($key) {
- $keyPath = preg_split('/[\[\]]/', $key, -1, PREG_SPLIT_NO_EMPTY);
- $result = GalleryUtilities::_internalGetRequestVariable($keyPath, $_GET);
- if (isset($result)) {
-@@ -889,7 +894,7 @@ class GalleryUtilities {
- * @return the value or null if it does not exist
- * @access private
- */
-- function _internalGetRequestVariable($keyPath, $array) {
-+ static function _internalGetRequestVariable($keyPath, $array) {
- $key = array_shift($keyPath);
- while (!empty($keyPath)) {
- if (!isset($array[$key])) {
-@@ -1001,7 +1006,7 @@ class GalleryUtilities {
- * Return the address of the remote host.
- * @return string the remote host address (or null)
- */
-- function getRemoteHostAddress() {
-+ static function getRemoteHostAddress() {
- $addr = null;
- if (isset($_SERVER['REMOTE_ADDR'])) {
- $addr = $_SERVER['REMOTE_ADDR'];
-@@ -1399,7 +1404,7 @@ class GalleryUtilities {
- * @param string $key the key in the _SERVER superglobal
- * @return string the value
- */
-- function getServerVar($key) {
-+ static function getServerVar($key) {
- if (!isset($_SERVER[$key])) {
- return null;
- }
-@@ -1432,7 +1437,7 @@ class GalleryUtilities {
- * @see Gallery::isEmbedded
- * @deprecated
- */
-- function isEmbedded() {
-+ static function isEmbedded() {
- global $gallery;
- return $gallery->isEmbedded();
- }
-@@ -1617,7 +1622,7 @@ class GalleryUtilities {
- * @param string $string
- * @return string lowercase version of the string
- */
-- function strToLower($string) {
-+ static function strToLower($string) {
- return strtr($string, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
- }
-
-@@ -1626,7 +1631,7 @@ class GalleryUtilities {
- * @param string $string
- * @return string uppercase version of the string
- */
-- function strToUpper($string) {
-+ static function strToUpper($string) {
- return strtr($string, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
- }
-
---
-2.13.1
-
diff --git a/www-apps/gallery/files/0002-Adding-more-static-s-to-get-rid-of-PHP-7-warnings.patch b/www-apps/gallery/files/0002-Adding-more-static-s-to-get-rid-of-PHP-7-warnings.patch
deleted file mode 100644
index 2c95ea1..0000000
--- a/www-apps/gallery/files/0002-Adding-more-static-s-to-get-rid-of-PHP-7-warnings.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-From 046cf868770c79156d9dd8af070ac894a0eca0e6 Mon Sep 17 00:00:00 2001
-From: Greg Stoll <greg@gregstoll.com>
-Date: Sun, 2 Apr 2017 16:07:20 -0500
-Subject: [PATCH 2/2] Adding more "static"s to get rid of PHP 7 warnings
-
----
- modules/core/classes/GalleryCoreApi.class | 8 ++++----
- modules/core/classes/GalleryUtilities.class | 20 ++++++++++----------
- .../classes/helpers/GalleryPluginHelper_simple.class | 6 +++---
- 3 files changed, 17 insertions(+), 17 deletions(-)
-
-diff --git a/modules/core/classes/GalleryCoreApi.class b/modules/core/classes/GalleryCoreApi.class
-index 27d5b20..f2d6e83 100644
---- a/modules/core/classes/GalleryCoreApi.class
-+++ b/modules/core/classes/GalleryCoreApi.class
-@@ -265,7 +265,7 @@ class GalleryCoreApi {
- * @return array GalleryStatus a status code
- * object the plugin
- */
-- function loadPlugin($pluginType, $pluginId, $ignoreVersionMismatch=false,
-+ static function loadPlugin($pluginType, $pluginId, $ignoreVersionMismatch=false,
- $errorOnVersionMismatch=false) {
- GalleryCoreApi::requireOnce(
- 'modules/core/classes/helpers/GalleryPluginHelper_simple.class');
-@@ -2857,7 +2857,7 @@ class GalleryCoreApi {
- * @param string $errorMessage
- * @return GalleryStatus an error status
- */
-- function error($errorCode, $fileName='ignored', $lineNumber='ignored', $errorMessage=null) {
-+ static function error($errorCode, $fileName='ignored', $lineNumber='ignored', $errorMessage=null) {
- GalleryCoreApi::requireOnce('modules/core/classes/GalleryStatus.class');
- $status = new GalleryStatus(GALLERY_ERROR | $errorCode, $errorMessage);
- $status->setStackTrace(debug_backtrace());
-@@ -2901,7 +2901,7 @@ class GalleryCoreApi {
- * @return array GalleryStatus a status code
- * array the results
- */
-- function getMapEntry($mapName, $select, $match=array(), $optional=array()) {
-+ static function getMapEntry($mapName, $select, $match=array(), $optional=array()) {
- global $gallery;
-
- if (empty($mapName) || empty($select) || !is_array($match) || !is_array($optional)) {
-@@ -3268,7 +3268,7 @@ class GalleryCoreApi {
- * @return string local path to the Gallery code base. If the optional parameter has not been
- * supplied the return value will have the trailing slash appended.
- */
-- function getCodeBasePath($relativePath=null) {
-+ static function getCodeBasePath($relativePath=null) {
- static $codeBaseDirectory;
- if (!isset($codeBaseDirectory)) {
- $codeBaseDirectory = dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR;
-diff --git a/modules/core/classes/GalleryUtilities.class b/modules/core/classes/GalleryUtilities.class
-index eeae67d..486a160 100644
---- a/modules/core/classes/GalleryUtilities.class
-+++ b/modules/core/classes/GalleryUtilities.class
-@@ -392,7 +392,7 @@ class GalleryUtilities {
- * @param string $key form variable name
- * @return string prefixed form variable name
- */
-- function prefixFormVariable($key) {
-+ static function prefixFormVariable($key) {
- return GALLERY_FORM_VARIABLE_PREFIX . $key;
- }
-
-@@ -525,7 +525,7 @@ class GalleryUtilities {
- * @param string $className
- * @return boolean
- */
-- function isA($instance, $className) {
-+ static function isA($instance, $className) {
- return is_a($instance, $className);
- }
-
-@@ -554,7 +554,7 @@ class GalleryUtilities {
- * @return array int the number of entities in the string
- * string the output string
- */
-- function entitySubstr($string, $start, $length=null, $countEntitiesAsOne=true) {
-+ static function entitySubstr($string, $start, $length=null, $countEntitiesAsOne=true) {
- $stringLength = strlen($string);
- if ($stringLength < $start) {
- return array(0, false);
-@@ -618,7 +618,7 @@ class GalleryUtilities {
- * @param string $source encoded using UTF-8
- * @return string of unicode entities
- */
-- function utf8ToUnicodeEntities($source) {
-+ static function utf8ToUnicodeEntities($source) {
- /*
- * Array used to figure what number to decrement from character order value according to
- * number of characters used to map unicode to ASCII by UTF-8
-@@ -831,7 +831,7 @@ class GalleryUtilities {
- * @deprecated
- * @todo Remove at the next major version bump of core API
- */
-- function htmlEntityDecode($string) {
-+ static function htmlEntityDecode($string) {
- return empty($string) ? $string : html_entity_decode($string, ENT_COMPAT);
- }
-
-@@ -841,7 +841,7 @@ class GalleryUtilities {
- * @param string $markupType (optional) markup type, defaults from core markup parameter
- * @return string resulting text
- */
-- function markup($text, $markupType=null) {
-+ static function markup($text, $markupType=null) {
- GalleryCoreApi::requireOnce('lib/smarty_plugins/modifier.markup.php');
- return smarty_modifier_markup($text, $markupType);
- }
-@@ -1141,7 +1141,7 @@ class GalleryUtilities {
- * @return array GalleryStatus a status code
- * string pseudoFileName a filename
- */
-- function getPseudoFileName($entity) {
-+ static function getPseudoFileName($entity) {
- /*
- * If our GalleryEntity is a GalleryFileSystemEntity, then we've got a path component so
- * we're cool. If it's a derivative, then get the pseudo filename of its parent and use
-@@ -1314,7 +1314,7 @@ class GalleryUtilities {
- * @param array $provided (major, minor)
- * @return boolean true if compatible
- */
-- function isCompatibleWithApi($required, $provided) {
-+ static function isCompatibleWithApi($required, $provided) {
- if (!is_array($required) || !is_array($provided)) {
- return false;
- }
-@@ -1475,7 +1475,7 @@ class GalleryUtilities {
- * @param boolean $force force the reevaluation of the HTTP header string Cookie
- * @param boolean $unset unset static variable for testability
- */
-- function fixCookieVars($force=false, $unset=false) {
-+ static function fixCookieVars($force=false, $unset=false) {
- static $fixed;
- if (!isset($fixed) || $force) {
- $fixed = true;
-@@ -1568,7 +1568,7 @@ class GalleryUtilities {
- * @param array $fixedCookies (string already registered cookie name, ...)
- * @access private
- */
-- function _registerCookieAttr($attr, &$fixedCookies) {
-+ static function _registerCookieAttr($attr, &$fixedCookies) {
- global $gallery;
- /* Split NAME [=VALUE], value is optional for all attributes but the cookie name */
- if (($pos = strpos($attr, '=')) !== false) {
-diff --git a/modules/core/classes/helpers/GalleryPluginHelper_simple.class b/modules/core/classes/helpers/GalleryPluginHelper_simple.class
-index f6654c6..e873921 100644
---- a/modules/core/classes/helpers/GalleryPluginHelper_simple.class
-+++ b/modules/core/classes/helpers/GalleryPluginHelper_simple.class
-@@ -32,7 +32,7 @@ class GalleryPluginHelper_simple {
- * @see GalleryCoreApi::loadPlugin
- * @param int $depth of recursion (don't set this; it's used internally)
- */
-- function loadPlugin($pluginType, $pluginId, $ignoreVersionMismatch=false,
-+ static function loadPlugin($pluginType, $pluginId, $ignoreVersionMismatch=false,
- $errorOnVersionMismatch=false, $depth=0) {
- global $gallery;
-
-@@ -205,7 +205,7 @@ class GalleryPluginHelper_simple {
- /**
- * @see GalleryCoreApi::getPluginParameter
- */
-- function getParameter($pluginType, $pluginId, $parameterName, $itemId=0,
-+ static function getParameter($pluginType, $pluginId, $parameterName, $itemId=0,
- $ignoreDiskCache=false) {
- global $gallery;
-
-@@ -259,7 +259,7 @@ class GalleryPluginHelper_simple {
- * array (itemId/zero => array(parameterName => parameterValue), ..)
- * @access protected
- */
-- function _fetchAllParameters($pluginType, $pluginId, $itemId, $ignoreDiskCache=false) {
-+ static function _fetchAllParameters($pluginType, $pluginId, $itemId, $ignoreDiskCache=false) {
- global $gallery;
- if (empty($pluginType) || empty($pluginId)) {
- return array(GalleryCoreApi::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__,
---
-2.13.1
-