#25449 [NEW]: Small fix for PEAR::Pager_Sliding
| From: | info at rhalff dot com | Date: | Tue, 09 Sep 2003 12:12:25 +0000 |
| Subject: | #25449 [NEW]: Small fix for PEAR::Pager_Sliding | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-21243@lists.php.net to get a copy of this message | ||
From: info at rhalff dot com
Operating system: linux
PHP version: Irrelevant
PHP Bug Type: PEAR related
Bug description: Small fix for PEAR::Pager_Sliding
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
--
Edit bug report at http://bugs.php.net/?id=25449&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25449&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25449&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25449&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25449&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25449&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25449&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25449&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25449&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25449&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25449&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25449&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25449&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25449&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25449&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25449&r=gnused