|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-09-09 08:23 UTC] quipo@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 23:00:01 2025 UTC |
Description: ------------ When using strict error handling Pager_Sliding will fail because of an undefined $_GET[$this->_urlVar]) in line 882 A simple fix for this would be, to check if it is empty: if(!empty($_GET[$this->_urlVar])) { $this->_currentPage = max((int)@$_GET[$this->_urlVar], 1); } Reproduce code: --------------- <? require_once 'PEAR.php'; require_once('Pager/Sliding.php'); error_reporting(E_ALL); function php_error_handler($errno, $errstr, $errfile, $errline) { echo "<b>$errfile ($errline)</b><br>$errstr"; exit(); } set_error_handler('php_error_handler'); $params['totalItems'] = 10; $params['perPage'] = 10; $pager = &new Pager_Sliding($params); $links = $pager->getLinks(); print_r($links); ?> Expected result: ---------------- Array ( [0] => [1] => [2] => [3] => [4] => [5] => [back] => [pages] => [next] => [first] => [last] => [all] => ) Actual result: -------------- /usr/lib/php/Pager/Sliding.php (882) Undefined index: pageID