Edit report at http://pear.php.net/bugs/bug.php?id=17811&edit=1
ID: 17811
Updated by: daniel.oconnor@gmail.com
Reported By: mottahedin at yahoo dot com
Summary: pagination urls have trailing /
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Pager
Operating System: debian lenny
Package Version: 2.4.8
PHP Version: 5.2.6
Assigned To: quipo
Roadmap Versions:
New Comment:
-Status: Feedback
+Status: No Feedback
Previous Comments:
------------------------------------------------------------------------
[2011-05-04 15:31:56] pavelvr
I have similar problem.
I propose to add this code to Common.php:
[php]
if (substr($this->_url, -2) == '//') {
$this->_url = substr($this->_url, 0, -1);
}
[/php]
My $_SERVER['PHP_SELF'] don't contains "index.php". (It's propably
caused by using Apache mod_rewrite.)
then:
echo $_SERVER['PHP SELF'];
=> /example/
echo preg_replace('/(.*)\?.*/', '\\1', basename($_SERVER['PHP_SELF']));
=> example
echo str_replace('\\', '/', dirname($_SERVER['PHP_SELF']));
=> /
$this->_url = $this->_path.(empty($this->_path) ? '' :
'/').$this->_fileName;
=>
_path: "/example/"
_fileName: ""
_url: "/example//"
------------------------------------------------------------------------
[2011-03-06 14:39:10] quipo
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: quipo
This might not be a bug but a design decision. How are you using Pager,
and what do
you want to achieve? Can I see a reproducing script?
------------------------------------------------------------------------
[2010-08-24 19:48:13] shirali19
Description:
------------
pagination urls have a trailing '/' which needs to be stripped. Bug fix:
In the file Common.php, function setOptions, add the following line,
commented by '***':
if (substr($this->_path, -1, 1) == '/') {
$this->_fileName = ltrim($this->_fileName, '/'); //strip
leading slash
$this->_path = rtrim($this->_path, '/'); //*** strip
trailing slash
}
------------------------------------------------------------------------