FreeBSD Bugzilla – Attachment 231921 Details for
Bug 262022
net-mgmt/nagiosql: Add DEPRECATED and fix for PHP 7.4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for PHP7.4
nagiosql_port.diff (text/plain), 27.41 KB, created by
Helmut Ritter
on 2022-02-18 16:55:06 UTC
(
hide
)
Description:
Patch for PHP7.4
Filename:
MIME Type:
Creator:
Helmut Ritter
Created:
2022-02-18 16:55:06 UTC
Size:
27.41 KB
patch
obsolete
>diff -ruN ./nagiosql.org/Makefile ./nagiosql/Makefile >--- ./nagiosql.org/Makefile 2022-02-18 17:43:22.393672000 +0100 >+++ ./nagiosql/Makefile 2022-02-18 16:59:55.000000000 +0100 >@@ -10,9 +10,14 @@ > LICENSE= GPLv2 > LICENSE_FILE= ${WRKSRC}/LICENSE > >-RUN_DEPENDS= nagios:net-mgmt/nagios \ >- ${PEARDIR}/HTML/Template/IT.php:devel/pear-HTML_Template_IT@${PHP_FLAVOR} >+DEPRECATED= Requires php 7.4 which is set to expire on 2022-11-29 >+EXPIRATION_DATE=2022-11-28 > >+IGNORE_WITH_PHP=80 81 >+ >+RUN_DEPENDS=nagios:net-mgmt/nagios4 \ >+ ${PEARDIR}/HTML/Template/IT.php:devel/pear-HTML_Template_IT@${PHP_FLAVOR} >+ > USES= cpe gettext mysql php:web tar:bzip2 > USE_PHP= filter gettext mysqli session simplexml > >@@ -22,7 +27,7 @@ > > USERS?= nagios > GROUPS?= nagios >-NAGIOSUSER?= nagios >+NAGIOSUSER?=nagios > > NO_BUILD= yes > NO_ARCH= yes >diff -ruN ./nagiosql.org/files/patch-admin_dir.diff ./nagiosql/files/patch-admin_dir.diff >--- ./nagiosql.org/files/patch-admin_dir.diff 1970-01-01 01:00:00.000000000 +0100 >+++ ./nagiosql/files/patch-admin_dir.diff 2022-02-18 16:48:18.000000000 +0100 >@@ -0,0 +1,108 @@ >+--- admin/groupusers.php.orig 2020-01-19 18:03:01.000000000 +0100 >++++ admin/groupusers.php 2022-02-17 18:46:54.630851000 +0100 >+@@ -53,10 +53,10 @@ >+ } >+ $chkRights = $strRights; >+ } >+-if (get_magic_quotes_gpc() == 0) { >+- $chkUser = addslashes($chkUser); >+- $chkRights = addslashes($chkRights); >+-} >++#if (get_magic_quotes_gpc() == 0) { >++$chkUser = addslashes($chkUser); >++$chkRights = addslashes($chkRights); >++#} >+ // >+ // Get datasets >+ // ============ >+@@ -181,4 +181,4 @@ >+ ?> >+ </table> >+ </body> >+-</html> >+\ No newline at end of file >++</html> >+--- admin/helpedit.php.orig 2020-01-19 18:03:01.000000000 +0100 >++++ admin/helpedit.php 2022-02-17 18:47:17.798070000 +0100 >+@@ -43,12 +43,12 @@ >+ // >+ // Quote special characters >+ // ========================== >+-if (get_magic_quotes_gpc() == 0) { >+- $chkHidVersion = addslashes($chkHidVersion); >+- $chkKey1 = addslashes($chkKey1); >+- $chkKey2 = addslashes($chkKey2); >+- $chkVersion = addslashes($chkVersion); >+-} >++#if (get_magic_quotes_gpc() == 0) { >++$chkHidVersion = addslashes($chkHidVersion); >++$chkKey1 = addslashes($chkKey1); >++$chkKey2 = addslashes($chkKey2); >++$chkVersion = addslashes($chkVersion); >++#} >+ // >+ // Security function for text fields >+ // ================================= >+--- admin/templatedefinitions.php.orig 2020-01-19 18:03:01.000000000 +0100 >++++ admin/templatedefinitions.php 2022-02-17 18:47:41.015366000 +0100 >+@@ -40,9 +40,9 @@ >+ if ($chkDataId == '') { >+ $chkDataId = 0; >+ } >+-if (get_magic_quotes_gpc() == 0) { >+- $chkDef = addslashes($chkDef); >+-} >++#if (get_magic_quotes_gpc() == 0) { >++$chkDef = addslashes($chkDef); >++#} >+ $arrDefinition = explode('::', $chkDef); >+ if ($chkType == '') { >+ exit; >+--- admin/timedefinitions.php.orig 2020-01-19 18:03:01.000000000 +0100 >++++ admin/timedefinitions.php 2022-02-17 18:48:02.272471000 +0100 >+@@ -38,10 +38,10 @@ >+ $chkDef = filter_input(INPUT_GET, 'def', FILTER_SANITIZE_STRING); >+ $chkRange = filter_input(INPUT_GET, 'range', FILTER_SANITIZE_STRING); >+ $chkId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); >+-if (get_magic_quotes_gpc() == 0) { >+- $chkDef = addslashes($chkDef); >+- $chkRange = addslashes($chkRange); >+-} >++#if (get_magic_quotes_gpc() == 0) { >++$chkDef = addslashes($chkDef); >++$chkRange = addslashes($chkRange); >++#} >+ // >+ // Get data >+ // ======== >+@@ -195,4 +195,4 @@ >+ ?> >+ </table> >+ </body> >+-</html> >+\ No newline at end of file >++</html> >+--- admin/variabledefinitions.php.orig 2020-01-19 18:03:01.000000000 +0100 >++++ admin/variabledefinitions.php 2022-02-17 18:48:25.573841000 +0100 >+@@ -37,10 +37,10 @@ >+ $chkDef = filter_input(INPUT_GET, 'def', FILTER_SANITIZE_STRING); >+ $chkRange = filter_input(INPUT_GET, 'range', FILTER_SANITIZE_STRING); >+ $chkLinkTab = filter_input(INPUT_GET, 'linktab', FILTER_SANITIZE_STRING); >+-if (get_magic_quotes_gpc() == 0) { >+- $chkDef = addslashes($chkDef); >+- $chkRange = addslashes($chkRange); >+-} >++#if (get_magic_quotes_gpc() == 0) { >++$chkDef = addslashes($chkDef); >++$chkRange = addslashes($chkRange); >++#} >+ // >+ // Get data >+ // ======== >+@@ -172,4 +172,4 @@ >+ ?> >+ </table> >+ </body> >+-</html> >+\ No newline at end of file >++</html> >diff -ruN ./nagiosql.org/files/patch-functions_dir.diff ./nagiosql/files/patch-functions_dir.diff >--- ./nagiosql.org/files/patch-functions_dir.diff 1970-01-01 01:00:00.000000000 +0100 >+++ ./nagiosql/files/patch-functions_dir.diff 2022-02-18 16:48:43.000000000 +0100 >@@ -0,0 +1,81 @@ >+--- functions/prepend_content.php.orig 2020-01-19 18:03:01.000000000 +0100 >++++ functions/prepend_content.php 2022-02-17 18:53:43.081225000 +0100 >+@@ -64,9 +64,9 @@ >+ for ($i = 1; $i <= 23; $i++) { >+ $tmpVar = 'chkTfValue'.$i; >+ $$tmpVar = filter_input(INPUT_POST, 'tfValue'.$i, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES); >+- if (get_magic_quotes_gpc() == 0) { >+- $$tmpVar = addslashes($$tmpVar); >+- } >++# if (get_magic_quotes_gpc() == 0) { >++ $$tmpVar = addslashes($$tmpVar); >++# } >+ if (isset($$tmpVar)) { >+ $$tmpVar = $myVisClass->tfSecure($$tmpVar); >+ } >+@@ -75,9 +75,9 @@ >+ for ($i = 1; $i <= 8; $i++) { >+ $tmpVar = 'chkTfArg'.$i; >+ $$tmpVar = filter_input(INPUT_POST, 'tfArg'.$i, FILTER_UNSAFE_RAW); >+- if (get_magic_quotes_gpc() == 0) { >+- $$tmpVar = addslashes($$tmpVar); >+- } >++# if (get_magic_quotes_gpc() == 0) { >++ $$tmpVar = addslashes($$tmpVar); >++# } >+ if (isset($$tmpVar)) { >+ $$tmpVar = $myVisClass->tfSecure($$tmpVar); >+ } >+@@ -86,9 +86,9 @@ >+ for ($i = 1; $i <= 8; $i++) { >+ $tmpVar = 'chkTaArg'.$i.'Info'; >+ $$tmpVar = filter_input(INPUT_POST, 'taArg'.$i.'Info', FILTER_UNSAFE_RAW); >+- if (get_magic_quotes_gpc() == 0) { >+- $$tmpVar = addslashes($$tmpVar); >+- } >++# if (get_magic_quotes_gpc() == 0) { >++ $$tmpVar = addslashes($$tmpVar); >++# } >+ if (isset($$tmpVar)) { >+ $$tmpVar = $myVisClass->tfSecure($$tmpVar); >+ } >+@@ -99,12 +99,14 @@ >+ $tmpVar2 = 'intMselValue'.$i; >+ $$tmpVar = filter_input(INPUT_POST, 'mselValue'.$i, FILTER_SANITIZE_STRING, FILTER_FORCE_ARRAY); >+ // Multiselect data processing >+- if ((${$tmpVar}[0] == '') || (${$tmpVar}[0] == '0')) { >+- $$tmpVar2 = 0; >+- } elseif (${$tmpVar}[0] == '*') { >+- $$tmpVar2 = 2; >+- } else { >+- $$tmpVar2 = 1; >++ if (isset(${$tmpVar}[0])) { >++ if ((${$tmpVar}[0] == '') || (${$tmpVar}[0] == '0')) { >++ $$tmpVar2 = 0; >++ } elseif (${$tmpVar}[0] == '*') { >++ $$tmpVar2 = 2; >++ } else { >++ $$tmpVar2 = 1; >++ } >+ } >+ } >+ // Common select field value >+@@ -157,12 +159,12 @@ >+ // >+ // Quote special characters >+ // ========================== >+-if (get_magic_quotes_gpc() == 0) { >+- $chkTfSearchRaw = addslashes($chkTfSearchRaw); >+- $chkTaValue1Raw = addslashes($chkTaValue1Raw); >+- $chkTaFileTextRaw = addslashes($chkTaFileTextRaw); >+- $chkTfSpValue1 = addslashes($chkTfSpValue1); >+-} >++#if (get_magic_quotes_gpc() == 0) { >++$chkTfSearchRaw = addslashes($chkTfSearchRaw); >++$chkTaValue1Raw = addslashes($chkTaValue1Raw); >++$chkTaFileTextRaw = addslashes($chkTaFileTextRaw); >++$chkTfSpValue1 = addslashes($chkTfSpValue1); >++#} >+ // >+ // Security function for text fields >+ // ================================= >diff -ruN ./nagiosql.org/files/patch-libraries_dir.diff ./nagiosql/files/patch-libraries_dir.diff >--- ./nagiosql.org/files/patch-libraries_dir.diff 1970-01-01 01:00:00.000000000 +0100 >+++ ./nagiosql/files/patch-libraries_dir.diff 2022-02-18 17:38:59.000000000 +0100 >@@ -0,0 +1,503 @@ >+--- libraries/pear/HTML/Template/IT.php.orig 2020-01-19 18:03:01.000000000 +0100 >++++ libraries/pear/HTML/Template/IT.php 2022-02-18 17:21:48.000000000 +0100 >+@@ -11,7 +11,7 @@ >+ * with this package in the file LICENSE, and is available through >+ * the world-wide-web at >+ * http://www.opensource.org/licenses/bsd-license.php >+- * If you did not receive a copy of the new BSDlicense and are unable >++ * If you did not receive a copy of the new BSD license and are unable >+ * to obtain it through the world-wide-web, please send a note to >+ * pajoye@php.net so we can mail you a copy immediately. >+ * >+@@ -23,13 +23,12 @@ >+ * @package HTML_Template_IT >+ * @author Ulf Wendel <uw@netuse.de> >+ * @license BSD http://www.opensource.org/licenses/bsd-license.php >+- * @version CVS: $Id: IT.php 3 2017-06-22 07:32:17Z martin $ >++ * @version CVS: $Id$ >+ * @link http://pear.php.net/packages/HTML_Template_IT >+ * @access public >+ */ >+ >+ require_once 'PEAR.php'; >+-$myPEAR = new PEAR(); >+ >+ define('IT_OK', 1); >+ define('IT_ERROR', -1); >+@@ -49,7 +48,7 @@ >+ * one you can build. template::parse() [phplib template = Isotemplate] requests >+ * you to name a source and a target where the current block gets parsed into. >+ * Source and target can be block names or even handler names. This API gives you >+- * a maximum of fexibility but you always have to know what you do which is >++ * a maximum of flexibility but you always have to know what you do which is >+ * quite unusual for php skripter like me. >+ * >+ * I noticed that I do not any control on which block gets parsed into which one. >+@@ -279,9 +278,9 @@ >+ * should be preserved although they are empty (no placeholder replaced). >+ * Think of a shopping basket. If it's empty you have to drop a message to >+ * the user. If it's filled you have to show the contents of >+- * the shopping baseket. Now where do you place the message that the basket >++ * the shopping basket. Now where do you place the message that the basket >+ * is empty? It's no good idea to place it in you applications as customers >+- * tend to like unecessary minor text changes. Having another template file >++ * tend to like unnecessary minor text changes. Having another template file >+ * for an empty basket means that it's very likely that one fine day >+ * the filled and empty basket templates have different layout. I decided >+ * to introduce blocks that to not contain any placeholder but only >+@@ -289,7 +288,7 @@ >+ * >+ * Now if there is no replacement done in such a block the block will >+ * be recognized as "empty" and by default ($removeEmptyBlocks = true) be >+- * stripped off. To avoid thisyou can now call touchBlock() to avoid this. >++ * stripped off. To avoid this you can now call touchBlock() to avoid this. >+ * >+ * The array $touchedBlocks stores a list of touched block which must not >+ * be removed even if they are empty. >+@@ -301,14 +300,6 @@ >+ var $touchedBlocks = array(); >+ >+ /** >+- * List of blocks which should not be shown even if not "empty" >+- * @var array $_hiddenBlocks >+- * @see hideBlock(), $removeEmptyBlocks >+- * @access private >+- */ >+- var $_hiddenBlocks = array(); >+- >+- /** >+ * Variable cache. >+ * >+ * Variables get cached before any replacement is done. >+@@ -395,7 +386,7 @@ >+ ); >+ >+ /** >+- * Builds some complex regular expressions and optinally sets the >++ * Builds some complex regular expressions and optionally sets the >+ * file root directory. >+ * >+ * Make sure that you call this constructor if you derive your template >+@@ -408,7 +399,7 @@ >+ * @see setRoot() >+ * @access public >+ */ >+- function __construct($root = '', $options = null) >++ function __construct($root = '', $options = null) >+ { >+ if (!is_null($options)) { >+ $this->setOptions($options); >+@@ -440,8 +431,7 @@ >+ */ >+ function setOption($option, $value) >+ { >+- global $myPEAR; >+- switch ($option) { >++ switch ($option) { >+ case 'removeEmptyBlocks': >+ $this->removeEmptyBlocks = $value; >+ return IT_OK; >+@@ -452,7 +442,7 @@ >+ return IT_OK; >+ } >+ >+- return $myPEAR->raiseError( >++ return PEAR::raiseError( >+ $this->errorMessage(IT_UNKNOWN_OPTION) . ": '{$option}'", >+ IT_UNKNOWN_OPTION >+ ); >+@@ -472,12 +462,10 @@ >+ */ >+ function setOptions($options) >+ { >+- global $myPEAR; >+ if (is_array($options)) { >+ foreach ($options as $option => $value) { >+ $error = $this->setOption($option, $value); >+- if ($myPEAR->isError($error)) { >+- >++ if (PEAR::isError($error)) { >+ return $error; >+ } >+ } >+@@ -512,13 +500,12 @@ >+ */ >+ function get($block = '__global__') >+ { >+- global $myPEAR; >+- if ($block == '__global__' && !$this->flagGlobalParsed) { >++ if ($block == '__global__' && !$this->flagGlobalParsed) { >+ $this->parse('__global__'); >+ } >+ >+ if (!isset($this->blocklist[$block])) { >+- $this->err[] = $myPEAR->raiseError( >++ $this->err[] = PEAR::raiseError( >+ $this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'", >+ IT_BLOCK_NOT_FOUND >+ ); >+@@ -562,11 +549,10 @@ >+ */ >+ function parse($block = '__global__', $flag_recursion = false) >+ { >+- global $myPEAR; >+- static $regs, $values; >++ static $regs, $values; >+ >+ if (!isset($this->blocklist[$block])) { >+- return $myPEAR->raiseError( >++ return PEAR::raiseError( >+ $this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'", >+ IT_BLOCK_NOT_FOUND >+ ); >+@@ -754,7 +740,7 @@ >+ /** >+ * Sets a variable value. >+ * >+- * The function can be used eighter like setVariable( "varname", "value") >++ * The function can be used either like setVariable( "varname", "value") >+ * or with one array $variables["varname"] = "value" >+ * given setVariable($variables) quite like phplib templates set_var(). >+ * >+@@ -791,9 +777,9 @@ >+ */ >+ function setCurrentBlock($block = '__global__') >+ { >+- global $myPEAR; >++ >+ if (!isset($this->blocklist[$block])) { >+- return $myPEAR->raiseError( >++ return PEAR::raiseError( >+ $this->errorMessage(IT_BLOCK_NOT_FOUND) >+ . '"' . $block . "'", >+ IT_BLOCK_NOT_FOUND >+@@ -817,9 +803,8 @@ >+ */ >+ function touchBlock($block) >+ { >+- global $myPEAR; >+- if (!isset($this->blocklist[$block])) { >+- return $myPEAR->raiseError( >++ if (!isset($this->blocklist[$block])) { >++ return PEAR::raiseError( >+ $this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'", >+ IT_BLOCK_NOT_FOUND >+ ); >+@@ -876,7 +861,7 @@ >+ /** >+ * Sets the template. >+ * >+- * You can eighter load a template file from disk with >++ * You can either load a template file from disk with >+ * LoadTemplatefile() or set the template manually using this function. >+ * >+ * @param string $template template content >+@@ -1009,7 +994,7 @@ >+ } // end func getGlobalvariables >+ >+ /** >+- * Recusively builds a list of all blocks within the template. >++ * Recursively builds a list of all blocks within the template. >+ * >+ * @param string $string string that gets scanned >+ * >+@@ -1019,8 +1004,7 @@ >+ */ >+ function findBlocks($string) >+ { >+- global $myPEAR; >+- $blocklist = array(); >++ $blocklist = array(); >+ >+ if (preg_match_all($this->blockRegExp, $string, $regs, PREG_SET_ORDER)) { >+ foreach ($regs as $k => $match) { >+@@ -1030,7 +1014,7 @@ >+ if (isset($this->blocklist[$blockname])) { >+ $msg = $this->errorMessage(IT_BLOCK_DUPLICATE, $blockname); >+ >+- $this->err[] = $myPEAR->raiseError($msg, IT_BLOCK_DUPLICATE); >++ $this->err[] = PEAR::raiseError($msg, IT_BLOCK_DUPLICATE); >+ >+ $this->flagBlocktrouble = true; >+ } >+@@ -1073,15 +1057,14 @@ >+ */ >+ function getFile($filename) >+ { >+- global $myPEAR; >+- if ($filename{0} == '/' && substr($this->fileRoot, -1) == '/') { >++ if ($filename[0] == '/' && substr($this->fileRoot, -1) == '/') { >+ $filename = substr($filename, 1); >+ } >+ >+ $filename = $this->fileRoot . $filename; >+ >+ if (!($fh = @fopen($filename, 'r'))) { >+- $this->err[] = $myPEAR->raiseError( >++ $this->err[] = PEAR::raiseError( >+ $this->errorMessage(IT_TPL_NOT_FOUND) . ': "' .$filename .'"', >+ IT_TPL_NOT_FOUND >+ ); >+@@ -1097,10 +1080,9 @@ >+ $content = fread($fh, $fsize); >+ fclose($fh); >+ >+- // "#<!-- INCLUDE (.*) -->#ime", wma/PEAR error >+- return preg_replace( >++ return preg_replace_callback( >+ "#<!-- INCLUDE (.*) -->#im", >+- "\$this->getFile('\\1')", >++ function ($m) { return $this->getFile($m[1]); }, >+ $content >+ ); >+ } // end func getFile >+@@ -1169,8 +1151,7 @@ >+ */ >+ function errorMessage($value, $blockname = '') >+ { >+- global $myPEAR; >+- static $errorMessages; >++ static $errorMessages; >+ if (!isset($errorMessages)) { >+ $errorMessages = array( >+ IT_OK => '', >+@@ -1186,7 +1167,7 @@ >+ ); >+ } >+ >+- if ($myPEAR->isError($value)) { >++ if (PEAR::isError($value)) { >+ $value = $value->getCode(); >+ } >+ >+--- libraries/pear/HTML/Template/ITX.php.orig 2020-01-19 18:03:01.000000000 +0100 >++++ libraries/pear/HTML/Template/ITX.php 2022-02-18 17:22:12.000000000 +0100 >+@@ -11,7 +11,7 @@ >+ * with this package in the file LICENSE, and is available through >+ * the world-wide-web at >+ * http://www.opensource.org/licenses/bsd-license.php >+- * If you did not receive a copy of the new BSDlicense and are unable >++ * If you did not receive a copy of the new BSD license and are unable >+ * to obtain it through the world-wide-web, please send a note to >+ * pajoye@php.net so we can mail you a copy immediately. >+ * >+@@ -23,7 +23,7 @@ >+ * @package HTML_Template_IT >+ * @author Ulf Wendel <uw@netuse.de> >+ * @license BSD http://www.opensource.org/licenses/bsd-license.php >+- * @version CVS: $Id: ITX.php 3 2017-06-22 07:32:17Z martin $ >++ * @version CVS: $Id$ >+ * @link http://pear.php.net/packages/HTML_Template_IT >+ * @access public >+ */ >+@@ -36,7 +36,7 @@ >+ * >+ * With this class you get the full power of the phplib template class. >+ * You may have one file with blocks in it but you have as well one main file >+-* and multiple files one for each block. This is quite usefull when you have >++* and multiple files one for each block. This is quite useful when you have >+ * user configurable websites. Using blocks not in the main template allows >+ * you to modify some parts of your layout easily. >+ * >+@@ -136,7 +136,7 @@ >+ * @access public >+ * @see HTML_Template_IT() >+ */ >+- function HTML_Template_ITX($root = '') >++ function __construct($root = '') >+ { >+ >+ $this->checkblocknameRegExp = '@' . $this->blocknameRegExp . '@'; >+@@ -144,7 +144,7 @@ >+ $this->functionRegExp = '@' . $this->functionPrefix . '(' . >+ $this->functionnameRegExp . ')\s*\(@sm'; >+ >+- $this->HTML_Template_IT($root); >++ parent::__construct($root); >+ } // end func constructor >+ >+ /** >+@@ -173,7 +173,7 @@ >+ * Replaces an existing block with new content. >+ * >+ * This function will replace a block of the template and all blocks >+- * contained in the replaced block and add a new block insted, means >++ * contained in the replaced block and add a new block instead, means >+ * you can dynamically change your template. >+ * >+ * Note that changing the template structure violates one of the IT[X] >+@@ -311,7 +311,7 @@ >+ } elseif (count($parents) > 1) { >+ >+ reset($parents); >+- while (list($k, $parent) = each($parents)) { >++ foreach ($parents as $k => $parent) { >+ $msg .= "$parent, "; >+ } >+ $msg = substr($parent, -2); >+@@ -373,7 +373,7 @@ >+ * >+ * @return string Name of the (first) block that contains >+ * the specified placeholder. >+- * If the placeholder was not found or an error occured >++ * If the placeholder was not found or an error occurred >+ * an empty string is returned. >+ * @throws IT_Error >+ * @access public >+@@ -397,7 +397,7 @@ >+ if (is_array($variables = $this->blockvariables[$block])) { >+ // search the value in the list of blockvariables >+ reset($variables); >+- while (list($k, $variable) = each($variables)) { >++ foreach ($variables as $k => $variable) { >+ if ($k == $placeholder) { >+ $found = $block; >+ break; >+@@ -409,7 +409,7 @@ >+ // search all blocks and return the name of the first block that >+ // contains the placeholder >+ reset($this->blockvariables); >+- while (list($blockname, $variables) = each($this->blockvariables)) { >++ foreach ($this->blockvariables as $blockname => $variables) { >+ if (is_array($variables) && isset($variables[$placeholder])) { >+ $found = $blockname; >+ break; >+@@ -430,7 +430,7 @@ >+ function performCallback() >+ { >+ reset($this->functions); >+- while (list($func_id, $function) = each($this->functions)) { >++ foreach ($this->functions as $func_id => $function) { >+ if (isset($this->callback[$function['name']])) { >+ if ($this->callback[$function['name']]['expandParameters']) { >+ $callFunction = 'call_user_func_array'; >+@@ -493,7 +493,7 @@ >+ * >+ * This is an absolutely evil feature. If your application makes heavy >+ * use of such callbacks and you're even implementing if-then etc. on >+- * the level of a template engine you're reiventing the wheel... - that's >++ * the level of a template engine you're reinventing the wheel... - that's >+ * actually how PHP came into life. Anyway, sometimes it's handy. >+ * >+ * Consider also using XML/XSLT or native PHP. And please do not push >+@@ -528,7 +528,7 @@ >+ * @return boolean False on failure. >+ * @throws IT_Error >+ * @access public >+- * @deprecated The $callbackobject parameter is depricated since >++ * @deprecated The $callbackobject parameter is deprecated since >+ * version 1.2 and might be dropped in further versions. >+ */ >+ function setCallbackFunction($tplfunction, $callbackfunction, >+@@ -536,7 +536,7 @@ >+ $expandCallbackParameters = false) { >+ if ($tplfunction == '' || $callbackfunction == '') { >+ return new IT_Error("No template function "."('$tplfunction')". >+- " and/or no callback function ('$callback') given.", >++ " and/or no callback function ('$callbackfunction') given.", >+ __FILE__, __LINE__); >+ } >+ $this->callback[$tplfunction] = array( >+@@ -567,7 +567,7 @@ >+ } // end func setCallbackFunctiontable >+ >+ /** >+- * Recursively removes all data assiciated with a block, including >++ * Recursively removes all data associated with a block, including >+ * all inner blocks >+ * >+ * @param string $block block to be removed >+@@ -610,7 +610,7 @@ >+ } // end func getBlocklist >+ >+ /** >+- * Checks wheter a block exists. >++ * Checks whether a block exists. >+ * >+ * @param string $blockname Blockname >+ * >+@@ -647,7 +647,7 @@ >+ } // end func getBlockvariables >+ >+ /** >+- * Checks wheter a block variable exists. >++ * Checks whether a block variable exists. >+ * >+ * @param string $block Blockname >+ * @param string $variable Variablename >+@@ -712,7 +712,7 @@ >+ } // end func buildFunctionlist >+ >+ /** >+- * Truncates the given code from the first occurence of >++ * Truncates the given code from the first occurrence of >+ * $delimiter but ignores $delimiter enclosed by " or '. >+ * >+ * @param string $code The code which should be parsed >+@@ -782,7 +782,7 @@ >+ } >+ >+ reset($this->blockvariables[$block]); >+- while (list($varname, $val) = each($this->blockvariables[$block])) { >++ foreach ($this->blockvariables[$block] as $varname => $val) { >+ if (isset($variables[$varname])) { >+ unset($this->blockvariables[$block][$varname]); >+ } >+@@ -840,10 +840,10 @@ >+ { >+ $parents = array(); >+ reset($this->blocklist); >+- while (list($blockname, $content) = each($this->blocklist)) { >++ foreach ($this->blocklist as $blockname => $content) { >+ reset($this->blockvariables[$blockname]); >+ >+- while (list($varname, $val) = each($this->blockvariables[$blockname])) { >++ foreach ($this->blockvariables[$blockname] as $varname => $val) { >+ if ($variable == $varname) { >+ $parents[] = $blockname; >+ } >+@@ -858,8 +858,8 @@ >+ * calls die() depending on the flags >+ * >+ * @param string $message Warning >+- * @param string $file File where the warning occured >+- * @param int $line Linenumber where the warning occured >++ * @param string $file File where the warning occurred >++ * @param int $line Linenumber where the warning occurred >+ * >+ * @see $warn, $printWarning, $haltOnWarning >+ * @access private >+--- libraries/pear/HTML/Template/IT_Error.php 2020-01-19 18:03:01.000000000 +0100 >++++ libraries/pear/HTML/Template/IT_Error.php 2022-02-18 17:22:29.000000000 +0100 >+@@ -11,7 +11,7 @@ >+ * with this package in the file LICENSE, and is available through >+ * the world-wide-web at >+ * http://www.opensource.org/licenses/bsd-license.php >+- * If you did not receive a copy of the new BSDlicense and are unable >++ * If you did not receive a copy of the new BSD license and are unable >+ * to obtain it through the world-wide-web, please send a note to >+ * pajoye@php.net so we can mail you a copy immediately. >+ * >+@@ -23,7 +23,7 @@ >+ * @package HTML_Template_IT >+ * @author Ulf Wendel <uw@netuse.de> >+ * @license BSD http://www.opensource.org/licenses/bsd-license.php >+- * @version CVS: $Id: IT_Error.php 3 2017-06-22 07:32:17Z martin $ >++ * @version CVS: $Id$ >+ * @link http://pear.php.net/packages/HTML_Template_IT >+ * @access public >+ */ >+@@ -53,10 +53,10 @@ >+ * Creates an cache error object. >+ * >+ * @param string $msg error message >+- * @param string $file file where the error occured >+- * @param string $line linenumber where the error occured >++ * @param string $file file where the error occurred >++ * @param string $line linenumber where the error occurred >+ */ >+- function IT_Error($msg, $file = __FILE__, $line = __LINE__) >++ function __construct($msg, $file = __FILE__, $line = __LINE__) >+ { >+ $this->PEAR_Error(sprintf("%s [%s on line %d].", $msg, $file, $line)); >+ } // end func IT_Error
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 262022
:
231902
|
231903
|
231904
| 231921 |
231922