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

Collapse All | Expand All

(-)./nagiosql/Makefile (-3 / +8 lines)
Lines 10-18 Link Here
10
LICENSE=	GPLv2
10
LICENSE=	GPLv2
11
LICENSE_FILE=	${WRKSRC}/LICENSE
11
LICENSE_FILE=	${WRKSRC}/LICENSE
12
12
13
RUN_DEPENDS=	nagios:net-mgmt/nagios \
13
DEPRECATED=	Requires php 7.4 which is set to expire on 2022-11-29
14
		${PEARDIR}/HTML/Template/IT.php:devel/pear-HTML_Template_IT@${PHP_FLAVOR}
14
EXPIRATION_DATE=2022-11-28
15
15
16
IGNORE_WITH_PHP=80 81
17
18
RUN_DEPENDS=nagios:net-mgmt/nagios4 \
19
			${PEARDIR}/HTML/Template/IT.php:devel/pear-HTML_Template_IT@${PHP_FLAVOR}
20
16
USES=		cpe gettext mysql php:web tar:bzip2
21
USES=		cpe gettext mysql php:web tar:bzip2
17
USE_PHP=	filter gettext mysqli session simplexml
22
USE_PHP=	filter gettext mysqli session simplexml
18
23
Lines 22-28 Link Here
22
27
23
USERS?=		nagios
28
USERS?=		nagios
24
GROUPS?=	nagios
29
GROUPS?=	nagios
25
NAGIOSUSER?=	nagios
30
NAGIOSUSER?=nagios
26
31
27
NO_BUILD=	yes
32
NO_BUILD=	yes
28
NO_ARCH=	yes
33
NO_ARCH=	yes
(-)./nagiosql/files/patch-admin_dir.diff (+108 lines)
Line 0 Link Here
1
--- admin/groupusers.php.orig	2020-01-19 18:03:01.000000000 +0100
2
+++ admin/groupusers.php	2022-02-17 18:46:54.630851000 +0100
3
@@ -53,10 +53,10 @@
4
     }
5
     $chkRights = $strRights;
6
 }
7
-if (get_magic_quotes_gpc() == 0) {
8
-    $chkUser   = addslashes($chkUser);
9
-    $chkRights = addslashes($chkRights);
10
-}
11
+#if (get_magic_quotes_gpc() == 0) {
12
+$chkUser   = addslashes($chkUser);
13
+$chkRights = addslashes($chkRights);
14
+#}
15
 //
16
 // Get datasets
17
 // ============
18
@@ -181,4 +181,4 @@
19
 ?>
20
         </table>
21
     </body>
22
-</html>
23
\ No newline at end of file
24
+</html>
25
--- admin/helpedit.php.orig	2020-01-19 18:03:01.000000000 +0100
26
+++ admin/helpedit.php	2022-02-17 18:47:17.798070000 +0100
27
@@ -43,12 +43,12 @@
28
 //
29
 // Quote special characters
30
 // ==========================
31
-if (get_magic_quotes_gpc() == 0) {
32
-    $chkHidVersion = addslashes($chkHidVersion);
33
-    $chkKey1       = addslashes($chkKey1);
34
-    $chkKey2       = addslashes($chkKey2);
35
-    $chkVersion    = addslashes($chkVersion);
36
-}
37
+#if (get_magic_quotes_gpc() == 0) {
38
+$chkHidVersion = addslashes($chkHidVersion);
39
+$chkKey1       = addslashes($chkKey1);
40
+$chkKey2       = addslashes($chkKey2);
41
+$chkVersion    = addslashes($chkVersion);
42
+#}
43
 //
44
 // Security function for text fields
45
 // =================================
46
--- admin/templatedefinitions.php.orig	2020-01-19 18:03:01.000000000 +0100
47
+++ admin/templatedefinitions.php	2022-02-17 18:47:41.015366000 +0100
48
@@ -40,9 +40,9 @@
49
 if ($chkDataId == '') {
50
     $chkDataId = 0;
51
 }
52
-if (get_magic_quotes_gpc() == 0) {
53
-    $chkDef   = addslashes($chkDef);
54
-}
55
+#if (get_magic_quotes_gpc() == 0) {
56
+$chkDef   = addslashes($chkDef);
57
+#}
58
 $arrDefinition = explode('::', $chkDef);
59
 if ($chkType == '') {
60
     exit;
61
--- admin/timedefinitions.php.orig	2020-01-19 18:03:01.000000000 +0100
62
+++ admin/timedefinitions.php	2022-02-17 18:48:02.272471000 +0100
63
@@ -38,10 +38,10 @@
64
 $chkDef     = filter_input(INPUT_GET, 'def', FILTER_SANITIZE_STRING);
65
 $chkRange   = filter_input(INPUT_GET, 'range', FILTER_SANITIZE_STRING);
66
 $chkId      = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING);
67
-if (get_magic_quotes_gpc() == 0) {
68
-    $chkDef   = addslashes($chkDef);
69
-    $chkRange = addslashes($chkRange);
70
-}
71
+#if (get_magic_quotes_gpc() == 0) {
72
+$chkDef   = addslashes($chkDef);
73
+$chkRange = addslashes($chkRange);
74
+#}
75
 //
76
 // Get data
77
 // ========
78
@@ -195,4 +195,4 @@
79
 ?>
80
         </table>
81
     </body>
82
-</html>
83
\ No newline at end of file
84
+</html>
85
--- admin/variabledefinitions.php.orig	2020-01-19 18:03:01.000000000 +0100
86
+++ admin/variabledefinitions.php	2022-02-17 18:48:25.573841000 +0100
87
@@ -37,10 +37,10 @@
88
 $chkDef     = filter_input(INPUT_GET, 'def', FILTER_SANITIZE_STRING);
89
 $chkRange   = filter_input(INPUT_GET, 'range', FILTER_SANITIZE_STRING);
90
 $chkLinkTab = filter_input(INPUT_GET, 'linktab', FILTER_SANITIZE_STRING);
91
-if (get_magic_quotes_gpc() == 0) {
92
-    $chkDef   = addslashes($chkDef);
93
-    $chkRange = addslashes($chkRange);
94
-}
95
+#if (get_magic_quotes_gpc() == 0) {
96
+$chkDef   = addslashes($chkDef);
97
+$chkRange = addslashes($chkRange);
98
+#}
99
 //
100
 // Get data
101
 // ========
102
@@ -172,4 +172,4 @@
103
 ?>
104
     </table>
105
 </body>
106
-</html>
107
\ No newline at end of file
108
+</html>
(-)./nagiosql/files/patch-functions_dir.diff (+81 lines)
Line 0 Link Here
1
--- functions/prepend_content.php.orig	2020-01-19 18:03:01.000000000 +0100
2
+++ functions/prepend_content.php	2022-02-17 18:53:43.081225000 +0100
3
@@ -64,9 +64,9 @@
4
 for ($i = 1; $i <= 23; $i++) {
5
     $tmpVar  = 'chkTfValue'.$i;
6
     $$tmpVar = filter_input(INPUT_POST, 'tfValue'.$i, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
7
-    if (get_magic_quotes_gpc() == 0) {
8
-        $$tmpVar = addslashes($$tmpVar);
9
-    }
10
+#    if (get_magic_quotes_gpc() == 0) {
11
+    $$tmpVar = addslashes($$tmpVar);
12
+#    }
13
     if (isset($$tmpVar)) {
14
         $$tmpVar = $myVisClass->tfSecure($$tmpVar);
15
     }
16
@@ -75,9 +75,9 @@
17
 for ($i = 1; $i <= 8; $i++) {
18
     $tmpVar  = 'chkTfArg'.$i;
19
     $$tmpVar = filter_input(INPUT_POST, 'tfArg'.$i, FILTER_UNSAFE_RAW);
20
-    if (get_magic_quotes_gpc() == 0) {
21
-        $$tmpVar = addslashes($$tmpVar);
22
-    }
23
+#    if (get_magic_quotes_gpc() == 0) {
24
+    $$tmpVar = addslashes($$tmpVar);
25
+#    }
26
     if (isset($$tmpVar)) {
27
         $$tmpVar = $myVisClass->tfSecure($$tmpVar);
28
     }
29
@@ -86,9 +86,9 @@
30
 for ($i = 1; $i <= 8; $i++) {
31
     $tmpVar  = 'chkTaArg'.$i.'Info';
32
     $$tmpVar = filter_input(INPUT_POST, 'taArg'.$i.'Info', FILTER_UNSAFE_RAW);
33
-    if (get_magic_quotes_gpc() == 0) {
34
-        $$tmpVar = addslashes($$tmpVar);
35
-    }
36
+#    if (get_magic_quotes_gpc() == 0) {
37
+    $$tmpVar = addslashes($$tmpVar);
38
+#    }
39
     if (isset($$tmpVar)) {
40
         $$tmpVar = $myVisClass->tfSecure($$tmpVar);
41
     }
42
@@ -99,12 +99,14 @@
43
     $tmpVar2 = 'intMselValue'.$i;
44
     $$tmpVar = filter_input(INPUT_POST, 'mselValue'.$i, FILTER_SANITIZE_STRING, FILTER_FORCE_ARRAY);
45
     // Multiselect data processing
46
-    if ((${$tmpVar}[0] == '') || (${$tmpVar}[0] == '0')) {
47
-        $$tmpVar2 = 0;
48
-    } elseif (${$tmpVar}[0] == '*') {
49
-        $$tmpVar2 = 2;
50
-    } else {
51
-        $$tmpVar2 = 1;
52
+    if (isset(${$tmpVar}[0])) {
53
+        if ((${$tmpVar}[0] == '') || (${$tmpVar}[0] == '0')) {
54
+            $$tmpVar2 = 0;
55
+        } elseif (${$tmpVar}[0] == '*') {
56
+            $$tmpVar2 = 2;
57
+        } else {
58
+            $$tmpVar2 = 1;
59
+        }
60
     }
61
 }
62
 // Common select field value
63
@@ -157,12 +159,12 @@
64
 //
65
 // Quote special characters
66
 // ==========================
67
-if (get_magic_quotes_gpc() == 0) {
68
-    $chkTfSearchRaw    = addslashes($chkTfSearchRaw);
69
-    $chkTaValue1Raw    = addslashes($chkTaValue1Raw);
70
-    $chkTaFileTextRaw  = addslashes($chkTaFileTextRaw);
71
-    $chkTfSpValue1     = addslashes($chkTfSpValue1);
72
-}
73
+#if (get_magic_quotes_gpc() == 0) {
74
+$chkTfSearchRaw    = addslashes($chkTfSearchRaw);
75
+$chkTaValue1Raw    = addslashes($chkTaValue1Raw);
76
+$chkTaFileTextRaw  = addslashes($chkTaFileTextRaw);
77
+$chkTfSpValue1     = addslashes($chkTfSpValue1);
78
+#}
79
 //
80
 // Security function for text fields
81
 // =================================
(-)./nagiosql/files/patch-libraries_dir.diff (+503 lines)
Line 0 Link Here
1
--- libraries/pear/HTML/Template/IT.php.orig	2020-01-19 18:03:01.000000000 +0100
2
+++ libraries/pear/HTML/Template/IT.php	2022-02-18 17:21:48.000000000 +0100
3
@@ -11,7 +11,7 @@
4
  * with this package in the file LICENSE, and is available through
5
  * the world-wide-web at
6
  * http://www.opensource.org/licenses/bsd-license.php
7
- * If you did not receive a copy of the new BSDlicense and are unable
8
+ * If you did not receive a copy of the new BSD license and are unable
9
  * to obtain it through the world-wide-web, please send a note to
10
  * pajoye@php.net so we can mail you a copy immediately.
11
  *
12
@@ -23,13 +23,12 @@
13
  * @package  HTML_Template_IT
14
  * @author   Ulf Wendel <uw@netuse.de>
15
  * @license  BSD http://www.opensource.org/licenses/bsd-license.php
16
- * @version  CVS: $Id: IT.php 3 2017-06-22 07:32:17Z martin $
17
+ * @version  CVS: $Id$
18
  * @link     http://pear.php.net/packages/HTML_Template_IT
19
  * @access   public
20
  */
21
 
22
 require_once 'PEAR.php';
23
-$myPEAR = new PEAR();
24
 
25
 define('IT_OK', 1);
26
 define('IT_ERROR', -1);
27
@@ -49,7 +48,7 @@
28
  * one you can build. template::parse() [phplib template = Isotemplate] requests
29
  * you to name a source and a target where the current block gets parsed into.
30
  * Source and target can be block names or even handler names. This API gives you
31
- * a maximum of fexibility but you always have to know what you do which is
32
+ * a maximum of flexibility but you always have to know what you do which is
33
  * quite unusual for php skripter like me.
34
  *
35
  * I noticed that I do not any control on which block gets parsed into which one.
36
@@ -279,9 +278,9 @@
37
      * should be preserved although they are empty (no placeholder replaced).
38
      * Think of a shopping basket. If it's empty you have to drop a message to
39
      * the user. If it's filled you have to show the contents of
40
-     * the shopping baseket. Now where do you place the message that the basket
41
+     * the shopping basket. Now where do you place the message that the basket
42
      * is empty? It's no good idea to place it in you applications as customers
43
-     * tend to like unecessary minor text changes. Having another template file
44
+     * tend to like unnecessary minor text changes. Having another template file
45
      * for an empty basket means that it's very likely that one fine day
46
      * the filled and empty basket templates have different layout. I decided
47
      * to introduce blocks that to not contain any placeholder but only
48
@@ -289,7 +288,7 @@
49
      *
50
      * Now if there is no replacement done in such a block the block will
51
      * be recognized as "empty" and by default ($removeEmptyBlocks = true) be
52
-     * stripped off. To avoid thisyou can now call touchBlock() to avoid this.
53
+     * stripped off. To avoid this you can now call touchBlock() to avoid this.
54
      *
55
      * The array $touchedBlocks stores a list of touched block which must not
56
      * be removed even if they are empty.
57
@@ -301,14 +300,6 @@
58
      var $touchedBlocks = array();
59
 
60
     /**
61
-     * List of blocks which should not be shown even if not "empty"
62
-     * @var  array    $_hiddenBlocks
63
-     * @see  hideBlock(), $removeEmptyBlocks
64
-     * @access private
65
-     */
66
-    var $_hiddenBlocks = array();
67
-
68
-    /**
69
      * Variable cache.
70
      *
71
      * Variables get cached before any replacement is done.
72
@@ -395,7 +386,7 @@
73
     );
74
 
75
     /**
76
-     * Builds some complex regular expressions and optinally sets the
77
+     * Builds some complex regular expressions and optionally sets the
78
      * file root directory.
79
      *
80
      * Make sure that you call this constructor if you derive your template
81
@@ -408,7 +399,7 @@
82
      * @see      setRoot()
83
      * @access   public
84
      */
85
-    function __construct($root = '', $options = null)
86
+     function __construct($root = '', $options = null)
87
     {
88
         if (!is_null($options)) {
89
             $this->setOptions($options);
90
@@ -440,8 +431,7 @@
91
      */
92
     function setOption($option, $value)
93
     {
94
-        global $myPEAR;
95
-		switch ($option) {
96
+        switch ($option) {
97
             case 'removeEmptyBlocks':
98
                 $this->removeEmptyBlocks = $value;
99
                 return IT_OK;
100
@@ -452,7 +442,7 @@
101
             return IT_OK;
102
         }
103
 
104
-        return $myPEAR->raiseError(
105
+        return PEAR::raiseError(
106
             $this->errorMessage(IT_UNKNOWN_OPTION) . ": '{$option}'",
107
             IT_UNKNOWN_OPTION
108
         );
109
@@ -472,12 +462,10 @@
110
      */
111
     function setOptions($options)
112
     {
113
-		global $myPEAR;
114
         if (is_array($options)) {
115
             foreach ($options as $option => $value) {
116
                 $error = $this->setOption($option, $value);
117
-				if ($myPEAR->isError($error)) {
118
-                
119
+                if (PEAR::isError($error)) {
120
                     return $error;
121
                 }
122
             }
123
@@ -512,13 +500,12 @@
124
      */
125
     function get($block = '__global__')
126
     {
127
-         global $myPEAR;
128
-		 if ($block == '__global__'  && !$this->flagGlobalParsed) {
129
+        if ($block == '__global__'  && !$this->flagGlobalParsed) {
130
             $this->parse('__global__');
131
         }
132
 
133
         if (!isset($this->blocklist[$block])) {
134
-            $this->err[] = $myPEAR->raiseError(
135
+            $this->err[] = PEAR::raiseError(
136
                 $this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'",
137
                 IT_BLOCK_NOT_FOUND
138
             );
139
@@ -562,11 +549,10 @@
140
      */
141
     function parse($block = '__global__', $flag_recursion = false)
142
     {
143
-        global $myPEAR;
144
-		static $regs, $values;
145
+        static $regs, $values;
146
 
147
         if (!isset($this->blocklist[$block])) {
148
-            return $myPEAR->raiseError(
149
+            return PEAR::raiseError(
150
                 $this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'",
151
                 IT_BLOCK_NOT_FOUND
152
             );
153
@@ -754,7 +740,7 @@
154
     /**
155
      * Sets a variable value.
156
      *
157
-     * The function can be used eighter like setVariable( "varname", "value")
158
+     * The function can be used either like setVariable( "varname", "value")
159
      * or with one array $variables["varname"] = "value"
160
      * given setVariable($variables) quite like phplib templates set_var().
161
      *
162
@@ -791,9 +777,9 @@
163
      */
164
     function setCurrentBlock($block = '__global__')
165
     {
166
-		global $myPEAR;
167
+
168
         if (!isset($this->blocklist[$block])) {
169
-            return $myPEAR->raiseError(
170
+            return PEAR::raiseError(
171
                 $this->errorMessage(IT_BLOCK_NOT_FOUND)
172
                 . '"' . $block . "'",
173
                 IT_BLOCK_NOT_FOUND
174
@@ -817,9 +803,8 @@
175
      */
176
     function touchBlock($block)
177
     {
178
-        global $myPEAR;
179
-		if (!isset($this->blocklist[$block])) {
180
-            return $myPEAR->raiseError(
181
+        if (!isset($this->blocklist[$block])) {
182
+            return PEAR::raiseError(
183
                 $this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'",
184
                 IT_BLOCK_NOT_FOUND
185
             );
186
@@ -876,7 +861,7 @@
187
     /**
188
      * Sets the template.
189
      *
190
-     * You can eighter load a template file from disk with
191
+     * You can either load a template file from disk with
192
      * LoadTemplatefile() or set the template manually using this function.
193
      *
194
      * @param string $template               template content
195
@@ -1009,7 +994,7 @@
196
     } // end func getGlobalvariables
197
 
198
     /**
199
-     * Recusively builds a list of all blocks within the template.
200
+     * Recursively builds a list of all blocks within the template.
201
      *
202
      * @param string $string string that gets scanned
203
      *
204
@@ -1019,8 +1004,7 @@
205
      */
206
     function findBlocks($string)
207
     {
208
-        global $myPEAR;
209
-		$blocklist = array();
210
+        $blocklist = array();
211
 
212
         if (preg_match_all($this->blockRegExp, $string, $regs, PREG_SET_ORDER)) {
213
             foreach ($regs as $k => $match) {
214
@@ -1030,7 +1014,7 @@
215
                 if (isset($this->blocklist[$blockname])) {
216
                     $msg = $this->errorMessage(IT_BLOCK_DUPLICATE, $blockname);
217
 
218
-                    $this->err[] = $myPEAR->raiseError($msg, IT_BLOCK_DUPLICATE);
219
+                    $this->err[] = PEAR::raiseError($msg, IT_BLOCK_DUPLICATE);
220
 
221
                     $this->flagBlocktrouble = true;
222
                 }
223
@@ -1073,15 +1057,14 @@
224
      */
225
     function getFile($filename)
226
     {
227
-        global $myPEAR;
228
-		if ($filename{0} == '/' && substr($this->fileRoot, -1) == '/') {
229
+        if ($filename[0] == '/' && substr($this->fileRoot, -1) == '/') {
230
             $filename = substr($filename, 1);
231
         }
232
 
233
         $filename = $this->fileRoot . $filename;
234
 
235
         if (!($fh = @fopen($filename, 'r'))) {
236
-            $this->err[] = $myPEAR->raiseError(
237
+            $this->err[] = PEAR::raiseError(
238
                 $this->errorMessage(IT_TPL_NOT_FOUND) . ': "' .$filename .'"',
239
                 IT_TPL_NOT_FOUND
240
             );
241
@@ -1097,10 +1080,9 @@
242
         $content = fread($fh, $fsize);
243
         fclose($fh);
244
 
245
-        // "#<!-- INCLUDE (.*) -->#ime", wma/PEAR error
246
-		return preg_replace(
247
+        return preg_replace_callback(
248
             "#<!-- INCLUDE (.*) -->#im",
249
-            "\$this->getFile('\\1')",
250
+            function ($m) { return $this->getFile($m[1]); },
251
             $content
252
         );
253
     } // end func getFile
254
@@ -1169,8 +1151,7 @@
255
      */
256
     function errorMessage($value, $blockname = '')
257
     {
258
-        global $myPEAR;
259
-		static $errorMessages;
260
+        static $errorMessages;
261
         if (!isset($errorMessages)) {
262
             $errorMessages = array(
263
                 IT_OK                       => '',
264
@@ -1186,7 +1167,7 @@
265
             );
266
         }
267
 
268
-        if ($myPEAR->isError($value)) {
269
+        if (PEAR::isError($value)) {
270
             $value = $value->getCode();
271
         }
272
 
273
--- libraries/pear/HTML/Template/ITX.php.orig	2020-01-19 18:03:01.000000000 +0100
274
+++ libraries/pear/HTML/Template/ITX.php	2022-02-18 17:22:12.000000000 +0100
275
@@ -11,7 +11,7 @@
276
  * with this package in the file LICENSE, and is available through
277
  * the world-wide-web at
278
  * http://www.opensource.org/licenses/bsd-license.php
279
- * If you did not receive a copy of the new BSDlicense and are unable
280
+ * If you did not receive a copy of the new BSD license and are unable
281
  * to obtain it through the world-wide-web, please send a note to
282
  * pajoye@php.net so we can mail you a copy immediately.
283
  *
284
@@ -23,7 +23,7 @@
285
  * @package  HTML_Template_IT
286
  * @author   Ulf Wendel <uw@netuse.de>
287
  * @license  BSD http://www.opensource.org/licenses/bsd-license.php
288
- * @version  CVS: $Id: ITX.php 3 2017-06-22 07:32:17Z martin $
289
+ * @version  CVS: $Id$
290
  * @link     http://pear.php.net/packages/HTML_Template_IT
291
  * @access   public
292
  */
293
@@ -36,7 +36,7 @@
294
 *
295
 * With this class you get the full power of the phplib template class.
296
 * You may have one file with blocks in it but you have as well one main file
297
-* and multiple files one for each block. This is quite usefull when you have
298
+* and multiple files one for each block. This is quite useful when you have
299
 * user configurable websites. Using blocks not in the main template allows
300
 * you to modify some parts of your layout easily.
301
 *
302
@@ -136,7 +136,7 @@
303
      * @access public
304
      * @see    HTML_Template_IT()
305
      */
306
-    function HTML_Template_ITX($root = '')
307
+     function __construct($root = '')
308
     {
309
 
310
         $this->checkblocknameRegExp = '@' . $this->blocknameRegExp . '@';
311
@@ -144,7 +144,7 @@
312
         $this->functionRegExp = '@' . $this->functionPrefix . '(' .
313
                                 $this->functionnameRegExp . ')\s*\(@sm';
314
 
315
-        $this->HTML_Template_IT($root);
316
+        parent::__construct($root);
317
     } // end func constructor
318
 
319
     /**
320
@@ -173,7 +173,7 @@
321
      * Replaces an existing block with new content.
322
      *
323
      * This function will replace a block of the template and all blocks
324
-     * contained in the replaced block and add a new block insted, means
325
+     * contained in the replaced block and add a new block instead, means
326
      * you can dynamically change your template.
327
      *
328
      * Note that changing the template structure violates one of the IT[X]
329
@@ -311,7 +311,7 @@
330
         } elseif (count($parents) > 1) {
331
 
332
             reset($parents);
333
-            while (list($k, $parent) = each($parents)) {
334
+            foreach ($parents as $k => $parent) {
335
                 $msg .= "$parent, ";
336
             }
337
             $msg = substr($parent, -2);
338
@@ -373,7 +373,7 @@
339
      *
340
      * @return   string  Name of the (first) block that contains
341
      *                   the specified placeholder.
342
-     *                   If the placeholder was not found or an error occured
343
+     *                   If the placeholder was not found or an error occurred
344
      *                   an empty string is returned.
345
      * @throws   IT_Error
346
      * @access   public
347
@@ -397,7 +397,7 @@
348
             if (is_array($variables = $this->blockvariables[$block])) {
349
                 // search the value in the list of blockvariables
350
                 reset($variables);
351
-                while (list($k, $variable) = each($variables)) {
352
+                foreach ($variables as $k => $variable) {
353
                     if ($k == $placeholder) {
354
                         $found = $block;
355
                         break;
356
@@ -409,7 +409,7 @@
357
             // search all blocks and return the name of the first block that
358
             // contains the placeholder
359
             reset($this->blockvariables);
360
-            while (list($blockname, $variables) = each($this->blockvariables)) {
361
+            foreach ($this->blockvariables as $blockname => $variables) {
362
                 if (is_array($variables) && isset($variables[$placeholder])) {
363
                     $found = $blockname;
364
                     break;
365
@@ -430,7 +430,7 @@
366
     function performCallback()
367
     {
368
         reset($this->functions);
369
-        while (list($func_id, $function) = each($this->functions)) {
370
+        foreach ($this->functions as $func_id => $function) {
371
             if (isset($this->callback[$function['name']])) {
372
                 if ($this->callback[$function['name']]['expandParameters']) {
373
                     $callFunction = 'call_user_func_array';
374
@@ -493,7 +493,7 @@
375
      *
376
      * This is an absolutely evil feature. If your application makes heavy
377
      * use of such callbacks and you're even implementing if-then etc. on
378
-     * the level of a template engine you're reiventing the wheel... - that's
379
+     * the level of a template engine you're reinventing the wheel... - that's
380
      * actually how PHP came into life. Anyway, sometimes it's handy.
381
      *
382
      * Consider also using XML/XSLT or native PHP. And please do not push
383
@@ -528,7 +528,7 @@
384
      * @return     boolean   False on failure.
385
      * @throws     IT_Error
386
      * @access     public
387
-     * @deprecated The $callbackobject parameter is depricated since
388
+     * @deprecated The $callbackobject parameter is deprecated since
389
      *             version 1.2 and might be dropped in further versions.
390
      */
391
     function setCallbackFunction($tplfunction, $callbackfunction,
392
@@ -536,7 +536,7 @@
393
     $expandCallbackParameters = false) {
394
         if ($tplfunction == '' || $callbackfunction == '') {
395
             return new IT_Error("No template function "."('$tplfunction')".
396
-                                " and/or no callback function ('$callback') given.",
397
+                                " and/or no callback function ('$callbackfunction') given.",
398
                                 __FILE__, __LINE__);
399
         }
400
         $this->callback[$tplfunction] = array(
401
@@ -567,7 +567,7 @@
402
     } // end func setCallbackFunctiontable
403
 
404
     /**
405
-     * Recursively removes all data assiciated with a block, including
406
+     * Recursively removes all data associated with a block, including
407
      * all inner blocks
408
      *
409
      * @param string $block block to be removed
410
@@ -610,7 +610,7 @@
411
     } // end func getBlocklist
412
 
413
     /**
414
-     * Checks wheter a block exists.
415
+     * Checks whether a block exists.
416
      *
417
      * @param string $blockname Blockname
418
      *
419
@@ -647,7 +647,7 @@
420
     } // end func getBlockvariables
421
 
422
     /**
423
-     * Checks wheter a block variable exists.
424
+     * Checks whether a block variable exists.
425
      *
426
      * @param string $block    Blockname
427
      * @param string $variable Variablename
428
@@ -712,7 +712,7 @@
429
     } // end func buildFunctionlist
430
 
431
     /**
432
-     * Truncates the given code from the first occurence of
433
+     * Truncates the given code from the first occurrence of
434
      * $delimiter but ignores $delimiter enclosed by " or '.
435
      *
436
      * @param string $code      The code which should be parsed
437
@@ -782,7 +782,7 @@
438
         }
439
 
440
         reset($this->blockvariables[$block]);
441
-        while (list($varname, $val) = each($this->blockvariables[$block])) {
442
+        foreach ($this->blockvariables[$block] as $varname => $val) {
443
             if (isset($variables[$varname])) {
444
                 unset($this->blockvariables[$block][$varname]);
445
             }
446
@@ -840,10 +840,10 @@
447
     {
448
         $parents = array();
449
         reset($this->blocklist);
450
-        while (list($blockname, $content) = each($this->blocklist)) {
451
+        foreach ($this->blocklist as $blockname => $content) {
452
             reset($this->blockvariables[$blockname]);
453
 
454
-            while (list($varname, $val) = each($this->blockvariables[$blockname])) {
455
+            foreach ($this->blockvariables[$blockname] as $varname => $val) {
456
                 if ($variable == $varname) {
457
                     $parents[] = $blockname;
458
                 }
459
@@ -858,8 +858,8 @@
460
      * calls die() depending on the flags
461
      *
462
      * @param string $message Warning
463
-     * @param string $file    File where the warning occured
464
-     * @param int    $line    Linenumber where the warning occured
465
+     * @param string $file    File where the warning occurred
466
+     * @param int    $line    Linenumber where the warning occurred
467
      *
468
      * @see      $warn, $printWarning, $haltOnWarning
469
      * @access   private
470
--- libraries/pear/HTML/Template/IT_Error.php	2020-01-19 18:03:01.000000000 +0100
471
+++ libraries/pear/HTML/Template/IT_Error.php	2022-02-18 17:22:29.000000000 +0100
472
@@ -11,7 +11,7 @@
473
  * with this package in the file LICENSE, and is available through      
474
  * the world-wide-web at                                                
475
  * http://www.opensource.org/licenses/bsd-license.php                   
476
- * If you did not receive a copy of the new BSDlicense and are unable   
477
+ * If you did not receive a copy of the new BSD license and are unable
478
  * to obtain it through the world-wide-web, please send a note to       
479
  * pajoye@php.net so we can mail you a copy immediately.                
480
  * 
481
@@ -23,7 +23,7 @@
482
  * @package  HTML_Template_IT
483
  * @author   Ulf Wendel <uw@netuse.de>
484
  * @license  BSD http://www.opensource.org/licenses/bsd-license.php
485
- * @version  CVS: $Id: IT_Error.php 3 2017-06-22 07:32:17Z martin $
486
+ * @version  CVS: $Id$
487
  * @link     http://pear.php.net/packages/HTML_Template_IT
488
  * @access   public
489
  */
490
@@ -53,10 +53,10 @@
491
      * Creates an cache error object.
492
      * 
493
      * @param string $msg  error message
494
-     * @param string $file file where the error occured
495
-     * @param string $line linenumber where the error occured
496
+     * @param string $file file where the error occurred
497
+     * @param string $line linenumber where the error occurred
498
      */
499
-    function IT_Error($msg, $file = __FILE__, $line = __LINE__)
500
+    function __construct($msg, $file = __FILE__, $line = __LINE__)
501
     {
502
         $this->PEAR_Error(sprintf("%s [%s on line %d].", $msg, $file, $line)); 
503
     } // end func IT_Error

Return to bug 262022