View | Details | Raw Unified | Return to bug 234557 | Differences between
and this patch

Collapse All | Expand All

(-)gallery2-php7/Makefile (-1 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	gallery2
4
PORTNAME=	gallery2
5
PORTVERSION=	2.3.2
5
PORTVERSION=	2.3.2
6
PORTREVISION=	10
6
PORTREVISION=	11
7
CATEGORIES=	www
7
CATEGORIES=	www
8
MASTER_SITES=	SF/gallery/${PORTNAME}/${PORTVERSION}
8
MASTER_SITES=	SF/gallery/${PORTNAME}/${PORTVERSION}
9
DISTNAME=	gallery-${PORTVERSION}-full
9
DISTNAME=	gallery-${PORTVERSION}-full
(-)gallery2-php7/files/patch-gregstoll-046cf868 (+161 lines)
Line 0 Link Here
1
Obtained from:  https://github.com/gregstoll/gallery2/commit/046cf868770c79156d9dd8af070ac894a0eca0e6
2
3
--- modules/core/classes/GalleryCoreApi.class
4
+++ modules/core/classes/GalleryCoreApi.class
5
@@ -265,7 +265,7 @@ class GalleryCoreApi {
6
      * @return array GalleryStatus a status code
7
      *               object the plugin
8
      */
9
-    function loadPlugin($pluginType, $pluginId, $ignoreVersionMismatch=false,
10
+    static function loadPlugin($pluginType, $pluginId, $ignoreVersionMismatch=false,
11
 			$errorOnVersionMismatch=false) {
12
 	GalleryCoreApi::requireOnce(
13
 	    'modules/core/classes/helpers/GalleryPluginHelper_simple.class');
14
@@ -2857,7 +2857,7 @@ class GalleryCoreApi {
15
      * @param string $errorMessage
16
      * @return GalleryStatus an error status
17
      */
18
-    function error($errorCode, $fileName='ignored', $lineNumber='ignored', $errorMessage=null) {
19
+    static function error($errorCode, $fileName='ignored', $lineNumber='ignored', $errorMessage=null) {
20
 	GalleryCoreApi::requireOnce('modules/core/classes/GalleryStatus.class');
21
 	$status = new GalleryStatus(GALLERY_ERROR | $errorCode, $errorMessage);
22
 	$status->setStackTrace(debug_backtrace());
23
@@ -2901,7 +2901,7 @@ class GalleryCoreApi {
24
      * @return array GalleryStatus a status code
25
      *               array the results
26
      */
27
-    function getMapEntry($mapName, $select, $match=array(), $optional=array()) {
28
+    static function getMapEntry($mapName, $select, $match=array(), $optional=array()) {
29
 	global $gallery;
30
 
31
 	if (empty($mapName) || empty($select) || !is_array($match) || !is_array($optional)) {
32
@@ -3268,7 +3268,7 @@ class GalleryCoreApi {
33
      * @return string local path to the Gallery code base.  If the optional parameter has not been
34
      *                supplied the return value will have the trailing slash appended.
35
      */
36
-    function getCodeBasePath($relativePath=null) {
37
+    static function getCodeBasePath($relativePath=null) {
38
         static $codeBaseDirectory;
39
         if (!isset($codeBaseDirectory)) {
40
 	    $codeBaseDirectory = dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR;
41
--- modules/core/classes/GalleryUtilities.class
42
+++ modules/core/classes/GalleryUtilities.class
43
@@ -392,7 +392,7 @@ class GalleryUtilities {
44
      * @param string $key form variable name
45
      * @return string prefixed form variable name
46
      */
47
-    function prefixFormVariable($key) {
48
+    static function prefixFormVariable($key) {
49
 	return GALLERY_FORM_VARIABLE_PREFIX . $key;
50
     }
51
 
52
@@ -525,7 +525,7 @@ class GalleryUtilities {
53
      * @param string $className
54
      * @return boolean
55
      */
56
-    function isA($instance, $className) {
57
+    static function isA($instance, $className) {
58
 	return is_a($instance, $className);
59
     }
60
 
61
@@ -554,7 +554,7 @@ class GalleryUtilities {
62
      * @return array int the number of entities in the string
63
      *               string the output string
64
      */
65
-    function entitySubstr($string, $start, $length=null, $countEntitiesAsOne=true) {
66
+    static function entitySubstr($string, $start, $length=null, $countEntitiesAsOne=true) {
67
 	$stringLength = strlen($string);
68
 	if ($stringLength < $start) {
69
 	    return array(0, false);
70
@@ -618,7 +618,7 @@ class GalleryUtilities {
71
      * @param string $source encoded using UTF-8
72
      * @return string of unicode entities
73
      */
74
-    function utf8ToUnicodeEntities($source) {
75
+    static function utf8ToUnicodeEntities($source) {
76
 	/*
77
 	 * Array used to figure what number to decrement from character order value according to
78
 	 * number of characters used to map unicode to ASCII by UTF-8
79
@@ -831,7 +831,7 @@ class GalleryUtilities {
80
      * @deprecated
81
      * @todo Remove at the next major version bump of core API
82
      */
83
-    function htmlEntityDecode($string) {
84
+    static function htmlEntityDecode($string) {
85
 	return empty($string) ? $string : html_entity_decode($string, ENT_COMPAT);
86
     }
87
 
88
@@ -841,7 +841,7 @@ class GalleryUtilities {
89
      * @param string $markupType (optional) markup type, defaults from core markup parameter
90
      * @return string resulting text
91
      */
92
-    function markup($text, $markupType=null) {
93
+    static function markup($text, $markupType=null) {
94
 	GalleryCoreApi::requireOnce('lib/smarty_plugins/modifier.markup.php');
95
 	return smarty_modifier_markup($text, $markupType);
96
     }
97
@@ -1141,7 +1141,7 @@ class GalleryUtilities {
98
      * @return array GalleryStatus a status code
99
      *               string pseudoFileName a filename
100
      */
101
-    function getPseudoFileName($entity) {
102
+    static function getPseudoFileName($entity) {
103
 	/*
104
 	 * If our GalleryEntity is a GalleryFileSystemEntity, then we've got a path component so
105
 	 * we're cool.  If it's a derivative, then get the pseudo filename of its parent and use
106
@@ -1314,7 +1314,7 @@ class GalleryUtilities {
107
      * @param array $provided (major, minor)
108
      * @return boolean true if compatible
109
      */
110
-    function isCompatibleWithApi($required, $provided) {
111
+    static function isCompatibleWithApi($required, $provided) {
112
 	if (!is_array($required) || !is_array($provided)) {
113
 	    return false;
114
 	}
115
@@ -1475,7 +1475,7 @@ class GalleryUtilities {
116
      * @param boolean $force force the reevaluation of the HTTP header string Cookie
117
      * @param boolean $unset unset static variable for testability
118
      */
119
-    function fixCookieVars($force=false, $unset=false) {
120
+    static function fixCookieVars($force=false, $unset=false) {
121
 	static $fixed;
122
 	if (!isset($fixed) || $force) {
123
 	    $fixed = true;
124
@@ -1568,7 +1568,7 @@ class GalleryUtilities {
125
      * @param array $fixedCookies (string already registered cookie name, ...)
126
      * @access private
127
      */
128
-    function _registerCookieAttr($attr, &$fixedCookies) {
129
+    static function _registerCookieAttr($attr, &$fixedCookies) {
130
 	global $gallery;
131
 	/* Split NAME [=VALUE], value is optional for all attributes but the cookie name */
132
 	if (($pos = strpos($attr, '=')) !== false) {
133
--- modules/core/classes/helpers/GalleryPluginHelper_simple.class
134
+++ modules/core/classes/helpers/GalleryPluginHelper_simple.class
135
@@ -32,7 +32,7 @@ class GalleryPluginHelper_simple {
136
      * @see GalleryCoreApi::loadPlugin
137
      * @param int $depth of recursion (don't set this; it's used internally)
138
      */
139
-    function loadPlugin($pluginType, $pluginId, $ignoreVersionMismatch=false,
140
+    static function loadPlugin($pluginType, $pluginId, $ignoreVersionMismatch=false,
141
 			$errorOnVersionMismatch=false, $depth=0) {
142
 	global $gallery;
143
 
144
@@ -205,7 +205,7 @@ class GalleryPluginHelper_simple {
145
     /**
146
      * @see GalleryCoreApi::getPluginParameter
147
      */
148
-    function getParameter($pluginType, $pluginId, $parameterName, $itemId=0,
149
+    static function getParameter($pluginType, $pluginId, $parameterName, $itemId=0,
150
 			  $ignoreDiskCache=false) {
151
 	global $gallery;
152
 
153
@@ -259,7 +259,7 @@ class GalleryPluginHelper_simple {
154
      *               array (itemId/zero => array(parameterName => parameterValue), ..)
155
      * @access protected
156
      */
157
-    function _fetchAllParameters($pluginType, $pluginId, $itemId, $ignoreDiskCache=false) {
158
+    static function _fetchAllParameters($pluginType, $pluginId, $itemId, $ignoreDiskCache=false) {
159
 	global $gallery;
160
 	if (empty($pluginType) || empty($pluginId)) {
161
 	    return array(GalleryCoreApi::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__,
(-)gallery2-php7/files/patch-gregstoll-4d7f661d (+637 lines)
Line 0 Link Here
1
Obtained from:	https://github.com/gregstoll/gallery2/commit/4d7f661d0f9aaef6a4a9bab464b961ec413a0bc7
2
3
--- lib/support/chmod.php
4
+++ lib/support/chmod.php
5
@@ -312,7 +312,7 @@ class PermissionBits {
6
      * @return PermissionBits object
7
      * @static
8
      */
9
-    function fromString($bitsAsString) {
10
+    static function fromString($bitsAsString) {
11
     	$bitsAsString = (string)$bitsAsString;
12
     	if (strlen($bitsAsString) && $bitsAsString{0} != '0') {
13
     	    $bitsAsString = '0' . $bitsAsString;
14
--- modules/captcha/CaptchaSiteAdmin.inc
15
+++ modules/captcha/CaptchaSiteAdmin.inc
16
@@ -172,7 +172,7 @@ class CaptchaAdminOption {
17
      *               array of string optionId => CaptchaAdminOption instance
18
      * @static
19
      */
20
-    function getAllOptions() {
21
+    static function getAllOptions() {
22
 	$testOptions = CaptchaAdminOption::testOptions();
23
 	if (isset($testOptions)) {
24
 	    return array(null, $testOptions);
25
@@ -203,7 +203,7 @@ class CaptchaAdminOption {
26
      * @return null or array of string optionId => CaptchaAdminOption test instance
27
      * @static
28
      */
29
-    function testOptions($options=null) {
30
+    static function testOptions($options=null) {
31
 	static $testOptions = null;
32
 	if (isset($options)) {
33
 	    $testOptions = $options;
34
--- modules/comment/classes/GalleryCommentHelper.class
35
+++ modules/comment/classes/GalleryCommentHelper.class
36
@@ -492,7 +492,7 @@ class GalleryCommentHelper /* implements GalleryEventListener */ {
37
      * @param $enabled bool true to enable the listener, false to disable it
38
      * @static
39
      */
40
-    function setAkismetSaveListenerSwitch($enabled) {
41
+    static function setAkismetSaveListenerSwitch($enabled) {
42
 	$switch =& GalleryCommentHelper::getAkismetSaveListenerSwitch();
43
 	$switch = $enabled;
44
     }
45
@@ -502,7 +502,7 @@ class GalleryCommentHelper /* implements GalleryEventListener */ {
46
      * @return bool the current status
47
      * @static
48
      */
49
-    function &getAkismetSaveListenerSwitch() {
50
+    static function &getAkismetSaveListenerSwitch() {
51
 	static $enabled = true;
52
 	return $enabled;
53
     }
54
--- modules/core/CoreModuleExtras.inc
55
+++ modules/core/CoreModuleExtras.inc
56
@@ -2605,7 +2605,7 @@ class CoreModuleExtras {
57
      *                        'add' => array of string additions)
58
      * @access private
59
      */
60
-    function _prepareConfigUpgrade($currentVersion) {
61
+    static function _prepareConfigUpgrade($currentVersion) {
62
 	global $gallery;
63
 	$configChanges = array();
64
 
65
@@ -2941,7 +2941,7 @@ if (!isset($gallery) || !method_exists($gallery, \'setConfig\')) {
66
      * @param string $currentVersion current core version
67
      * @return boolean true if change is required
68
      */
69
-    function isConfigUpgradeRequired($currentVersion) {
70
+    static function isConfigUpgradeRequired($currentVersion) {
71
 	$configChanges = CoreModuleExtras::_prepareConfigUpgrade($currentVersion);
72
 	return !empty($configChanges);
73
     }
74
--- modules/core/ErrorPage.inc
75
+++ modules/core/ErrorPage.inc
76
@@ -129,7 +129,7 @@ class ErrorPageView extends GalleryView {
77
      *                 not be considered an error.
78
      * @static
79
      */
80
-    function errorHandler($error, $g2Data=null, $initOk=null) {
81
+    static function errorHandler($error, $g2Data=null, $initOk=null) {
82
 	global $gallery;
83
 	$failsafe = false;
84
 
85
--- modules/core/ItemAdd.inc
86
+++ modules/core/ItemAdd.inc
87
@@ -789,7 +789,7 @@ class ItemAddOption {
88
      *               array ItemAddOption instances
89
      * @static
90
      */
91
-    function getAllAddOptions() {
92
+    static function getAllAddOptions() {
93
 	/* Get all the option plugins */
94
 	list ($ret, $allOptionIds) =
95
 	    GalleryCoreApi::getAllFactoryImplementationIds('ItemAddOption');
96
--- modules/core/ItemEdit.inc
97
+++ modules/core/ItemEdit.inc
98
@@ -471,7 +471,7 @@ class ItemEditOption {
99
      *               array ItemEditOption instances
100
      * @static
101
      */
102
-    function getAllOptions($editPlugin, $item, $thumbnail) {
103
+    static function getAllOptions($editPlugin, $item, $thumbnail) {
104
 	list ($ret, $allOptionIds) =
105
 	    GalleryCoreApi::getAllFactoryImplementationIdsWithHint('ItemEditOption', $editPlugin);
106
 	if ($ret) {
107
--- modules/core/PluginCallback.inc
108
+++ modules/core/PluginCallback.inc
109
@@ -112,7 +112,7 @@ class PluginCallbackView extends GalleryView {
110
      * @return array changed states (moduleId => state, ...)
111
      * @static
112
      */
113
-    function calculateStateChanges($beforeStates, $afterStates) {
114
+    static function calculateStateChanges($beforeStates, $afterStates) {
115
 	$states = array();
116
 	$deleted = array();
117
 	foreach (array('module', 'theme') as $type) {
118
@@ -135,7 +135,7 @@ class PluginCallbackView extends GalleryView {
119
      * @return GalleryStatus a status code
120
      * @static
121
      */
122
-    function handleCallback($command, &$result) {
123
+    static function handleCallback($command, &$result) {
124
 	global $gallery;
125
 	$platform =& $gallery->getPlatform();
126
 
127
@@ -344,7 +344,7 @@ class PluginCallbackView extends GalleryView {
128
      *               array(moduleId => state, ...)
129
      * @static
130
      */
131
-    function getPluginStates() {
132
+    static function getPluginStates() {
133
 	$states = array();
134
 
135
 	foreach (array('module', 'theme') as $type) {
136
@@ -379,7 +379,7 @@ class PluginCallbackView extends GalleryView {
137
      *               string a state
138
      * @static
139
      */
140
-    function getPluginState($type, $plugin, $status) {
141
+    static function getPluginState($type, $plugin, $status) {
142
 	if ($type == 'module' && $plugin->getId() == 'core') {
143
 	    return array(null, 'active');
144
 	}
145
--- modules/core/classes/GalleryController.class
146
+++ modules/core/classes/GalleryController.class
147
@@ -116,7 +116,7 @@ class GalleryController {
148
      *               GalleryController a controller
149
      * @static
150
      */
151
-    function loadController($controllerName) {
152
+    static function loadController($controllerName) {
153
 	global $gallery;
154
 
155
 	/* Continue to support old style : separator for a while */
156
@@ -216,7 +216,7 @@ class GalleryController {
157
      * @return GalleryStatus a status code null on success, ERROR_REQUEST_FORGED on failure
158
      * @static
159
      */
160
-    function assertIsGenuineRequest() {
161
+    static function assertIsGenuineRequest() {
162
 	global $gallery;
163
 	$session =& $gallery->getSession();
164
 
165
--- modules/core/classes/GalleryCoreApi.class
166
+++ modules/core/classes/GalleryCoreApi.class
167
@@ -475,7 +475,7 @@ class GalleryCoreApi {
168
      * @param string $itemId (optional)
169
      * @return GalleryStatus a status code
170
      */
171
-    function setPluginParameter($pluginType, $pluginId, $parameterName,
172
+    static function setPluginParameter($pluginType, $pluginId, $parameterName,
173
 				$parameterValue, $itemId=0) {
174
 	GalleryCoreApi::requireOnce(
175
 	    'modules/core/classes/helpers/GalleryPluginHelper_medium.class');
176
@@ -2874,7 +2874,7 @@ class GalleryCoreApi {
177
      *                non transactional database connection for this operation.  Default is false.
178
      * @return GalleryStatus a status code
179
      */
180
-    function updateMapEntry($mapName, $match, $change, $useNonTransactionalConnection=false) {
181
+    static function updateMapEntry($mapName, $match, $change, $useNonTransactionalConnection=false) {
182
 	global $gallery;
183
 
184
 	if (sizeof($match) == 0 || sizeof($change) == 0) {
185
--- modules/core/classes/GalleryDataCache.class
186
+++ modules/core/classes/GalleryDataCache.class
187
@@ -103,7 +103,7 @@ class GalleryDataCache {
188
      * Remove data from the cache
189
      * @param string $key
190
      */
191
-    function remove($key) {
192
+    static function remove($key) {
193
 	$cache =& GalleryDataCache::_getCache();
194
 	if (!$cache['memoryCacheEnabled']) {
195
 	    return;
196
@@ -224,7 +224,7 @@ class GalleryDataCache {
197
      * Empty the cache of all but protected entries
198
      * @param boolean $purgeProtected (optional) purge protected also?
199
      */
200
-    function reset($purgeProtected=false) {
201
+    static function reset($purgeProtected=false) {
202
 	$cache =& GalleryDataCache::_getCache();
203
 	if (!$cache['memoryCacheEnabled']) {
204
 	    return;
205
@@ -299,7 +299,7 @@ class GalleryDataCache {
206
      * @see GalleryDataCache::getCachePath
207
      * @param array $pathInfo the path info
208
      */
209
-    function removeFromDisk($pathInfo) {
210
+    static function removeFromDisk($pathInfo) {
211
 	$cache =& GalleryDataCache::_getCache();
212
 	if (!$cache['fileCacheEnabled']) {
213
 	    return null;
214
--- modules/core/classes/GalleryRepository.class
215
+++ modules/core/classes/GalleryRepository.class
216
@@ -66,7 +66,7 @@ class GalleryRepository {
217
      *               int error count (repositories that failed to load for some reason)
218
      * @static
219
      */
220
-    function getRepositories($sources=array(), $repositoryClassName='GalleryRepository') {
221
+    static function getRepositories($sources=array(), $repositoryClassName='GalleryRepository') {
222
 	$cacheKey = 'GalleryRepository::getRepositories(' . join('|', $sources) .
223
 	    ",$repositoryClassName)";
224
 	if (!GalleryDataCache::containsKey($cacheKey)) {
225
@@ -106,7 +106,7 @@ class GalleryRepository {
226
      *
227
      * @static
228
      */
229
-    function clearRepositoryCache($sources=array(), $repositoryClassName='GalleryRepository') {
230
+    static function clearRepositoryCache($sources=array(), $repositoryClassName='GalleryRepository') {
231
 	$cacheKey = 'GalleryRepository::getRepositories(' . join('|', $sources) .
232
 	    ",$repositoryClassName)";
233
 	GalleryDataCache::remove($cacheKey);
234
--- modules/core/classes/GallerySession.class
235
+++ modules/core/classes/GallerySession.class
236
@@ -1262,7 +1262,7 @@ class GallerySession {
237
      * @return array
238
      * @static
239
      */
240
-    function getRemoteIdentifier() {
241
+    static function getRemoteIdentifier() {
242
 	$httpUserAgent = GalleryUtilities::getServerVar('HTTP_USER_AGENT');
243
 	return array(GalleryUtilities::getRemoteHostAddress(),
244
 		     isset($httpUserAgent) ? md5($httpUserAgent) : null);
245
--- modules/core/classes/GallerySortInterface_1_2.class
246
+++ modules/core/classes/GallerySortInterface_1_2.class
247
@@ -68,7 +68,7 @@ class GallerySortInterface_1_2 {
248
      *               array of orderDirection => localized name for direction
249
      * @static
250
      */
251
-    function getAllSortOrders($includeDefault=true) {
252
+    static function getAllSortOrders($includeDefault=true) {
253
 	list ($ret, $module) = GalleryCoreApi::loadPlugin('module', 'core');
254
 	if ($ret) {
255
 	    return array($ret, null, null, null);
256
--- modules/core/classes/GalleryStorage/GalleryStorageExtras.class
257
+++ modules/core/classes/GalleryStorage/GalleryStorageExtras.class
258
@@ -1185,7 +1185,7 @@ class GalleryStorageExtras /* the other half of GalleryStorage */ {
259
      * @return array the parsed results
260
      * @static
261
      */
262
-    function parseSqlTemplate($sqlData, $dbType) {
263
+    static function parseSqlTemplate($sqlData, $dbType) {
264
 	$info = array('table' => array(), 'alter' => array(),
265
 		      'remove' => array(), 'test' => array());
266
 	$dbname = $tablename = null;
267
--- modules/core/classes/GalleryTemplate.class
268
+++ modules/core/classes/GalleryTemplate.class
269
@@ -369,7 +369,7 @@ class GalleryTemplate {
270
      * @return boolean false if the compiled templates should be used without any checking
271
      * @static
272
      */
273
-    function shouldDoCompileCheck() {
274
+    static function shouldDoCompileCheck() {
275
 	$cacheKey = 'GalleryTemplate::compileCheck';
276
 	if (!GalleryDataCache::containsKey($cacheKey)) {
277
 	    $compileCheck = (GalleryUtilities::getServerVar('HTTP_PRAGMA') == 'no-cache'
278
@@ -394,7 +394,7 @@ class GalleryTemplate {
279
      * @return string processed tpl content ready for compilation
280
      * @static
281
      */
282
-    function preFilter($source, &$smarty) {
283
+    static function preFilter($source, &$smarty) {
284
 	return preg_replace('/^\s+/m', '', $source);
285
     }
286
 
287
--- modules/core/classes/GalleryToolkit.class
288
+++ modules/core/classes/GalleryToolkit.class
289
@@ -226,7 +226,7 @@ class GalleryToolkit {
290
      * @param GalleryEntity $source (probably a GalleryPhotoItem or GalleryMovieItem)
291
      * @static
292
      */
293
-    function estimateDimensions(&$derivative, $source) {
294
+    static function estimateDimensions(&$derivative, $source) {
295
 	if (method_exists($source, 'getwidth') && method_exists($source, 'getheight')) {
296
 	    $width = $source->getWidth();
297
 	    $height = $source->getHeight();
298
--- modules/core/classes/GalleryTranslator.class
299
+++ modules/core/classes/GalleryTranslator.class
300
@@ -67,7 +67,7 @@ class GalleryTranslator {
301
      * @return boolean
302
      * @static
303
      */
304
-    function canTranslate() {
305
+    static function canTranslate() {
306
 	return function_exists('dgettext');
307
     }
308
 
309
@@ -76,7 +76,7 @@ class GalleryTranslator {
310
      * @return boolean
311
      * @static
312
      */
313
-    function canTranslatePlural() {
314
+    static function canTranslatePlural() {
315
 	return function_exists('dngettext');
316
     }
317
 
318
@@ -98,7 +98,7 @@ class GalleryTranslator {
319
      *                     ...)
320
      * @static
321
      */
322
-    function getLanguageData() {
323
+    static function getLanguageData() {
324
 	static $supportedLanguages = array();
325
 	static $defaultCountry = array();
326
 
327
@@ -277,7 +277,7 @@ class GalleryTranslator {
328
      *              array('description', 'right-to-left'?)
329
      * @deprecated Remove on next major api bump. Use GalleryCoreApi::getSupportedLanguages
330
      */
331
-    function getSupportedLanguages() {
332
+    static function getSupportedLanguages() {
333
 	return GalleryCoreApi::getSupportedLanguages();
334
     }
335
 
336
@@ -365,7 +365,7 @@ class GalleryTranslator {
337
      *               string language code
338
      * @static
339
      */
340
-    function getDefaultLanguageCode() {
341
+    static function getDefaultLanguageCode() {
342
 	list ($ret, $useBrowserPref) =
343
 	    GalleryCoreApi::getPluginParameter('module', 'core', 'language.useBrowserPref');
344
 	if ($ret) {
345
@@ -407,7 +407,7 @@ class GalleryTranslator {
346
      *                array data about this language code (description,right-to-left?))
347
      * @static
348
      */
349
-    function getSupportedLanguageCode($languageCode, $fallback=true) {
350
+    static function getSupportedLanguageCode($languageCode, $fallback=true) {
351
 	static $supportedLanguages;
352
 	static $defaultCountry;
353
 	if (!isset($supportedLanguages)) {
354
@@ -439,7 +439,7 @@ class GalleryTranslator {
355
      * @return null or a language code in the <language>_<COUNTRY> format, eg: en_US
356
      * @static
357
      */
358
-    function getLanguageCodeFromRequest() {
359
+    static function getLanguageCodeFromRequest() {
360
 	/* Take the first thing the browser accepts that we can use */
361
 	$httpAcceptLanguage = GalleryUtilities::getServerVar('HTTP_ACCEPT_LANGUAGE');
362
 	if (!empty($httpAcceptLanguage)) {
363
--- modules/core/classes/GalleryUrlGenerator.class
364
+++ modules/core/classes/GalleryUrlGenerator.class
365
@@ -143,7 +143,7 @@ class GalleryUrlGenerator {
366
      * @return string the current URL path component plus query parameters
367
      * @static
368
      */
369
-    function getCurrentRequestUri() {
370
+    static function getCurrentRequestUri() {
371
 	$cacheKey = 'GalleryUrlGenerator::currentRequestUri';
372
 	if (GalleryDataCache::containsKey($cacheKey)) {
373
 	    $path = GalleryDataCache::get($cacheKey);
374
@@ -182,7 +182,7 @@ class GalleryUrlGenerator {
375
      * @return string the new URL (&amp; separates added params)
376
      * @static
377
      */
378
-    function appendParamsToUrl($url, $params, $addPrefix=true, $htmlEntities=true,
379
+    static function appendParamsToUrl($url, $params, $addPrefix=true, $htmlEntities=true,
380
 			       $urlEncode=true) {
381
 	if (empty($params)) {
382
 	    return $url;
383
@@ -254,7 +254,7 @@ class GalleryUrlGenerator {
384
      * @access private
385
      * @static
386
      */
387
-    function _parseUri($uri) {
388
+    static function _parseUri($uri) {
389
 	/*
390
 	 * baseUri / g2Uri can have the following patterns:
391
 	 *    - Everything before the two last '/' is interpreted as path
392
@@ -975,7 +975,7 @@ class GalleryUrlGenerator {
393
      * @access private
394
      * @static
395
      */
396
-    function _saveLocalUrlMap(&$urlGenerator) {
397
+    static function _saveLocalUrlMap(&$urlGenerator) {
398
 	if (!empty($urlGenerator->_localUrlMapDirty)) {
399
 	    GalleryDataCache::putToDisk(array('type' => 'local-url-map'),
400
 					$urlGenerator->_localUrlMap);
401
--- modules/core/classes/GalleryUtilities.class
402
+++ modules/core/classes/GalleryUtilities.class
403
@@ -1197,7 +1197,7 @@ class GalleryUtilities {
404
      * Get contents of MANIFEST files.
405
      * @return array (file => array('checksum'=>..,'size'=>..,'viewable'=>..), ..)
406
      */
407
-    function readManifest() {
408
+    static function readManifest() {
409
 	/*
410
 	 * Be careful not to reference $gallery here; this method is called from the installer.
411
 	 * Look in (modules|themes)/.../MANIFEST and top level MANIFEST.
412
@@ -1231,7 +1231,7 @@ class GalleryUtilities {
413
      * @param string $filePath the path to the MANIFEST file
414
      * @return array(file => array('checksum'=>..,'size'=>..,'viewable'=>..), ...)
415
      */
416
-    function readIndividualManifest($filePath, &$manifest) {
417
+    static function readIndividualManifest($filePath, &$manifest) {
418
 	global $gallery;
419
 
420
 	/* If the method getPlatform exists, then we are not installing and it is safe to use. */
421
@@ -1356,7 +1356,7 @@ class GalleryUtilities {
422
      * @param string $ini_string name of the php.ini value to be retrieved
423
      * @return boolean value
424
      */
425
-    function getPhpIniBool($ini_string) {
426
+    static function getPhpIniBool($ini_string) {
427
 	$value = ini_get($ini_string);
428
 
429
 	if (!strcasecmp('on', $value) || $value == 1 || $value === true) {
430
--- modules/core/classes/GalleryView.class
431
+++ modules/core/classes/GalleryView.class
432
@@ -137,7 +137,7 @@ class GalleryView {
433
      *               GalleryView a view
434
      * @static
435
      */
436
-    function loadView($viewName) {
437
+    static function loadView($viewName) {
438
 	global $gallery;
439
 
440
 	/* Continue to support old style : separator for a while */
441
@@ -545,7 +545,7 @@ class GalleryView {
442
      * @access private
443
      * @static
444
      */
445
-    function _loadTheme($themeId) {
446
+    static function _loadTheme($themeId) {
447
 	$validTheme = false;
448
 	list ($ret, $theme) = GalleryCoreApi::loadPlugin('theme', $themeId, false, true);
449
 	if ($ret) {
450
@@ -652,7 +652,7 @@ class GalleryView {
451
      * @return GalleryStatus
452
      * @static
453
      */
454
-    function setStandardTemplateVariables(&$template) {
455
+    static function setStandardTemplateVariables(&$template) {
456
 	global $gallery;
457
 	$session =& $gallery->getSession();
458
 
459
--- modules/core/classes/helpers/GalleryCharsetHelper_simple.class
460
+++ modules/core/classes/helpers/GalleryCharsetHelper_simple.class
461
@@ -214,7 +214,7 @@ class GalleryCharsetHelper_simple {
462
     /**
463
      * @see GalleryCoreApi::utf8Substring
464
      */
465
-    function utf8Substring($string, $start, $length) {
466
+    static function utf8Substring($string, $start, $length) {
467
 	static $hasMbSubstr;
468
 	if (!isset($hasMbSubstr)) {
469
 	    if (!($hasMbSubstr = function_exists('mb_substr'))) {
470
--- modules/core/classes/helpers/GalleryPluginHelper_medium.class
471
+++ modules/core/classes/helpers/GalleryPluginHelper_medium.class
472
@@ -272,7 +272,7 @@ class GalleryPluginHelper_medium {
473
     /**
474
      * @see GalleryCoreApi::setPluginParameter
475
      */
476
-    function setParameter($pluginType, $pluginId, $parameterName, $parameterValue, $itemId=0) {
477
+    static function setParameter($pluginType, $pluginId, $parameterName, $parameterValue, $itemId=0) {
478
 	global $gallery;
479
 
480
 	if ($gallery->getDebug()) {
481
@@ -383,7 +383,7 @@ class GalleryPluginHelper_medium {
482
      * @return GalleryStatus a status code
483
      * @access private
484
      */
485
-    function _updateParameter($pluginType, $pluginId, $parameterName, $parameterValue, $itemId=0) {
486
+    static function _updateParameter($pluginType, $pluginId, $parameterName, $parameterValue, $itemId=0) {
487
 	if (empty($pluginType) || empty($pluginId) || empty($parameterName)) {
488
 	    return GalleryCoreApi::error(ERROR_BAD_PARAMETER);
489
 	}
490
--- modules/core/module.inc
491
+++ modules/core/module.inc
492
@@ -513,7 +513,7 @@ class CoreModule extends GalleryModule {
493
      * @return array 'core' => core module version, 'gallery' => gallery version
494
      * @static
495
      */
496
-    function getInstalledVersions() {
497
+    static function getInstalledVersions() {
498
 	global $gallery;
499
 
500
 	if (GalleryDataCache::containsKey('CoreModule::installedVersions')) {
501
--- modules/dynamicalbum/PopularAlbum.inc
502
+++ modules/dynamicalbum/PopularAlbum.inc
503
@@ -45,7 +45,7 @@ class PopularAlbumView extends UpdatesAlbumView {
504
      *               array of item ids
505
      * @static
506
      */
507
-    function getChildIds($userId) {
508
+    static function getChildIds($userId) {
509
 	return parent::getChildIds($userId, 'views', 'viewCount', ORDER_DESCENDING,
510
 				   'GalleryItemAttributesMap', 'itemId');
511
     }
512
--- modules/dynamicalbum/RandomAlbum.inc
513
+++ modules/dynamicalbum/RandomAlbum.inc
514
@@ -45,7 +45,7 @@ class RandomAlbumView extends UpdatesAlbumView {
515
      *               array of item ids
516
      * @static
517
      */
518
-    function getChildIds($userId) {
519
+    static function getChildIds($userId) {
520
 	return parent::getChildIds($userId, 'random', 'random', ORDER_ASCENDING, null, 'id');
521
     }
522
 }
523
--- modules/dynamicalbum/UpdatesAlbum.inc
524
+++ modules/dynamicalbum/UpdatesAlbum.inc
525
@@ -161,7 +161,7 @@ class UpdatesAlbumView extends GalleryView {
526
      *               array of item ids
527
      * @static
528
      */
529
-    function getChildIds($userId, $param='date', $orderBy='creationTimestamp',
530
+    static function getChildIds($userId, $param='date', $orderBy='creationTimestamp',
531
 	    $orderDirection=ORDER_DESCENDING, $table='GalleryEntity', $id='id') {
532
 	global $gallery;
533
 	$storage =& $gallery->getStorage();
534
--- modules/jpegtran/classes/JpegtranToolkitHelper.class
535
+++ modules/jpegtran/classes/JpegtranToolkitHelper.class
536
@@ -36,7 +36,7 @@ class JpegtranToolkitHelper {
537
      *               array('operations' => ...)
538
      * @static
539
      */
540
-    function getOperations() {
541
+    static function getOperations() {
542
 	global $gallery;
543
 
544
 	/* Detect and test the binary */
545
@@ -90,7 +90,7 @@ class JpegtranToolkitHelper {
546
      *
547
      * @static
548
      */
549
-    function testBinary($jpegtranPath) {
550
+    static function testBinary($jpegtranPath) {
551
 	global $gallery;
552
 	$platform =& $gallery->getPlatform();
553
 	$slash = $platform->getDirectorySeparator();
554
--- modules/keyalbum/Callbacks.inc
555
+++ modules/keyalbum/Callbacks.inc
556
@@ -89,7 +89,7 @@ class KeyAlbumCallbacks {
557
      * @return GalleryStatus a status code
558
      * @static
559
      */
560
-    function _findAllKeywords($param, $onlyPublic, $sizeLimit, $maxWeight, $includeFrequency) {
561
+    static function _findAllKeywords($param, $onlyPublic, $sizeLimit, $maxWeight, $includeFrequency) {
562
 	global $gallery;
563
 
564
 	$query = '
565
--- modules/keyalbum/KeywordAlbum.inc
566
+++ modules/keyalbum/KeywordAlbum.inc
567
@@ -152,7 +152,7 @@ class KeywordAlbumView extends GalleryView {
568
      *               array of item ids
569
      * @static
570
      */
571
-    function getChildIds($userId, $keyword=null) {
572
+    static function getChildIds($userId, $keyword=null) {
573
 	global $gallery;
574
 	$storage =& $gallery->getStorage();
575
 
576
--- modules/linkitem/classes/LinkItemToolkit.class
577
+++ modules/linkitem/classes/LinkItemToolkit.class
578
@@ -108,7 +108,7 @@ class LinkItemToolkit extends GalleryToolkit {
579
      * @return string command line parameters with %URL% %WIDTH% %HEIGHT% %OUTFILE% tokens
580
      * @static
581
      */
582
-    function getSnapshotParams() {
583
+    static function getSnapshotParams() {
584
 	global $gallery;
585
 	$platform =& $gallery->getPlatform();
586
 	$paramFile = dirname(dirname(__FILE__)) . $platform->getDirectorySeparator() . 'params.txt';
587
--- modules/password/classes/PasswordHelper.class
588
+++ modules/password/classes/PasswordHelper.class
589
@@ -44,7 +44,7 @@ class PasswordHelper extends PasswordInterface_1_0 {
590
      * @return GalleryStatus a status code
591
      * @static
592
      */
593
-    function setPassword(&$item, $password, $useProgressBar=false) {
594
+    static function setPassword(&$item, $password, $useProgressBar=false) {
595
 	global $gallery;
596
 	$gallery->guaranteeTimeLimit(60);
597
 
598
@@ -328,7 +328,7 @@ class PasswordHelper extends PasswordInterface_1_0 {
599
      * @return GalleryStatus a status code
600
      * @static
601
      */
602
-    function removePassword(&$item, $useProgressBar=false) {
603
+    static function removePassword(&$item, $useProgressBar=false) {
604
 	global $gallery;
605
 	$gallery->guaranteeTimeLimit(60);
606
 
607
--- modules/rating/RatingAlbum.inc
608
+++ modules/rating/RatingAlbum.inc
609
@@ -158,7 +158,7 @@ class RatingAlbumView extends GalleryView {
610
      *               array of item ids
611
      * @static
612
      */
613
-    function getChildIds($userId, $limit=null) {
614
+    static function getChildIds($userId, $limit=null) {
615
 	global $gallery;
616
 	$storage =& $gallery->getStorage();
617
 
618
--- modules/slideshow/classes/PicLensHelper.class
619
+++ modules/slideshow/classes/PicLensHelper.class
620
@@ -34,7 +34,7 @@ class PicLensHelper {
621
      *               string the version of PicLens we just installed
622
      * @static
623
      */
624
-    function install() {
625
+    static function install() {
626
 	global $gallery;
627
 	$platform =& $gallery->getPlatform();
628
 
629
@@ -77,7 +77,7 @@ class PicLensHelper {
630
      *               'swfUrl' => url to the SWF file)
631
      * @static
632
      */
633
-    function getLatestPicLensInfo() {
634
+    static function getLatestPicLensInfo() {
635
 	$url = 'http://gallery.menalto.com/versioncheck/piclens/release';
636
 	list ($success, $body) = GalleryCoreApi::fetchWebPage($url);
637
 	if (!$success) {
(-)gallery2-php7/files/patch-gregstoll-84dec753 (+24 lines)
Line 0 Link Here
1
Obtained from:	https://github.com/gregstoll/gallery2/commit/84dec753a49a885b8ab667927250aa3fae4d86c9
2
3
--- modules/captcha/CaptchaImage.inc
4
+++ modules/captcha/CaptchaImage.inc
5
@@ -88,7 +88,7 @@ class CaptchaImageView extends GalleryView {
6
 
7
 	/* Output the image and reclaim the memory it used */
8
 	/* Use low quality jpeg compression to make the image less OCR-able */
9
-	ImageJPEG($image, '', 50);
10
+	ImageJPEG($image, NULL, 50);
11
 	ImageDestroy($image);
12
 
13
 	return null;
14
--- modules/gd/classes/GdToolkitHelper.class
15
+++ modules/gd/classes/GdToolkitHelper.class
16
@@ -283,7 +283,7 @@ class GdToolkitHelper {
17
 		return array($ret, false);
18
 	    }
19
 	}
20
-	if (preg_match('/^>?2\.0/', $gdVersion)) {
21
+	if (preg_match('/^>?2\.[01]/', $gdVersion)) {
22
 	    return array(null, true);
23
 	}
24
 	/* 1.6, 1.8, ... is too old */
(-)gallery2-php7/files/patch-gregstoll-92188f3e (+137 lines)
Line 0 Link Here
1
Obtained from:	https://github.com/gregstoll/gallery2/commit/92188f3e247213e6ddcadf02c2cc068b9a57ae03
2
3
--- lib/adodb/adodb.inc.php
4
+++ lib/adodb/adodb.inc.php
5
@@ -335,7 +335,7 @@
6
 	/**
7
 	 * Constructor
8
 	 */
9
-	function ADOConnection()			
10
+	function __construct()			
11
 	{
12
 		die('Virtual Class -- cannot instantiate');
13
 	}
14
@@ -2779,7 +2779,7 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
15
 	 * @param queryID  	this is the queryID returned by ADOConnection->_query()
16
 	 *
17
 	 */
18
-	function ADORecordSet($queryID) 
19
+	function __construct($queryID) 
20
 	{
21
 		$this->_queryID = $queryID;
22
 	}
23
@@ -3757,7 +3757,7 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
24
 		 * Constructor
25
 		 *
26
 		 */
27
-		function ADORecordSet_array($fakeid=1)
28
+		function __construct($fakeid=1)
29
 		{
30
 		global $ADODB_FETCH_MODE,$ADODB_COMPAT_FETCH;
31
 		
32
--- lib/adodb/drivers/adodb-mysqli.inc.php
33
+++ lib/adodb/drivers/adodb-mysqli.inc.php
34
@@ -788,7 +788,7 @@ class ADORecordSet_mysqli extends ADORecordSet{
35
 	      break;
36
 	    }
37
 	  $this->adodbFetchMode = $mode;
38
-	  $this->ADORecordSet($queryID);	
39
+		parent::__construct($queryID);	
40
 	}
41
 	
42
 	function _initrs()
43
--- modules/core/classes/Gallery.class
44
+++ modules/core/classes/Gallery.class
45
@@ -168,7 +168,7 @@ class Gallery {
46
     var $_phpVm = null;
47
 
48
 
49
-    function Gallery() {
50
+    function __construct() {
51
 	$this->_activeUser = null;
52
 
53
 	/* Default config settings (can be overridden via config.php or embedded environment) */
54
--- modules/core/classes/GalleryStatus.class
55
+++ modules/core/classes/GalleryStatus.class
56
@@ -54,7 +54,7 @@ class GalleryStatus {
57
      * @param int $errorCode an error code
58
      * @param string $errorMessage (optional) descriptive message of the error
59
      */
60
-    function GalleryStatus($errorCode, $errorMessage=null) {
61
+    function __construct($errorCode, $errorMessage=null) {
62
 	$this->_errorCode = $errorCode;
63
 	$this->_errorMessage = $errorMessage;
64
     }
65
--- modules/core/classes/GalleryStorage.class
66
+++ modules/core/classes/GalleryStorage.class
67
@@ -179,7 +179,7 @@ class GalleryStorage {
68
     /**
69
      * @param array $config database configuration values
70
      */
71
-    function GalleryStorage($config) {
72
+    function __construct($config) {
73
 	$this->_type = $config['type'];
74
 	$this->_username = $config['username'];
75
 	$this->_password = $config['password'];
76
@@ -1517,7 +1517,7 @@ class GallerySearchResults {
77
      */
78
     var $_mapInfo;
79
 
80
-    function GallerySearchResults($recordSet, $fieldNames=null, $mapInfo=null) {
81
+    function __construct($recordSet, $fieldNames=null, $mapInfo=null) {
82
 	$this->_recordSet = $recordSet;
83
 	$this->_fieldNames = $fieldNames;
84
 	$this->_mapInfo = $mapInfo;
85
@@ -1579,7 +1579,7 @@ class GallerySqlFragment {
86
      * @param array $values values.. variable number of parameters must match
87
      *                        number of ? markers in sql fragment
88
      */
89
-    function GallerySqlFragment($fragment, $values) {
90
+    function __construct($fragment, $values) {
91
 	$this->_values = func_get_args();
92
 	$this->_fragment = array_shift($this->_values);
93
     }
94
@@ -1669,8 +1669,8 @@ function GalleryAdodbErrorHandler($dbms, $fn, $errno, $errmsg, $p1=false, $p2=fa
95
  */
96
 class MySqlStorage extends GalleryStorage {
97
 
98
-    function MySqlStorage($config) {
99
-	$this->GalleryStorage($config);
100
+    function __construct($config) {
101
+	parent::__construct($config);
102
 	if ($this->_type != 'mysql' /* mysqlt and mysqli are transactional */) {
103
 	    $this->_isTransactional = true;
104
 	}
105
--- modules/core/classes/GalleryStorage/GalleryStorageExtras.class
106
+++ modules/core/classes/GalleryStorage/GalleryStorageExtras.class
107
@@ -30,7 +30,7 @@ class GalleryStorageExtras /* the other half of GalleryStorage */ {
108
     /**
109
      * @param GalleryStorage $galleryStorage the database storage instance
110
      */
111
-    function GalleryStorageExtras(&$galleryStorage) {
112
+    function __construct(&$galleryStorage) {
113
 	$this->_gs =& $galleryStorage;
114
     }
115
 
116
--- modules/core/classes/GalleryTranslator.class
117
+++ modules/core/classes/GalleryTranslator.class
118
@@ -58,7 +58,7 @@ class GalleryTranslator {
119
     var $_isRightToLeft;
120
 
121
 
122
-    function GalleryTranslator() {
123
+    function __construct() {
124
 	$this->_boundDomains = array();
125
     }
126
 
127
--- modules/core/module.inc
128
+++ modules/core/module.inc
129
@@ -26,7 +26,7 @@
130
  */
131
 class CoreModule extends GalleryModule {
132
 
133
-    function CoreModule() {
134
+    function __construct() {
135
 	global $gallery;
136
 
137
 	$this->setId('core');
(-)gallery2-php7/files/patch-gregstoll-9e53f0fc (+14 lines)
Line 0 Link Here
1
Obtained from:	https://github.com/gregstoll/gallery2/commit/9e53f0fc6e5d2e0761c70ccd051c280c9caf78cc
2
3
--- modules/core/classes/GalleryEvent.class.orig	2008-04-13 12:38:13.000000000 +1200
4
+++ modules/core/classes/GalleryEvent.class	2019-05-20 13:56:23.109728000 +1200
5
@@ -51,7 +51,8 @@
6
 
7
     function GalleryEvent() {
8
 	$this->setEventName(null);
9
-	$this->setEntity($null=null);
10
+	$null = null;
11
+	$this->setEntity($null);
12
 	$this->setData(null);
13
     }
14
 
(-)gallery2-php7/files/patch-gregstoll-a0af18a5 (+979 lines)
Line 0 Link Here
1
Obtained from:	https://github.com/gregstoll/gallery2/commit/a0a5f18a5558e1ae101234249ea368471b45910e
2
3
--- modules/albumselect/module.inc.orig
4
--- modules/albumselect/module.inc
5
@@ -58,7 +58,7 @@ class AlbumSelectModule extends GalleryModule {
6
     /**
7
      * @see GalleryModule::upgrade
8
      */
9
-    function upgrade($currentVersion) {
10
+    function upgrade($currentVersion, $statusMonitor=null) {
11
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'albumselect');
12
 	if ($ret) {
13
 	    return $ret;
14
--- modules/archiveupload/module.inc.orig
15
--- modules/archiveupload/module.inc
16
@@ -45,7 +45,7 @@ class ArchiveUploadModule extends GalleryModule {
17
     /**
18
      * @see GalleryModule::upgrade
19
      */
20
-    function upgrade($currentVersion) {
21
+    function upgrade($currentVersion, $statusMonitor=null) {
22
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'archiveupload');
23
 	if ($ret) {
24
 	    return $ret;
25
--- modules/captcha/module.inc.orig
26
--- modules/captcha/module.inc
27
@@ -65,7 +65,7 @@ class CaptchaModule extends GalleryModule {
28
     /**
29
      * @see GalleryModule::upgrade
30
      */
31
-    function upgrade($currentVersion) {
32
+    function upgrade($currentVersion, $statusMonitor=null) {
33
 
34
 	switch ($currentVersion) {
35
 	case '':
36
--- modules/cart/module.inc.orig
37
--- modules/cart/module.inc
38
@@ -44,7 +44,7 @@ class CartModule extends GalleryModule {
39
     /**
40
      * @see GalleryModule::upgrade
41
      */
42
-    function upgrade($currentVersion) {
43
+    function upgrade($currentVersion, $statusMonitor=null) {
44
 	global $gallery;
45
 
46
 	if (empty($currentVersion)) {
47
@@ -148,7 +148,7 @@ class CartModule extends GalleryModule {
48
     /**
49
      * @see GalleryModule::getItemLinks
50
      */
51
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
52
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
53
 	$links = array();
54
 	foreach ($items as $item) {
55
 	    if (isset($permissions[$item->getId()]['cart.add'])) {
56
--- modules/comment/module.inc.orig
57
--- modules/comment/module.inc
58
@@ -52,7 +52,7 @@ class CommentModule extends GalleryModule {
59
     /**
60
      * @see GalleryModule::upgrade
61
      */
62
-    function upgrade($currentVersion) {
63
+    function upgrade($currentVersion, $statusMonitor=null) {
64
 	global $gallery;
65
 	$storage =& $gallery->getStorage();
66
 
67
@@ -251,7 +251,7 @@ class CommentModule extends GalleryModule {
68
     /**
69
      * @see GalleryModule::getItemLinks
70
      */
71
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
72
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
73
 	list ($ret, $showAll) = $this->getParameter('comments.latest');
74
 	if ($ret) {
75
 	    return array($ret, null);
76
--- modules/core/CombinedJavascript.inc.orig
77
--- modules/core/CombinedJavascript.inc
78
@@ -37,7 +37,7 @@ class CombinedJavascriptView extends GalleryView {
79
     /**
80
      * @see GalleryView::renderImmediate
81
      */
82
-    function renderImmediate() {
83
+    function renderImmediate($status, $error) {
84
 	global $gallery;
85
 	$platform =& $gallery->getPlatform();
86
 	$phpVm = $gallery->getPhpVm();
87
--- modules/core/ItemAddFromBrowser.inc.orig
88
--- modules/core/ItemAddFromBrowser.inc
89
@@ -30,7 +30,7 @@ class ItemAddFromBrowser extends ItemAddPlugin {
90
     /**
91
      * @see ItemAddPlugin::handleRequest
92
      */
93
-    function handleRequest($form, &$item) {
94
+    function handleRequest($form, &$item, &$addController=null) {
95
 	global $gallery;
96
 
97
 	$status = array();
98
--- modules/core/classes/GalleryAlbumItem.class.orig
99
--- modules/core/classes/GalleryAlbumItem.class
100
@@ -84,7 +84,7 @@ class GalleryAlbumItem extends GalleryItem {
101
      * @param int $parentId the id of the parent of this object
102
      * @return GalleryStatus a status code
103
      */
104
-    function create($parentId, $albumName) {
105
+    function create($parentId=false, $albumName=false, $canContainChildren = false) {
106
 	global $gallery;
107
 
108
 	if (empty($albumName) || empty($parentId)) {
109
@@ -247,7 +247,7 @@ class GalleryAlbumItem extends GalleryItem {
110
     /**
111
      * @see GalleryItem::save()
112
      */
113
-    function save($postEvent=true) {
114
+    function save($postEvent=true, $setAclId=null) {
115
 	global $gallery;
116
 	$session =& $gallery->getSession();
117
 
118
--- modules/core/classes/GalleryChildEntity.class.orig
119
--- modules/core/classes/GalleryChildEntity.class
120
@@ -59,7 +59,7 @@ class GalleryChildEntity extends GalleryEntity {
121
      * @param int $parentId the id of the GalleryItem parent
122
      * @return GalleryStatus a status code
123
      */
124
-    function create($parentId) {
125
+    function create($parentId=false) {
126
 	global $gallery;
127
 
128
 	if (empty($parentId)) {
129
--- modules/core/classes/GalleryDataCache.class.orig
130
--- modules/core/classes/GalleryDataCache.class
131
@@ -546,7 +546,7 @@ class GalleryDataCache {
132
 	    return;
133
 	}
134
 
135
-	$permissions = $session->get('permissionCache');
136
+	$permissions = (array)$session->get('permissionCache');
137
 	/*
138
 	 * Since we add all new data to the head of the list, the odds are good
139
 	 * that we should find our answer in the first iteration of this loop.
140
--- modules/core/classes/GalleryDataItem.class.orig
141
--- modules/core/classes/GalleryDataItem.class
142
@@ -112,7 +112,7 @@ class GalleryDataItem extends GalleryItem {
143
      *        of copy (default is false).
144
      * @return GalleryStatus a status code
145
      */
146
-    function create($parentId, $inputFileName, $mimeType, $targetName=null, $symlink=false) {
147
+    function create($parentId=false, $inputFileName=false, $mimeType=false, $targetName=null, $symlink=false) {
148
 	global $gallery;
149
 	$platform =& $gallery->getPlatform();
150
 
151
--- modules/core/classes/GalleryDerivative.class.orig
152
--- modules/core/classes/GalleryDerivative.class
153
@@ -211,7 +211,7 @@ class GalleryDerivative extends GalleryChildEntity {
154
      * @param int $parentId the id of the parent GalleryItem
155
      * @return GalleryStatus a status code
156
      */
157
-    function create($parentId) {
158
+    function create($parentId=null) {
159
 	$ret = parent::create($parentId);
160
 	if ($ret) {
161
 	    return $ret;
162
--- modules/core/classes/GalleryDerivativeImage.class.orig
163
--- modules/core/classes/GalleryDerivativeImage.class
164
@@ -78,7 +78,7 @@ class GalleryDerivativeImage extends GalleryDerivative {
165
      * @param int $derivativeType the type of derivative image
166
      * @return GalleryStatus a status code
167
      */
168
-    function create($parentId, $derivativeType) {
169
+    function create($parentId=null, $derivativeType=null) {
170
 	global $gallery;
171
 	$parentId = (int)$parentId;
172
 
173
--- modules/core/classes/GalleryEntity.class.orig
174
--- modules/core/classes/GalleryEntity.class
175
@@ -214,7 +214,7 @@ class GalleryEntity extends GalleryPersistent {
176
      * @return array GalleryStatus a status code
177
      *               GalleryItem the linked item
178
      */
179
-    function createLink($entity) {
180
+    function createLink($entity, $parentId) {
181
 	global $gallery;
182
 
183
 	if (get_class($this) != get_class($entity)) {
184
--- modules/core/classes/GalleryFileSystemEntity.class.orig
185
--- modules/core/classes/GalleryFileSystemEntity.class
186
@@ -70,8 +70,8 @@ class GalleryFileSystemEntity extends GalleryChildEntity {
187
      *        Defaults to false.
188
      * @return GalleryStatus a status code
189
      */
190
-    function create($parentId, $pathComponent, $isDirectory=false) {
191
-	if (empty($pathComponent)) {
192
+    function create($parentId=false, $pathComponent=false, $isDirectory=false) {
193
+	if (empty($parentId) || empty($pathComponent)) {
194
 	    return GalleryCoreApi::error(ERROR_BAD_PARAMETER);
195
 	}
196
 
197
--- modules/core/classes/GalleryItem.class.orig
198
--- modules/core/classes/GalleryItem.class
199
@@ -173,7 +173,7 @@ class GalleryItem extends GalleryFileSystemEntity {
200
      *        Defaults to false.
201
      * @return GalleryStatus a status code
202
      */
203
-    function create($parentId, $path, $canContainChildren=false) {
204
+    function create($parentId=null, $path=null, $canContainChildren=false) {
205
 	global $gallery;
206
 
207
 	if (!isset($path) || !isset($parentId)) {
208
@@ -393,7 +393,7 @@ class GalleryItem extends GalleryFileSystemEntity {
209
      *
210
      * @return GalleryStatus a status code
211
      */
212
-    function save($postEvent=true) {
213
+    function save($postEvent=true, $setAclId=null) {
214
 	global $gallery;
215
 	$isNew = $this->testPersistentFlag(STORAGE_FLAG_NEWLY_CREATED);
216
 
217
--- modules/core/classes/GalleryMovieItem.class.orig
218
--- modules/core/classes/GalleryMovieItem.class
219
@@ -108,7 +108,7 @@ class GalleryMovieItem extends GalleryDataItem {
220
      *        of copy (default is false).
221
      * @return GalleryStatus a status code
222
      */
223
-    function create($parentId, $videoFileName, $mimeType, $targetName=null, $symlink=false) {
224
+    function create($parentId=false, $videoFileName=false, $mimeType=false, $targetName=null, $symlink=false) {
225
 	global $gallery;
226
 	$platform =& $gallery->getPlatform();
227
 
228
--- modules/core/classes/GalleryPersistent.class.orig
229
--- modules/core/classes/GalleryPersistent.class
230
@@ -37,7 +37,7 @@ class GalleryPersistent {
231
     var $_persistentStatus;
232
 
233
 
234
-    function GalleryPersistent() {
235
+    function __construct() {
236
 	/* Initialize our persistent info tracker */
237
 	$this->_persistentStatus['flags'] = 0;
238
 	$this->_persistentStatus['originalValue'] = array();
239
--- modules/core/classes/GalleryPhotoItem.class.orig
240
--- modules/core/classes/GalleryPhotoItem.class
241
@@ -86,7 +86,7 @@ class GalleryPhotoItem extends GalleryDataItem {
242
      *        of copy (default is false).
243
      * @return GalleryStatus a status code
244
      */
245
-    function create($parentId, $imageFileName, $mimeType, $targetName=null, $symlink=false) {
246
+    function create($parentId=null, $imageFileName=false, $mimeType=false, $targetName=null, $symlink=false) {
247
 	global $gallery;
248
 	$platform =& $gallery->getPlatform();
249
 
250
--- modules/core/classes/GalleryPlugin.class.orig
251
--- modules/core/classes/GalleryPlugin.class
252
@@ -591,7 +591,7 @@ class GalleryPlugin {
253
      * @return GalleryStatus a status code
254
      * @access protected
255
      */
256
-    function upgrade($currentVersion) {
257
+    function upgrade($currentVersion, $statusMonitor=null) {
258
 	return null;
259
     }
260
 
261
--- modules/core/classes/GalleryUser.class.orig
262
--- modules/core/classes/GalleryUser.class
263
@@ -123,7 +123,7 @@ class GalleryUser extends GalleryEntity {
264
      *
265
      * @return GalleryStatus a status code
266
      */
267
-    function create($userName) {
268
+    function create($userName='') {
269
 	global $gallery;
270
 
271
 	$query = '
272
@@ -212,7 +212,7 @@ class GalleryUser extends GalleryEntity {
273
      *
274
      * @return GalleryStatus a status code
275
      */
276
-    function save($postEvent=true) {
277
+    function save($postEvent=true, $setAclId=null) {
278
 	$isNew = $this->testPersistentFlag(STORAGE_FLAG_NEWLY_CREATED);
279
 
280
 	$ret = parent::save($postEvent);
281
--- modules/core/module.inc.orig
282
--- modules/core/module.inc
283
@@ -481,7 +481,7 @@ class CoreModule extends GalleryModule {
284
      *
285
      * @see GalleryModule::install
286
      */
287
-    function upgrade($currentVersion, $statusMonitor) {
288
+    function upgrade($currentVersion, $statusMonitor=null) {
289
 	GalleryCoreApi::requireOnce('modules/core/CoreModuleExtras.inc');
290
 	$ret = CoreModuleExtras::upgrade($this, $currentVersion, $statusMonitor);
291
 	if ($ret) {
292
--- modules/customfield/module.inc.orig
293
--- modules/customfield/module.inc
294
@@ -46,7 +46,7 @@ class CustomFieldModule extends GalleryModule {
295
     /**
296
      * @see GalleryModule::upgrade
297
      */
298
-    function upgrade($currentVersion) {
299
+    function upgrade($currentVersion, $statusMonitor=null) {
300
 	global $gallery;
301
 
302
 	if (!empty($currentVersion) && version_compare($currentVersion, '1.0.1', '<')) {
303
--- modules/digibug/module.inc.orig
304
--- modules/digibug/module.inc
305
@@ -44,7 +44,7 @@ class DigibugModule extends GalleryModule {
306
     /**
307
      * @see GalleryModule::upgrade
308
      */
309
-    function upgrade($currentVersion) {
310
+    function upgrade($currentVersion, $statusMonitor=null) {
311
 	global $gallery;
312
 	if (!isset($currentVersion)) {
313
 	    $currentVersion = '0';
314
--- modules/dynamicalbum/module.inc.orig
315
--- modules/dynamicalbum/module.inc
316
@@ -44,7 +44,7 @@ class DynamicAlbumModule extends GalleryModule {
317
     /**
318
      * @see GalleryModule::upgrade
319
      */
320
-    function upgrade($currentVersion) {
321
+    function upgrade($currentVersion, $statusMonitor=null) {
322
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'dynamicalbum');
323
 	if ($ret) {
324
 	    return $ret;
325
@@ -99,7 +99,7 @@ class DynamicAlbumModule extends GalleryModule {
326
     /**
327
      * @see GalleryModule::getItemLinks
328
      */
329
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
330
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
331
 	$links = array();
332
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'dynamicalbum');
333
 	if ($ret) {
334
--- modules/ecard/module.inc.orig
335
--- modules/ecard/module.inc
336
@@ -45,7 +45,7 @@ class EcardModule extends GalleryModule {
337
     /**
338
      * @see GalleryModule::upgrade
339
      */
340
-    function upgrade($currentVersion) {
341
+    function upgrade($currentVersion, $statusMonitor=null) {
342
 	global $gallery;
343
 	if (!isset($currentVersion)) {
344
 	    $currentVersion = '0';
345
@@ -127,7 +127,7 @@ class EcardModule extends GalleryModule {
346
     /**
347
      * @see GalleryModule::getItemLinks
348
      */
349
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
350
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
351
 	$links = array();
352
 	foreach ($items as $item) {
353
 	    $itemId = $item->getId();
354
--- modules/exif/classes/ExifHelper.class.orig
355
--- modules/exif/classes/ExifHelper.class
356
@@ -333,7 +333,9 @@ class ExifHelper {
357
 	     * decimal separator, but it does not accept '21,3725' as argument. Weird, but it's
358
 	     * like that.
359
 	     */
360
-	    $value = preg_replace('/(\d*)[\.,](\d{3,})/e', 'sprintf(\'%.2f\', $1.$2)', $value);
361
+//	    $value = preg_replace('/(\d*)[\.,](\d{3,})/e', 'sprintf(\'%.2f\', $1.$2)', $value);
362
+	    $value = preg_replace_callback('/(\d*)[\.,](\d{3,})/',
363
+					   function($m) {return sprintf('%.2f', $m[0].$m[1]);}, $value);		
364
 	    break;
365
 	}
366
 
367
--- modules/exif/module.inc.orig
368
--- modules/exif/module.inc
369
@@ -48,7 +48,7 @@ class ExifModule extends GalleryModule {
370
     /**
371
      * @see GalleryModule::upgrade
372
      */
373
-    function upgrade($currentVersion) {
374
+    function upgrade($currentVersion, $statusMonitor=null) {
375
 	global $gallery;
376
 
377
 	if (!isset($currentVersion)) {
378
--- modules/ffmpeg/module.inc.orig
379
--- modules/ffmpeg/module.inc
380
@@ -46,7 +46,7 @@ class FfmpegModule extends GalleryModule {
381
     /**
382
      * @see GalleryModule::upgrade
383
      */
384
-    function upgrade($currentVersion) {
385
+    function upgrade($currentVersion, $statusMonitor=null) {
386
 	global $gallery;
387
 	$platform =& $gallery->getPlatform();
388
 
389
--- modules/fotokasten/module.inc.orig
390
--- modules/fotokasten/module.inc
391
@@ -47,7 +47,7 @@ class FotokastenModule extends GalleryModule {
392
     /**
393
      * @see GalleryModule::upgrade
394
      */
395
-    function upgrade($currentVersion) {
396
+    function upgrade($currentVersion, $statusMonitor=null) {
397
 	global $gallery;
398
 
399
 	list ($ret, $params) =
400
@@ -119,7 +119,7 @@ class FotokastenModule extends GalleryModule {
401
     /**
402
      * @see GalleryModule::getItemLinks
403
      */
404
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
405
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
406
 	global $gallery;
407
 	$session =& $gallery->getSession();
408
 
409
--- modules/gd/classes/GdToolkit.class.orig
410
--- modules/gd/classes/GdToolkit.class
411
@@ -524,7 +524,7 @@ class GdToolkit extends GalleryToolkit {
412
 	    if ($ret) {
413
 		return array($ret, null);
414
 	    }
415
-	    $ret = $gd->imageJpeg($tmpRes, $tmpFile);
416
+	    $ret = $gd->imageJpeg($tmpRes, $tmpFile, -1);
417
 	    if ($ret) {
418
 		return array($ret, null);
419
 	    }
420
--- modules/gd/module.inc.orig
421
--- modules/gd/module.inc
422
@@ -46,7 +46,7 @@ class GdModule extends GalleryModule {
423
     /**
424
      * @see GalleryModule::upgrade
425
      */
426
-    function upgrade($currentVersion) {
427
+    function upgrade($currentVersion, $statusMonitor=null) {
428
 	if (!isset($currentVersion)) {
429
 	    /* Initial install */
430
 	    $ret = $this->setParameter('jpegQuality', '75');
431
--- modules/getid3/module.inc.orig
432
--- modules/getid3/module.inc
433
@@ -46,7 +46,7 @@ class Getid3Module extends GalleryModule {
434
     /**
435
      * @see GalleryModule::upgrade
436
      */
437
-    function upgrade($currentVersion) {
438
+    function upgrade($currentVersion, $statusMonitor=null) {
439
 	global $gallery;
440
 
441
 	if (!isset($currentVersion)) {
442
--- modules/hidden/module.inc.orig
443
--- modules/hidden/module.inc
444
@@ -48,7 +48,7 @@ class HiddenModule extends GalleryModule /* and GalleryEventListener */ {
445
     /**
446
      * @see GalleryModule::upgrade
447
      */
448
-    function upgrade($currentVersion, $statusMonitor) {
449
+    function upgrade($currentVersion, $statusMonitor=null) {
450
 	global $gallery;
451
 	$storage =& $gallery->getStorage();
452
 
453
--- modules/httpauth/module.inc.orig
454
--- modules/httpauth/module.inc
455
@@ -116,7 +116,7 @@ class HttpAuthModule extends GalleryModule /* and GalleryEventListener */ {
456
     /**
457
      * @see GalleryModule::upgrade
458
      */
459
-    function upgrade($currentVersion) {
460
+    function upgrade($currentVersion, $statusMonitor=null) {
461
 	switch ($currentVersion) {
462
 	case null:
463
 	    /* Initial install */
464
--- modules/icons/module.inc.orig
465
--- modules/icons/module.inc
466
@@ -43,7 +43,7 @@ class IconsModule extends GalleryModule {
467
     /**
468
      * @see GalleryModule::upgrade
469
      */
470
-    function upgrade($currentVersion) {
471
+    function upgrade($currentVersion, $statusMonitor=null) {
472
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'icons');
473
 	if ($ret) {
474
 	    return $ret;
475
--- modules/imageblock/module.inc.orig
476
--- modules/imageblock/module.inc
477
@@ -64,7 +64,7 @@ class ImageBlockModule extends GalleryModule {
478
     /**
479
      * @see GalleryModule::upgrade
480
      */
481
-    function upgrade($currentVersion) {
482
+    function upgrade($currentVersion, $statusMonitor=null) {
483
 	global $gallery;
484
 	$storage =& $gallery->getStorage();
485
 
486
--- modules/imagemagick/module.inc.orig
487
--- modules/imagemagick/module.inc
488
@@ -47,7 +47,7 @@ class ImageMagickModule extends GalleryModule {
489
     /**
490
      * @see GalleryModule::upgrade
491
      */
492
-    function upgrade($currentVersion) {
493
+    function upgrade($currentVersion, $statusMonitor=null) {
494
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'imagemagick');
495
 	if ($ret) {
496
 	    return $ret;
497
--- modules/itemadd/module.inc.orig
498
--- modules/itemadd/module.inc
499
@@ -73,7 +73,7 @@ class ItemAddModule extends GalleryModule {
500
     /**
501
      * @see GalleryModule::upgrade
502
      */
503
-    function upgrade($currentVersion) {
504
+    function upgrade($currentVersion, $statusMonitor=null) {
505
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'itemadd');
506
 	if ($ret) {
507
 	    return $ret;
508
--- modules/keyalbum/module.inc.orig
509
--- modules/keyalbum/module.inc
510
@@ -43,7 +43,7 @@ class KeyAlbumModule extends GalleryModule {
511
     /**
512
      * @see GalleryModule::upgrade
513
      */
514
-    function upgrade($currentVersion) {
515
+    function upgrade($currentVersion, $statusMonitor=null) {
516
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'keyalbum');
517
 	if ($ret) {
518
 	    return $ret;
519
--- modules/linkitem/ItemAddLinkItem.inc.orig
520
--- modules/linkitem/ItemAddLinkItem.inc
521
@@ -30,7 +30,7 @@ class ItemAddLinkItem extends ItemAddPlugin {
522
     /**
523
      * @see ItemAddPlugin::handleRequest
524
      */
525
-    function handleRequest($form, &$item) {
526
+    function handleRequest($form, &$item, &$addController=null) {
527
 	global $gallery;
528
 
529
 	$status = $error = array();
530
--- modules/linkitem/module.inc.orig
531
--- modules/linkitem/module.inc
532
@@ -41,7 +41,7 @@ class LinkItemModule extends GalleryModule /* and GalleryEventListener */ {
533
     /**
534
      * @see GalleryModule::upgrade
535
      */
536
-    function upgrade($currentVersion) {
537
+    function upgrade($currentVersion, $statusMonitor=null) {
538
 	global $gallery;
539
 	$platform =& $gallery->getPlatform();
540
 	$slash = $platform->getDirectorySeparator();
541
--- modules/members/module.inc.orig
542
--- modules/members/module.inc
543
@@ -43,7 +43,7 @@ class MembersModule extends GalleryModule {
544
     /**
545
      * @see GalleryModule::upgrade
546
      */
547
-    function upgrade($currentVersion) {
548
+    function upgrade($currentVersion, $statusMonitor=null) {
549
 	if (!isset($currentVersion)) {
550
 	    list ($ret, $viewSelectedGroupId) =
551
 		GalleryCoreApi::getPluginParameter('module', 'core', 'id.everybodyGroup');
552
--- modules/migrate/module.inc.orig
553
--- modules/migrate/module.inc
554
@@ -48,7 +48,7 @@ class MigrateModule extends GalleryModule /* and GalleryEventListener */ {
555
      * We pushed all this code into its own file since we need it very rarely so it doesn't
556
      * make sense to load it every single time.
557
      */
558
-    function upgrade($currentVersion, $statusMonitor) {
559
+    function upgrade($currentVersion, $statusMonitor=null) {
560
 	global $gallery;
561
 	$storage =& $gallery->getStorage();
562
 
563
--- modules/mime/module.inc.orig
564
--- modules/mime/module.inc
565
@@ -68,7 +68,7 @@ class MimeModule extends GalleryModule {
566
     /**
567
      * @see GalleryModule::upgrade
568
      */
569
-    function upgrade($currentVersion) {
570
+    function upgrade($currentVersion, $statusMonitor=null) {
571
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'mime');
572
 	if ($ret) {
573
 	    return $ret;
574
--- modules/multilang/module.inc.orig
575
--- modules/multilang/module.inc
576
@@ -44,7 +44,7 @@ class MultiLangModule extends GalleryModule /* and GalleryEventListener */ {
577
     /**
578
      * @see GalleryModule::upgrade
579
      */
580
-    function upgrade($currentVersion) {
581
+    function upgrade($currentVersion, $statusMonitor=null) {
582
 	if (!isset($currentVersion)) {
583
 	    $ret = $this->setParameter('languages', '');
584
 	    if ($ret) {
585
--- modules/netpbm/module.inc.orig
586
--- modules/netpbm/module.inc
587
@@ -44,7 +44,7 @@ class NetPbmModule extends GalleryModule {
588
     /**
589
      * @see GalleryModule::upgrade
590
      */
591
-    function upgrade($currentVersion) {
592
+    function upgrade($currentVersion, $statusMonitor=null) {
593
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'netpbm');
594
 	if ($ret) {
595
 	    return $ret;
596
--- modules/newitems/module.inc.orig
597
--- modules/newitems/module.inc
598
@@ -46,7 +46,7 @@ class NewItemsModule extends GalleryModule {
599
     /**
600
      * @see GalleryModule::upgrade
601
      */
602
-    function upgrade($currentVersion) {
603
+    function upgrade($currentVersion, $statusMonitor=null) {
604
 	if (!isset($currentVersion)) {
605
 	    foreach (array('days.new' => '7',
606
 			   'days.updated' => '7' )
607
--- modules/notification/module.inc.orig
608
--- modules/notification/module.inc
609
@@ -219,7 +219,7 @@ class NotificationModule extends GalleryModule {
610
     /**
611
      * @see GalleryModule::upgrade
612
      */
613
-    function upgrade($currentVersion, $statusMonitor) {
614
+    function upgrade($currentVersion, $statusMonitor=null) {
615
 	global $gallery;
616
 	$storage =& $gallery->getStorage();
617
 
618
--- modules/panorama/module.inc.orig
619
--- modules/panorama/module.inc
620
@@ -46,7 +46,7 @@ class PanoramaModule extends GalleryModule {
621
     /**
622
      * @see GalleryModule::upgrade
623
      */
624
-    function upgrade($currentVersion) {
625
+    function upgrade($currentVersion, $statusMonitor=null) {
626
 	if (!isset($currentVersion)) {
627
 	    /* Initial install */
628
 	    foreach (array('itemType' => 1,
629
@@ -103,7 +103,7 @@ class PanoramaModule extends GalleryModule {
630
     /**
631
      * @see GalleryModule::getItemLinks
632
      */
633
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
634
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
635
 	$links = array();
636
 
637
 	list ($ret, $param) = GalleryCoreApi::fetchAllPluginParameters('module', 'panorama');
638
--- modules/password/module.inc.orig
639
--- modules/password/module.inc
640
@@ -48,7 +48,7 @@ class PasswordModule extends GalleryModule /* and GalleryEventListener */ {
641
     /**
642
      * @see GalleryModule::upgrade
643
      */
644
-    function upgrade($currentVersion) {
645
+    function upgrade($currentVersion, $statusMonitor=null) {
646
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'password');
647
 	if ($ret) {
648
 	    return $ret;
649
--- modules/permalinks/module.inc.orig
650
--- modules/permalinks/module.inc
651
@@ -48,7 +48,7 @@ class PermalinksModule extends GalleryModule /* and GalleryEventListener */ {
652
     /**
653
      * @see GalleryModule::upgrade
654
      */
655
-    function upgrade($currentVersion) {
656
+    function upgrade($currentVersion, $statusMonitor=null) {
657
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'permalinks');
658
 	if ($ret) {
659
 	    return $ret;
660
--- modules/photoaccess/module.inc.orig
661
--- modules/photoaccess/module.inc
662
@@ -44,7 +44,7 @@ class PhotoAccessModule extends GalleryModule {
663
     /**
664
      * @see GalleryModule::upgrade
665
      */
666
-    function upgrade($currentVersion) {
667
+    function upgrade($currentVersion, $statusMonitor=null) {
668
 	global $gallery;
669
 	if (!isset($currentVersion)) {
670
 	    $currentVersion = '0';
671
@@ -135,7 +135,7 @@ class PhotoAccessModule extends GalleryModule {
672
     /**
673
      * @see GalleryModule::getItemLinks
674
      */
675
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
676
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
677
 	$links = array();
678
 
679
 	foreach ($items as $item) {
680
--- modules/picasa/ItemAddFromPicasa.inc.orig
681
--- modules/picasa/ItemAddFromPicasa.inc
682
@@ -30,7 +30,7 @@ class ItemAddFromPicasa extends ItemAddPlugin {
683
     /**
684
      * @see ItemAddPlugin::handleRequest
685
      */
686
-    function handleRequest($form, &$item) {
687
+    function handleRequest($form, &$item, &$addController=null) {
688
 	global $gallery;
689
 	GalleryCoreApi::requireOnce('modules/picasa/classes/Picasa2DataParser.class');
690
 	GalleryCoreApi::requireOnce('modules/picasa/classes/PicasaImportHelper.class');
691
--- modules/quotas/module.inc.orig
692
--- modules/quotas/module.inc
693
@@ -44,7 +44,7 @@ class QuotasModule extends GalleryModule {
694
     /**
695
      * @see GalleryModule::upgrade
696
      */
697
-    function upgrade($currentVersion) {
698
+    function upgrade($currentVersion, $statusMonitor=null) {
699
 	global $gallery;
700
 
701
 	if (!empty($currentVersion) && version_compare($currentVersion, '1.0.1', '<')) {
702
--- modules/randomhighlight/module.inc.orig
703
--- modules/randomhighlight/module.inc
704
@@ -42,7 +42,7 @@ class RandomHighlightModule extends GalleryModule {
705
     /**
706
      * @see GalleryModule::upgrade
707
      */
708
-    function upgrade($currentVersion) {
709
+    function upgrade($currentVersion, $statusMonitor=null) {
710
 	global $gallery;
711
 
712
 	list ($ret, $params) =
713
--- modules/rating/module.inc.orig
714
--- modules/rating/module.inc
715
@@ -168,7 +168,7 @@ class RatingModule extends GalleryModule {
716
     /**
717
      * @see GalleryModule::upgrade
718
      */
719
-    function upgrade($currentVersion) {
720
+    function upgrade($currentVersion, $statusMonitor=null) {
721
 	global $gallery;
722
 
723
 	if (!isset($currentVersion)) {
724
--- modules/rearrange/module.inc.orig
725
--- modules/rearrange/module.inc
726
@@ -43,7 +43,7 @@ class RearrangeModule extends GalleryModule {
727
     /**
728
      * @see GalleryModule::getItemLinks
729
      */
730
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
731
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
732
 	$links = array();
733
 
734
 	$itemIds = array();
735
--- modules/register/module.inc.orig
736
--- modules/register/module.inc
737
@@ -44,7 +44,7 @@ class RegisterModule extends GalleryModule {
738
     /**
739
      * @see GalleryModule::upgrade
740
      */
741
-    function upgrade($currentVersion) {
742
+    function upgrade($currentVersion, $statusMonitor=null) {
743
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'register');
744
 	if ($ret) {
745
 	    return $ret;
746
--- modules/remote/module.inc.orig
747
--- modules/remote/module.inc
748
@@ -41,7 +41,7 @@ class RemoteModule extends GalleryModule {
749
     /**
750
      * @see GalleryModule::upgrade
751
      */
752
-    function upgrade($currentVersion) {
753
+    function upgrade($currentVersion, $statusMonitor=null) {
754
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'remote');
755
 	if ($ret) {
756
 	    return $ret;
757
--- modules/rewrite/module.inc.orig
758
--- modules/rewrite/module.inc
759
@@ -46,7 +46,7 @@ class RewriteModule extends GalleryModule {
760
     /**
761
      * @see GalleryModule::upgrade
762
      */
763
-    function upgrade($currentVersion) {
764
+    function upgrade($currentVersion, $statusMonitor=null) {
765
 	GalleryCoreApi::requireOnce('modules/rewrite/RewriteModuleExtras.inc');
766
 	$ret = RewriteModuleExtras::upgrade($this, $currentVersion);
767
 	if ($ret) {
768
--- modules/rss/module.inc.orig
769
--- modules/rss/module.inc
770
@@ -192,7 +192,7 @@ class RssModule extends GalleryModule /* and GalleryEventListener */ {
771
     /**
772
      * @see GalleryModule::upgrade
773
      */
774
-    function upgrade($currentVersion) {
775
+    function upgrade($currentVersion, $statusMonitor=null) {
776
 
777
 	/**
778
 	 * @todo add a default to this switch statement and include all historical versions, like
779
--- modules/shutterfly/module.inc.orig
780
--- modules/shutterfly/module.inc
781
@@ -44,7 +44,7 @@ class ShutterflyModule extends GalleryModule {
782
     /**
783
      * @see GalleryModule::upgrade
784
      */
785
-    function upgrade($currentVersion) {
786
+    function upgrade($currentVersion, $statusMonitor=null) {
787
 	global $gallery;
788
 	if (!isset($currentVersion)) {
789
 	    $currentVersion = '0';
790
@@ -137,7 +137,7 @@ class ShutterflyModule extends GalleryModule {
791
     /**
792
      * @see GalleryModule::getItemLinks
793
      */
794
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
795
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
796
 	global $gallery;
797
 	$session =& $gallery->getSession();
798
 
799
--- modules/slideshow/classes/SlideshowHelper.class.orig
800
--- modules/slideshow/classes/SlideshowHelper.class
801
@@ -19,7 +19,7 @@
802
  */
803
 
804
 /** MediaRSS paging items per page */
805
-define('SLIDESHOW_MEDIARSS_ITEMS_PER_PAGE', 25);
806
+define('SLIDESHOW_MEDIARSS_ITEMS_PER_PAGE', 500);
807
 
808
 GalleryCoreApi::requireOnce('modules/slideshow/classes/SlideshowInterface_1_0.class');
809
 
810
--- modules/slideshow/module.inc.orig
811
--- modules/slideshow/module.inc
812
@@ -66,7 +66,7 @@ class SlideshowModule extends GalleryModule {
813
     /**
814
      * @see GalleryModule::upgrade
815
      */
816
-    function upgrade($currentVersion) {
817
+    function upgrade($currentVersion, $statusMonitor=null) {
818
 	global $gallery;
819
 	$platform =& $gallery->getPlatform();
820
 
821
@@ -116,7 +116,7 @@ class SlideshowModule extends GalleryModule {
822
     /**
823
      * @see GalleryModule::getItemLinks
824
      */
825
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
826
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
827
 	global $gallery;
828
 	$urlGenerator =& $gallery->getUrlGenerator();
829
 
830
--- modules/slideshowapplet/module.inc.orig
831
--- modules/slideshowapplet/module.inc
832
@@ -41,7 +41,7 @@ class SlideshowAppletModule extends GalleryModule {
833
     /**
834
      * @see GalleryPlugin::upgrade
835
      */
836
-    function upgrade($currentVersion) {
837
+    function upgrade($currentVersion, $statusMonitor=null) {
838
 	global $gallery;
839
 
840
 	list ($ret, $params) =
841
@@ -90,7 +90,7 @@ class SlideshowAppletModule extends GalleryModule {
842
     /**
843
      * @see GalleryModule::getItemLinks
844
      */
845
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
846
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
847
 	global $gallery;
848
 
849
 	$links = array();
850
--- modules/snapgalaxy/module.inc.orig
851
--- modules/snapgalaxy/module.inc
852
@@ -46,7 +46,7 @@ class SnapGalaxyModule extends GalleryModule {
853
     /**
854
      * @see GalleryModule::upgrade
855
      */
856
-    function upgrade($currentVersion) {
857
+    function upgrade($currentVersion, $statusMonitor=null) {
858
 	global $gallery;
859
 
860
 	if (!isset($currentVersion)) {
861
@@ -116,7 +116,7 @@ class SnapGalaxyModule extends GalleryModule {
862
     /**
863
      * @see GalleryModule::getItemLinks
864
      */
865
-    function getItemLinks($items, $wantsDetailedLinks, $permissions) {
866
+    function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId=null) {
867
 	$links = array();
868
 
869
 	foreach ($items as $item) {
870
--- modules/squarethumb/module.inc.orig
871
--- modules/squarethumb/module.inc
872
@@ -47,7 +47,7 @@ class SquareThumbModule extends GalleryModule /* and GalleryEventListener */ {
873
     /**
874
      * @see GalleryModule::upgrade
875
      */
876
-    function upgrade($currentVersion) {
877
+    function upgrade($currentVersion, $statusMonitor=null) {
878
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'squarethumb');
879
 	if ($ret) {
880
 	    return $ret;
881
--- modules/thumbnail/module.inc.orig
882
--- modules/thumbnail/module.inc
883
@@ -46,7 +46,7 @@ class ThumbnailModule extends GalleryModule {
884
     /**
885
      * @see GalleryModule::upgrade
886
      */
887
-    function upgrade($currentVersion) {
888
+    function upgrade($currentVersion, $statusMonitor=null) {
889
 	GalleryCoreApi::requireOnce('modules/thumbnail/ThumbnailModuleExtras.inc');
890
 	$ret = ThumbnailModuleExtras::upgrade($this, $currentVersion);
891
 	if ($ret) {
892
--- modules/uploadapplet/module.inc.orig
893
--- modules/uploadapplet/module.inc
894
@@ -41,7 +41,7 @@ class UploadAppletModule extends GalleryModule {
895
     /**
896
      * @see GalleryPlugin::upgrade
897
      */
898
-    function upgrade($currentVersion) {
899
+    function upgrade($currentVersion, $statusMonitor=null) {
900
 	global $gallery;
901
 
902
 	list ($ret, $params) =
903
--- modules/useralbum/module.inc.orig
904
--- modules/useralbum/module.inc
905
@@ -57,7 +57,7 @@ class UserAlbumModule extends GalleryModule /* and GalleryEventListener */ {
906
     /**
907
      * @see GalleryModule::upgrade
908
      */
909
-    function upgrade($currentVersion) {
910
+    function upgrade($currentVersion, $statusMonitor=null) {
911
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'useralbum');
912
 	if ($ret) {
913
 	    return $ret;
914
--- modules/watermark/module.inc.orig
915
--- modules/watermark/module.inc
916
@@ -44,7 +44,7 @@ class WatermarkModule extends GalleryModule /* and GalleryEventListener */ {
917
     /**
918
      * @see GalleryModule::upgrade
919
      */
920
-    function upgrade($currentVersion) {
921
+    function upgrade($currentVersion, $statusMonitor=null) {
922
 	global $gallery;
923
 	$platform =& $gallery->getPlatform();
924
 	$slash = $platform->getDirectorySeparator();
925
--- modules/webcam/ItemAddWebCam.inc.orig
926
--- modules/webcam/ItemAddWebCam.inc
927
@@ -30,7 +30,7 @@ class ItemAddWebCam extends ItemAddPlugin {
928
     /**
929
      * @see ItemAddPlugin::handleRequest
930
      */
931
-    function handleRequest($form, &$item) {
932
+    function handleRequest($form, &$item, &$addController=null) {
933
 	global $gallery;
934
 
935
 	$status = $error = array();
936
--- modules/webcam/module.inc.orig
937
--- modules/webcam/module.inc
938
@@ -41,7 +41,7 @@ class WebCamModule extends GalleryModule {
939
     /**
940
      * @see GalleryModule::upgrade
941
      */
942
-    function upgrade($currentVersion) {
943
+    function upgrade($currentVersion, $statusMonitor=null) {
944
 	global $gallery;
945
 
946
 	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'webcam');
947
--- modules/webdav/ItemAddWebDav.inc.orig
948
--- modules/webdav/ItemAddWebDav.inc
949
@@ -33,7 +33,7 @@ class ItemAddWebDav extends ItemAddPlugin {
950
     /**
951
      * @see ItemAddPlugin::handleRequest
952
      */
953
-    function handleRequest($form, &$item) {
954
+    function handleRequest($form, &$item, &$addController=null) {
955
 	$requestMethod = strtolower(GalleryUtilities::getServerVar('REQUEST_METHOD'));
956
 	if ($requestMethod != 'put') {
957
 	    return array(GalleryCoreApi::error(ERROR_REQUEST_FORGED), null, null);
958
--- modules/webdav/module.inc.orig
959
--- modules/webdav/module.inc
960
@@ -64,7 +64,7 @@ class WebDavModule extends GalleryModule /* and GalleryEventListener */ {
961
     /**
962
      * @see GalleryModule::upgrade
963
      */
964
-    function upgrade($currentVersion) {
965
+    function upgrade($currentVersion, $statusMonitor=null) {
966
 	global $gallery;
967
 
968
 	switch ($currentVersion) {
969
--- themes/carbon/theme.inc.orig
970
--- themes/carbon/theme.inc
971
@@ -268,7 +268,7 @@ class CarbonTheme extends GalleryTheme {
972
     /**
973
      * @see GalleryPlugin::upgrade
974
      */
975
-    function upgrade($currentVersion) {
976
+    function upgrade($currentVersion, $statusMonitor=null) {
977
 	if (isset($currentVersion) && version_compare($currentVersion, '1.1.2', '<')) {
978
 	    /* Rename albumBlocks2 and photoBlocks2 */
979
 	    foreach (array('albumBlocks2' => 'albumUpperBlocks',
(-)gallery2-php7/files/patch-gregstoll-b180528e (+572 lines)
Line 0 Link Here
1
Obtained from:  https://github.com/gregstoll/gallery2/commit/b180528e518ecd35c8f47e301db8d816f3ed480d
2
--- lib/adodb/adodb-time.inc.php.orig
3
+++ lib/adodb/adodb-time.inc.php
4
@@ -1006,7 +1006,6 @@ function adodb_tz_offset($gmt,$isphp5)
5
 		return sprintf('%s%02d%02d',($gmt<=0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60); 
6
 	else
7
 		return sprintf('%s%02d%02d',($gmt<0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60); 
8
-	break;
9
 }
10
 
11
 
12
--- lib/adodb/adodb.inc.php.orig
13
+++ lib/adodb/adodb.inc.php
14
@@ -373,7 +373,7 @@
15
 	* All error messages go through this bottleneck function.
16
 	* You can define your own handler by defining the function name in ADODB_OUTP.
17
 	*/
18
-	function outp($msg,$newline=true)
19
+	static function outp($msg,$newline=true)
20
 	{
21
 	global $ADODB_FLUSH,$ADODB_OUTP;
22
 	
23
--- lib/bbcode/stringparser.class.php.orig
24
+++ lib/bbcode/stringparser.class.php
25
@@ -1248,7 +1248,7 @@ class StringParser_Node {
26
 	 * @param object $node The node to destroy
27
 	 * @return bool True on success, else false.
28
 	 */
29
-	function destroyNode (&$node) {
30
+	static function destroyNode (&$node) {
31
 		if ($node === null) {
32
 			return false;
33
 		}
34
--- lib/smarty/Smarty_Compiler.class.php.orig
35
+++ lib/smarty/Smarty_Compiler.class.php
36
@@ -262,12 +262,20 @@ class Smarty_Compiler extends Smarty {
37
         reset($this->_folded_blocks);
38
 
39
         /* replace special blocks by "{php}" */
40
-        $source_content = preg_replace($search.'e', "'"
41
+        $source_content = preg_replace_callback($search, 
42
+                                        function($matches) {
43
+                                            return $this->_quote_replace($this->left_delimiter) . 'php'
44
+                                           . str_repeat("\n", substr_count($matches[0], "\n"))
45
+                                           . $this->_quote_replace($this->right_delimiter);
46
+                                        }
47
+                                       , $source_content);
48
+
49
+        /*$source_content = preg_replace($search.'e', "'"
50
                                        . $this->_quote_replace($this->left_delimiter) . 'php'
51
                                        . "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'"
52
                                        . $this->_quote_replace($this->right_delimiter)
53
                                        . "'"
54
-                                       , $source_content);
55
+                                       , $source_content);*/
56
 
57
         /* Gather all template tags. */
58
         preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match);
59
--- lib/support/GallerySetupUtilities.class.orig
60
+++ lib/support/GallerySetupUtilities.class
61
@@ -54,7 +54,7 @@ class GallerySetupUtilities {
62
      *
63
      * @static
64
      */
65
-    function regenerateSession() {
66
+    static function regenerateSession() {
67
 	/* 1. Generate a new session id */
68
 	$newSessionId = md5(uniqid(substr(rand() . serialize($_REQUEST), 0, 114)));
69
 	$sessionData = array();
70
@@ -84,7 +84,7 @@ class GallerySetupUtilities {
71
      *
72
      * @static
73
      */
74
-    function areCookiesSupported() {
75
+    static function areCookiesSupported() {
76
 	static $areCookiesSupported;
77
 
78
 	/* Remember the state since we might unset $_COOKIE */
79
@@ -101,7 +101,7 @@ class GallerySetupUtilities {
80
      * @return int the number of attempts or false if there was an error
81
      * @static
82
      */
83
-    function getLoginAttempts() {
84
+    static function getLoginAttempts() {
85
 	/* Init if needed (like from lib/support; upgrader already init'ed) */
86
 	global $gallery;
87
 	if (!isset($gallery)) {
88
@@ -139,7 +139,7 @@ class GallerySetupUtilities {
89
      * @return true on success, false on error
90
      * @static
91
      */
92
-    function setLoginAttempts($attempts) {
93
+    static function setLoginAttempts($attempts) {
94
 	/* Init if needed (like from lib/support; upgrader already init'ed) */
95
 	global $gallery;
96
 	if (!isset($gallery)) {
97
@@ -182,7 +182,7 @@ class GallerySetupUtilities {
98
      * @param bool $updateDatabase true if you want to also reset the login attempts (default: true)
99
      * @static
100
      */
101
-    function authenticateThisSession($resetLoginAttempts=true) {
102
+    static function authenticateThisSession($resetLoginAttempts=true) {
103
 	$_SESSION['authenticated'] = true;
104
 	if ($resetLoginAttempts) {
105
 	    GallerySetupUtilities::setLoginAttempts(0);
106
@@ -196,7 +196,7 @@ class GallerySetupUtilities {
107
      * @return true if this session is authenticated
108
      * @static
109
      */
110
-    function isSessionAuthenticated() {
111
+    static function isSessionAuthenticated() {
112
 	return !empty($_SESSION['authenticated']);
113
     }
114
 
115
@@ -205,7 +205,7 @@ class GallerySetupUtilities {
116
      *
117
      * @static
118
      */
119
-    function redirectBackToSelf() {
120
+    static function redirectBackToSelf() {
121
 	require_once(dirname(__FILE__) . '/../../modules/core/classes/GalleryUrlGenerator.class');
122
 	$urlGenerator = new GalleryUrlGenerator();
123
 	$url = $urlGenerator->getCurrentUrl();
124
@@ -224,7 +224,7 @@ class GallerySetupUtilities {
125
      * @return string the path to the config dir
126
      * @static
127
      */
128
-    function getConfigDir() {
129
+    static function getConfigDir() {
130
 	if (defined('GALLERY_CONFIG_DIR')) {
131
 	    return GALLERY_CONFIG_DIR;
132
 	}
133
@@ -237,7 +237,7 @@ class GallerySetupUtilities {
134
      * @return array the config values from config.php
135
      * @static
136
      */
137
-    function getGalleryConfig() {
138
+    static function getGalleryConfig() {
139
 	$gallery = new GallerySetupUtilitiesStub();
140
 
141
 	/* Load config.php */
142
@@ -256,7 +256,7 @@ class GallerySetupUtilities {
143
      * @return string the authentication key
144
      * @static
145
      */
146
-    function getAuthenticationKey() {
147
+    static function getAuthenticationKey() {
148
 	return isset($_SESSION['authKey']) ? $_SESSION['authKey'] : null;
149
     }
150
 
151
@@ -265,7 +265,7 @@ class GallerySetupUtilities {
152
      * @param string $key the authentication key
153
      * @static
154
      */
155
-    function setAuthenticationKey($key) {
156
+    static function setAuthenticationKey($key) {
157
 	$_SESSION['authKey'] = $key;
158
     }
159
 
160
@@ -274,7 +274,7 @@ class GallerySetupUtilities {
161
      * @param string a random value
162
      * @static
163
      */
164
-    function generateAuthenticationKey() {
165
+    static function generateAuthenticationKey() {
166
 	for ($len = 64, $rand='';
167
 	     strlen($rand) < $len;
168
 	     $rand .= chr(!mt_rand(0,2) ? mt_rand(48,57) :
169
@@ -308,7 +308,7 @@ class GallerySetupUtilities {
170
      *
171
      * @static
172
      */
173
-    function startSession() {
174
+    static function startSession() {
175
 	/* Set our own session name */
176
 	if (@ini_get('session.auto_start')) {
177
 	    session_unset();
178
--- modules/core/classes/GalleryCoreApi.class.orig
179
+++ modules/core/classes/GalleryCoreApi.class
180
@@ -295,7 +295,7 @@ class GalleryCoreApi {
181
      * @return array GalleryStatus a status code
182
      *               string a value
183
      */
184
-    function getPluginParameter($pluginType, $pluginId, $parameterName, $itemId=0) {
185
+    static function getPluginParameter($pluginType, $pluginId, $parameterName, $itemId=0) {
186
 	GalleryCoreApi::requireOnce(
187
 	    'modules/core/classes/helpers/GalleryPluginHelper_simple.class');
188
 	return GalleryPluginHelper_simple::getParameter($pluginType, $pluginId,
189
@@ -363,7 +363,7 @@ class GalleryCoreApi {
190
      *						     'requiredModuleApi' => array,
191
      *						     'version' => string)
192
      */
193
-    function fetchPluginStatus($pluginType, $ignoreCache=false) {
194
+    static function fetchPluginStatus($pluginType, $ignoreCache=false) {
195
 	GalleryCoreApi::requireOnce(
196
 	    'modules/core/classes/helpers/GalleryPluginHelper_simple.class');
197
 	return GalleryPluginHelper_simple::fetchPluginStatus($pluginType, $ignoreCache);
198
@@ -376,7 +376,7 @@ class GalleryCoreApi {
199
      * @return array GalleryStatus a status code
200
      *               array of (pluginId => ('active' => boolean))
201
      */
202
-    function fetchPluginList($pluginType) {
203
+    static function fetchPluginList($pluginType) {
204
 	GalleryCoreApi::requireOnce(
205
 	    'modules/core/classes/helpers/GalleryPluginHelper_simple.class');
206
 	return GalleryPluginHelper_simple::fetchPluginList($pluginType);
207
@@ -2355,7 +2355,7 @@ class GalleryCoreApi {
208
      *               mixed one GalleryEntity or an array of GalleryEntities
209
      * @deprecated $requiredEntityType will no longer be optional after the next major API change
210
      */
211
-    function loadEntitiesById($ids, $requiredEntityType=null) {
212
+    static function loadEntitiesById($ids, $requiredEntityType=null) {
213
 	GalleryCoreApi::requireOnce(
214
 	    'modules/core/classes/helpers/GalleryEntityHelper_simple.class');
215
 	return GalleryEntityHelper_simple::loadEntitiesById($ids, $requiredEntityType);
216
@@ -2708,7 +2708,7 @@ class GalleryCoreApi {
217
      * @param string $sourceEncoding source encoding (eg. 'ISO-8859-1'), defaults to system charset
218
      * @return string the result
219
      */
220
-    function convertToUtf8($inputString, $sourceEncoding=null) {
221
+    static function convertToUtf8($inputString, $sourceEncoding=null) {
222
 	GalleryCoreApi::requireOnce(
223
 	    'modules/core/classes/helpers/GalleryCharsetHelper_simple.class');
224
 	return GalleryCharsetHelper_simple::convertToUtf8($inputString, $sourceEncoding);
225
@@ -2734,7 +2734,7 @@ class GalleryCoreApi {
226
      * @param int $length the length of the substring, not optional
227
      * @return string a multibyte safe substring of input value
228
      */
229
-    function utf8Substring($string, $start, $length) {
230
+    static function utf8Substring($string, $start, $length) {
231
 	GalleryCoreApi::requireOnce(
232
 	    'modules/core/classes/helpers/GalleryCharsetHelper_simple.class');
233
 	return GalleryCharsetHelper_simple::utf8Substring($string, $start, $length);
234
@@ -2747,7 +2747,7 @@ class GalleryCoreApi {
235
      * @param int $length the length in bytes (not in characters), not optional
236
      * @return string a multibyte safe substring of input value
237
      */
238
-    function utf8Strcut($string, $start, $length) {
239
+    static function utf8Strcut($string, $start, $length) {
240
 	GalleryCoreApi::requireOnce(
241
 	    'modules/core/classes/helpers/GalleryCharsetHelper_simple.class');
242
 	return GalleryCharsetHelper_simple::utf8Strcut($string, $start, $length);
243
@@ -2817,7 +2817,7 @@ class GalleryCoreApi {
244
      * @param string $file
245
      * @param boolean $skipBaseDirectoryDetection deprecated
246
      */
247
-    function requireOnce($file, $skipBaseDirectoryDetection=false) {
248
+    static function requireOnce($file, $skipBaseDirectoryDetection=false) {
249
 	static $loaded;
250
 	if (!isset($loaded[$file])) {
251
 	    $loaded[$file] = 1;
252
--- modules/core/classes/GalleryDataCache.class.orig
253
+++ modules/core/classes/GalleryDataCache.class
254
@@ -40,7 +40,7 @@ class GalleryDataCache {
255
      * @staticvar cache the singleton cache
256
      * @access private
257
      */
258
-    function &_getCache() {
259
+    static function &_getCache() {
260
 	static $cache;
261
 	if (!isset($cache)) {
262
 	    $cache['maxKeys'] = 800;
263
@@ -81,7 +81,7 @@ class GalleryDataCache {
264
      * @param mixed $data
265
      * @param boolean $protected should this key survive a reset call?
266
      */
267
-    function put($key, $data, $protected=false) {
268
+    static function put($key, $data, $protected=false) {
269
 	$cache =& GalleryDataCache::_getCache();
270
 	if (!$cache['memoryCacheEnabled']) {
271
 	    return;
272
@@ -182,7 +182,7 @@ class GalleryDataCache {
273
      * @param string $key
274
      * @return mixed the cached data
275
      */
276
-    function get($key) {
277
+    static function get($key) {
278
 	$cache =& GalleryDataCache::_getCache();
279
 	if (!$cache['memoryCacheEnabled']) {
280
 	    return null;
281
@@ -199,7 +199,7 @@ class GalleryDataCache {
282
      * @param string $key
283
      * @return boolean true if the cache contains the key given
284
      */
285
-    function containsKey($key) {
286
+    static function containsKey($key) {
287
 	$cache =& GalleryDataCache::_getCache();
288
 	if (!$cache['memoryCacheEnabled']) {
289
 	    return false;
290
@@ -268,7 +268,7 @@ class GalleryDataCache {
291
      * @param array $pathInfo the path info
292
      * @return mixed object data
293
      */
294
-    function &getFromDisk($pathInfo) {
295
+    static function &getFromDisk($pathInfo) {
296
 	$null = null;
297
 	$cache =& GalleryDataCache::_getCache();
298
 	if (!$cache['fileCacheEnabled']) {
299
@@ -341,7 +341,7 @@ class GalleryDataCache {
300
      * @param array $requiredClasses classes that must be loaded in order to retrieve this data
301
      * @see GalleryDataCache::getCachePath
302
      */
303
-    function putToDisk($pathInfo, &$data, $requiredClasses=array()) {
304
+    static function putToDisk($pathInfo, &$data, $requiredClasses=array()) {
305
 	$cache =& GalleryDataCache::_getCache();
306
 	if (!$cache['fileCacheEnabled']) {
307
 	    return;
308
@@ -373,7 +373,7 @@ class GalleryDataCache {
309
      * @param int $id
310
      * @return array the tuple
311
      */
312
-    function getCacheTuple($id) {
313
+    static function getCacheTuple($id) {
314
 	$id = "$id";
315
 	if ($id > 100) {
316
 	    return array($id[0], $id[1]);
317
@@ -395,7 +395,7 @@ class GalleryDataCache {
318
      *
319
      * @return string the path
320
      */
321
-    function getCachePath($pathInfo) {
322
+    static function getCachePath($pathInfo) {
323
 	global $gallery;
324
 
325
 	$base = $gallery->getConfig('data.gallery.cache');
326
--- modules/core/classes/GalleryStorage/GalleryStorageExtras.class.orig
327
+++ modules/core/classes/GalleryStorage/GalleryStorageExtras.class
328
@@ -190,7 +190,7 @@ class GalleryStorageExtras /* the other half of GalleryStorage */ {
329
 			$value = $this->_gs->_normalizeValue($row[$i], $memberData[$i], true);
330
 
331
 			/* Store the value in the object */
332
-			$entity->$callbacks[$i] = $value;
333
+			$entity->{$callbacks[$i]} = $value;
334
 			$entity->_persistentStatus['originalValue'][$callbacks[$i]] = $value;
335
 		    }
336
 
337
--- modules/core/classes/GalleryUtilities.class.orig
338
+++ modules/core/classes/GalleryUtilities.class
339
@@ -43,7 +43,7 @@ class GalleryUtilities {
340
      * @param string $filename
341
      * @return array the file basename, the file extension
342
      */
343
-    function getFileNameComponents($filename) {
344
+    static function getFileNameComponents($filename) {
345
 
346
 	$pos = strrpos($filename, '.');
347
 
348
@@ -69,7 +69,7 @@ class GalleryUtilities {
349
      * @param string $filename
350
      * @return array the file extension
351
      */
352
-    function getFileExtension($filename) {
353
+    static function getFileExtension($filename) {
354
 	list ($base, $extension) = GalleryUtilities::getFileNameComponents($filename);
355
 	return $extension;
356
     }
357
@@ -81,7 +81,7 @@ class GalleryUtilities {
358
      * @param string $filename
359
      * @return array the file base
360
      */
361
-    function getFileBase($filename) {
362
+    static function getFileBase($filename) {
363
 	list ($base, $extension) = GalleryUtilities::getFileNameComponents($filename);
364
 	return $base;
365
     }
366
@@ -92,7 +92,7 @@ class GalleryUtilities {
367
      * @param boolean $prefix (optional) false to omit Gallery variable prefix (not recommended)
368
      * @return array file data
369
      */
370
-    function getFile($key, $prefix=true) {
371
+    static function getFile($key, $prefix=true) {
372
 	$file = array();
373
 	if ($prefix) {
374
 	    $key = GALLERY_FORM_VARIABLE_PREFIX . $key;
375
@@ -235,7 +235,7 @@ class GalleryUtilities {
376
      * @param one or more string parameters
377
      * @return mixed a single string value or many values
378
      */
379
-    function getRequestVariables() {
380
+    static function getRequestVariables() {
381
 	$values = array();
382
 	foreach (func_get_args() as $argName) {
383
 	    $values[] = GalleryUtilities::_getRequestVariable(
384
@@ -255,7 +255,7 @@ class GalleryUtilities {
385
      * Return all request variables with the Gallery variable prefix.
386
      * @return array request variable name => value
387
      */
388
-    function getAllRequestVariables() {
389
+    static function getAllRequestVariables() {
390
 	$values = array();
391
 	$prefixLength = strlen(GALLERY_FORM_VARIABLE_PREFIX);
392
 	foreach ($_POST as $key => $value) {
393
@@ -283,7 +283,7 @@ class GalleryUtilities {
394
      * @param one or more string parameters
395
      * @return mixed a single string value or many values
396
      */
397
-    function getRequestVariablesNoPrefix() {
398
+    static function getRequestVariablesNoPrefix() {
399
 	$values = array();
400
 	foreach (func_get_args() as $argName) {
401
 	    $values[] = GalleryUtilities::_getRequestVariable($argName);
402
@@ -304,7 +304,7 @@ class GalleryUtilities {
403
      * @param string $value
404
      * @param boolean $prefix (optional) false to omit Gallery variable prefix (not recommended)
405
      */
406
-    function putRequestVariable($key, $value, $prefix=true) {
407
+    static function putRequestVariable($key, $value, $prefix=true) {
408
 	if ($prefix) {
409
 	    $key = GALLERY_FORM_VARIABLE_PREFIX . $key;
410
 	}
411
@@ -373,7 +373,7 @@ class GalleryUtilities {
412
      * @param array $array the source
413
      * @access private
414
      */
415
-    function _internalRemoveRequestVariable($keyPath, &$array) {
416
+    static function _internalRemoveRequestVariable($keyPath, &$array) {
417
 	$key = array_shift($keyPath);
418
 	while (!empty($keyPath)) {
419
 	    if (empty($array[$key])) {
420
@@ -401,7 +401,7 @@ class GalleryUtilities {
421
      * @param int $count the number of markers to return
422
      * @return string
423
      */
424
-    function makeMarkers($count, $markerFragment='?') {
425
+    static function makeMarkers($count, $markerFragment='?') {
426
 	if (is_array($count)) {
427
 	    $count = count($count);
428
 	}
429
@@ -427,7 +427,7 @@ class GalleryUtilities {
430
      * @param array $options (optional) options to pass to UrlGenerator
431
      * @return string a URL
432
      */
433
-    function convertPathToUrl($path, $options=array()) {
434
+    static function convertPathToUrl($path, $options=array()) {
435
 	global $gallery;
436
 	$platform =& $gallery->getPlatform();
437
 	$dirbase = $platform->realpath(dirname(__FILE__) . '/../../..') . '/';
438
@@ -458,7 +458,7 @@ class GalleryUtilities {
439
      * @param int $targetHeight (optional) target height, defaults to same as width
440
      * @return array(width, height)
441
      */
442
-    function shrinkDimensionsToFit($width, $height, $targetWidth, $targetHeight=null) {
443
+    static function shrinkDimensionsToFit($width, $height, $targetWidth, $targetHeight=null) {
444
 	if (!isset($targetHeight)) {
445
 	    $targetHeight = $targetWidth;
446
 	}
447
@@ -499,7 +499,7 @@ class GalleryUtilities {
448
      * @param int $precision defaults to zero
449
      * @return string rounded value
450
      */
451
-    function roundToString($floatValue, $precision=0) {
452
+    static function roundToString($floatValue, $precision=0) {
453
 	return str_replace(',', '.', round($floatValue, $precision));
454
     }
455
 
456
@@ -701,7 +701,7 @@ class GalleryUtilities {
457
      * @param boolean $adaptForMagicQuotes (optional) false to skip undoing the damage caused
458
      *                by magic_quotes
459
      */
460
-    function sanitizeInputValues(&$value, $adaptForMagicQuotes=true) {
461
+    static function sanitizeInputValues(&$value, $adaptForMagicQuotes=true) {
462
 	if (is_array($value)) {
463
 	    foreach (array_keys($value) as $key) {
464
 		$newKey = $key;
465
@@ -739,7 +739,7 @@ class GalleryUtilities {
466
      * @param boolean $adaptForMagicQuotes (optional) false to skip redoing the damage caused
467
      *                by magic_quotes
468
      */
469
-    function unsanitizeInputValues(&$value, $adaptForMagicQuotes=true) {
470
+    static function unsanitizeInputValues(&$value, $adaptForMagicQuotes=true) {
471
 	if (is_array($value)) {
472
 	    foreach (array_keys($value) as $key) {
473
 		GalleryUtilities::unsanitizeInputValues($value[$key], $adaptForMagicQuotes);
474
@@ -763,9 +763,14 @@ class GalleryUtilities {
475
      * @param string $string the input string with UTF-8 entities
476
      * @return string the UTF-8 string
477
      */
478
-    function unicodeEntitiesToUtf8($string) {
479
-	$string = preg_replace('/&#([xa-f\d]+);/mei',
480
-	    "GalleryUtilities::unicodeValueToUtf8Value('\\1')", $string);
481
+    static function unicodeEntitiesToUtf8($string) {
482
+	$string = preg_replace_callback('/&#([xa-f\d]+);/mi',
483
+        function($matches) {
484
+            return GalleryUtilities::unicodeValueToUtf8Value($matches[1]);
485
+        }
486
+        , $string);
487
+	/*$string = preg_replace('/&#([xa-f\d]+);/mei',
488
+	    "GalleryUtilities::unicodeValueToUtf8Value('\\1')", $string);*/
489
 	return $string;
490
     }
491
 
492
@@ -777,7 +782,7 @@ class GalleryUtilities {
493
      * @return string a multibyte safe substring of input value
494
      * @deprecated Please use GalleryCoreApi::utf8Substring instead
495
      */
496
-    function utf8Substring($string, $start, $length) {
497
+    static function utf8Substring($string, $start, $length) {
498
 	return GalleryCoreApi::utf8Substring($string, $start, $length);
499
     }
500
 
501
@@ -788,7 +793,7 @@ class GalleryUtilities {
502
      * @param int $num the unicode value
503
      * @return string the UTF-8 string
504
      */
505
-    function unicodeValueToUtf8Value($num) {
506
+    static function unicodeValueToUtf8Value($num) {
507
 	if ($num[0] == 'x') {
508
 	    /* Convert hex to decimal */
509
 	    $num = hexdec(substr($num, 1));
510
@@ -870,7 +875,7 @@ class GalleryUtilities {
511
      * @return string a single value
512
      * @access private
513
      */
514
-    function _getRequestVariable($key) {
515
+    static function _getRequestVariable($key) {
516
 	$keyPath = preg_split('/[\[\]]/', $key, -1, PREG_SPLIT_NO_EMPTY);
517
 	$result = GalleryUtilities::_internalGetRequestVariable($keyPath, $_GET);
518
 	if (isset($result)) {
519
@@ -889,7 +894,7 @@ class GalleryUtilities {
520
      * @return the value or null if it does not exist
521
      * @access private
522
      */
523
-    function _internalGetRequestVariable($keyPath, $array) {
524
+    static function _internalGetRequestVariable($keyPath, $array) {
525
 	$key = array_shift($keyPath);
526
 	while (!empty($keyPath)) {
527
 	    if (!isset($array[$key])) {
528
@@ -1001,7 +1006,7 @@ class GalleryUtilities {
529
      * Return the address of the remote host.
530
      * @return string the remote host address (or null)
531
      */
532
-    function getRemoteHostAddress() {
533
+    static function getRemoteHostAddress() {
534
 	$addr = null;
535
 	if (isset($_SERVER['REMOTE_ADDR'])) {
536
 	    $addr = $_SERVER['REMOTE_ADDR'];
537
@@ -1399,7 +1404,7 @@ class GalleryUtilities {
538
      * @param string $key the key in the _SERVER superglobal
539
      * @return string the value
540
      */
541
-    function getServerVar($key) {
542
+    static function getServerVar($key) {
543
 	if (!isset($_SERVER[$key])) {
544
 	    return null;
545
 	}
546
@@ -1432,7 +1437,7 @@ class GalleryUtilities {
547
      * @see Gallery::isEmbedded
548
      * @deprecated
549
      */
550
-    function isEmbedded() {
551
+    static function isEmbedded() {
552
 	global $gallery;
553
 	return $gallery->isEmbedded();
554
     }
555
@@ -1617,7 +1622,7 @@ class GalleryUtilities {
556
      * @param string $string
557
      * @return string lowercase version of the string
558
      */
559
-    function strToLower($string) {
560
+    static function strToLower($string) {
561
 	return strtr($string, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
562
     }
563
 
564
@@ -1626,7 +1631,7 @@ class GalleryUtilities {
565
      * @param string $string
566
      * @return string uppercase version of the string
567
      */
568
-    function strToUpper($string) {
569
+    static function strToUpper($string) {
570
 	return strtr($string, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
571
     }
572
 
(-)gallery2-php7/files/patch-gregstoll-b4412ba7 (+13 lines)
Line 0 Link Here
1
Obtained from:	https://github.com/gregstoll/gallery2/commit/b4412ba7098b1f87a40b64768a0184411f07d7e9
2
3
--- modules/core/classes/helpers/GalleryDerivativeHelper_advanced.class
4
+++ modules/core/classes/helpers/GalleryDerivativeHelper_advanced.class
5
@@ -612,7 +612,7 @@ class GalleryDerivativeHelper_advanced {
6
 	    }
7
 
8
 	    /* Our merge is complete, so convert our operations back into a string */
9
-	    $results = '';
10
+	    $results = array();
11
 	    for ($i = 0; $i < sizeof($operations1); $i++) {
12
 		$op = $operations1[$i]['op'];
13
 		if (!empty($operations1[$i]['args'])) {
(-)gallery2-php7/files/patch-gregstoll-bc541824 (+16 lines)
Line 0 Link Here
1
Obtained from:	https://github.com/gregstoll/gallery2/commit/bc54182496f8bf175a5c606f53cdfb9310402c1a
2
3
--- modules/linkitem/classes/GalleryLinkItem.class.orig
4
+++ modules/linkitem/classes/GalleryLinkItem.class
5
@@ -60,9 +60,10 @@ class GalleryLinkItem extends GalleryItem {
6
      *
7
      * @param int $parentId the id of the parent object
8
      * @param mixed $link the link target: either string url or int id of a GalleryAlbumItem
9
+     * @param boolean $canContainChildren ignored (for compatibility with base class)
10
      * @return GalleryStatus a status code
11
      */
12
-    function create($parentId, $link) {
13
+    function create($parentId=null, $link=null, $canContainChildren=false) {
14
 	if (!isset($parentId) || empty($link)) {
15
 	    return GalleryCoreApi::error(ERROR_BAD_PARAMETER);
16
 	}
(-)gallery2-php7/files/patch-gregstoll-c5de1c59 (+12 lines)
Line 0 Link Here
1
Obtained from:	https://github.com/gregstoll/gallery2/commit/c5de1c59a4990b467a6917f766baab7c36c34c5f
2
3
--- modules/core/classes/GallerySession.class
4
+++ modules/core/classes/GallerySession.class
5
@@ -777,6 +777,7 @@ class GallerySession {
6
 	    unset($sessionDataCopy['embed.id.externalUser']);
7
 	    unset($sessionDataCopy['core.authToken']);
8
 	    unset($sessionDataCopy['secure']);
9
+		GalleryCoreApi::requireOnce('modules/core/classes/GalleryTranslator.class');
10
 	    list ($ret, $detectedLanguageCode) = GalleryTranslator::getDefaultLanguageCode();
11
 	    if ($ret) {
12
 		return array($ret, null);
(-)gallery2-php7/files/patch-gregstoll-dbade2ca (+116 lines)
Line 0 Link Here
1
Obtained from:	5aa23ddcbf1bfeeea2843d3ab957258bea5a2dff
2
Obtained from:	https://github.com/gregstoll/gallery2/commit/dbade2ca15a2563343adc741277730eca7442a83
3
4
--- lib/adodb/drivers/adodb-mysql.inc.php
5
+++ lib/adodb/drivers/adodb-mysql.inc.php
6
@@ -620,7 +620,7 @@ class ADORecordSet_mysql extends ADORecordSet{
7
 			$this->fetchMode = MYSQL_BOTH; break;
8
 		}
9
 		$this->adodbFetchMode = $mode;
10
-		$this->ADORecordSet($queryID);	
11
+        parent::__construct($queryID);
12
 	}
13
 	
14
 	function _initrs()
15
@@ -787,4 +787,4 @@ class ADORecordSet_ext_mysql extends ADORecordSet_mysql {
16
 
17
 
18
 }
19
-?>
20
\ No newline at end of file
21
+?>
22
--- lib/adodb/drivers/adodb-mysqlt.inc.php
23
+++ lib/adodb/drivers/adodb-mysqlt.inc.php
24
@@ -107,7 +107,7 @@ class ADORecordSet_mysqlt extends ADORecordSet_mysql{
25
 		}
26
 	
27
 		$this->adodbFetchMode = $mode;
28
-		$this->ADORecordSet($queryID);	
29
+        parent::__construct($queryID);
30
 	}
31
 	
32
 	function MoveNext()
33
--- lib/adodb/drivers/adodb-pdo.inc.php
34
+++ lib/adodb/drivers/adodb-pdo.inc.php
35
@@ -388,7 +388,7 @@ class ADORecordSet_pdo extends ADORecordSet {
36
 		$this->fetchMode = $mode;
37
 		
38
 		$this->_queryID = $id;
39
-		$this->ADORecordSet($id);
40
+        parent::__construct($id);
41
 	}
42
 
43
 	
44
@@ -481,4 +481,4 @@ class ADORecordSet_pdo extends ADORecordSet {
45
 
46
 }
47
 
48
-?>
49
\ No newline at end of file
50
+?>
51
--- lib/adodb/drivers/adodb-postgres64.inc.php
52
+++ lib/adodb/drivers/adodb-postgres64.inc.php
53
@@ -883,7 +883,7 @@ class ADORecordSet_postgres64 extends ADORecordSet{
54
 		default: $this->fetchMode = PGSQL_BOTH; break;
55
 		}
56
 		$this->adodbFetchMode = $mode;
57
-		$this->ADORecordSet($queryID);
58
+        parent::__construct($queryID);
59
 	}
60
 	
61
 	function &GetRowAssoc($upper=true)
62
--- modules/core/classes/GalleryStorage/Db2Storage.class
63
+++ modules/core/classes/GalleryStorage/Db2Storage.class
64
@@ -32,7 +32,7 @@ GalleryCoreApi::requireOnce('modules/core/classes/GalleryStorage.class');
65
 class Db2Storage extends GalleryStorage {
66
 
67
     function Db2Storage($config) {
68
-	$this->GalleryStorage($config);
69
+    parent::__construct($config);
70
 	$this->_isTransactional = true;
71
     }
72
 
73
--- modules/core/classes/GalleryStorage/MSSqlStorage.class
74
+++ modules/core/classes/GalleryStorage/MSSqlStorage.class
75
@@ -40,7 +40,7 @@ class MSSqlStorage extends GalleryStorage {
76
     var $_serverInfo;
77
 
78
     function MSSqlStorage($config) {
79
-	$this->GalleryStorage($config);
80
+    parent::__construct($config);
81
 	$this->_isTransactional = true;
82
 	$this->_isEmptyAllowedForNotNullColumn = true;
83
 
84
--- modules/core/classes/GalleryStorage/OracleStorage.class
85
+++ modules/core/classes/GalleryStorage/OracleStorage.class
86
@@ -32,7 +32,7 @@ GalleryCoreApi::requireOnce('modules/core/classes/GalleryStorage.class');
87
 class OracleStorage extends GalleryStorage {
88
 
89
     function OracleStorage($config) {
90
-	$this->GalleryStorage($config);
91
+    parent::__construct($config);
92
 	$this->_isTransactional = true;
93
 	$this->_isEmptyAllowedForNotNullColumn = false;
94
     }
95
--- modules/core/classes/GalleryStorage/PostgreSqlStorage.class
96
+++ modules/core/classes/GalleryStorage/PostgreSqlStorage.class
97
@@ -32,7 +32,7 @@ GalleryCoreApi::requireOnce('modules/core/classes/GalleryStorage.class');
98
 class PostgreSqlStorage extends GalleryStorage {
99
 
100
     function PostgreSqlStorage($config) {
101
-	$this->GalleryStorage($config);
102
+    parent::__construct($config);
103
 	$this->_isTransactional = true;
104
     }
105
 
106
--- modules/core/classes/GalleryStorage/SQLiteStorage.class
107
+++ modules/core/classes/GalleryStorage/SQLiteStorage.class
108
@@ -32,7 +32,7 @@ GalleryCoreApi::requireOnce('modules/core/classes/GalleryStorage.class');
109
 class SQLiteStorage extends GalleryStorage {
110
 
111
     function SQLiteStorage($config) {
112
-	$this->GalleryStorage($config);
113
+    parent::__construct($config);
114
 	/**
115
 	 * SQLite supports transactions, but they seem to hang on some pages and some select
116
 	 * statements seem to hang too.
(-)gallery2-php7/files/patch-gregstoll-e2a63e64 (+13 lines)
Line 0 Link Here
1
Obtained from:	https://github.com/gregstoll/gallery2/commit/e2a63e64c992a2cff04701798f56f6304855189b
2
3
--- modules/exif/SwitchDetailMode.inc.orig
4
+++ modules/exif/SwitchDetailMode.inc
5
@@ -31,7 +31,7 @@ class SwitchDetailModeController extends GalleryController {
6
     /**
7
      * @see GalleryController::handleRequest
8
      */
9
-    function handleRequest() {
10
+    function handleRequest($form) {
11
 	global $gallery;
12
 
13
 	$mode = GalleryUtilities::getRequestVariables('mode');
(-)gallery2-php7/files/patch-lib-adodb-adodb-time.inc.php (-12 lines)
Lines 1-12 Link Here
1
Obtained from:	https://github.com/bobosch/gallery2/commit/4ddfafa416ffe5babd95f2a6532742c3ec903275
2
3
--- lib/adodb/adodb-time.inc.php.orig
4
+++ lib/adodb/adodb-time.inc.php
5
@@ -1006,7 +1006,6 @@ function adodb_tz_offset($gmt,$isphp5)
6
 		return sprintf('%s%02d%02d',($gmt<=0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60); 
7
 	else
8
 		return sprintf('%s%02d%02d',($gmt<0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60); 
9
-	break;
10
 }
11
 
12
 
(-)gallery2-php7/files/patch-modules-core-classes-GalleryStorage-GalleryStorageExtras.class (-13 lines)
Lines 1-13 Link Here
1
Obtained from:	https://github.com/bobosch/gallery2/commit/4fc50203a12b78217999df00759d70d283efce2f
2
3
--- modules/core/classes/GalleryStorage/GalleryStorageExtras.class.orig
4
+++ modules/core/classes/GalleryStorage/GalleryStorageExtras.class
5
@@ -190,7 +190,7 @@ class GalleryStorageExtras /* the other half of GalleryStorage */ {
6
 			$value = $this->_gs->_normalizeValue($row[$i], $memberData[$i], true);
7
 
8
 			/* Store the value in the object */
9
-			$entity->$callbacks[$i] = $value;
10
+			$entity->{$callbacks[$i]} = $value;
11
 			$entity->_persistentStatus['originalValue'][$callbacks[$i]] = $value;
12
 		    }
13
 

Return to bug 234557