FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17811&edit=1

ID: 17811
Comment by: pavelvr
Reported By: pavel dot vrany at gmail dot com
Summary: pagination urls have trailing /
Status: Feedback
Type: Bug
Package: Pager
Operating System: debian lenny
Package Version: 2.4.8
PHP Version: 5.2.6
Assigned To: quipo
New Comment:

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//"


Previous Comments:
------------------------------------------------------------------------

[2011-03-06 14:39:10] quipo

<div id="changeset">
<span class="removed">-Status: Open</span>
<span class="added">+Status: Feedback</span>
<span class="removed">-Assigned To:</span>
<span class="added">+Assigned To: quipo</span>
</div>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
}

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMay 4, '11 at 2:34p
activeMay 4, '11 at 2:34p
posts1
users1
websitepear.php.net

1 user in discussion

Pavelvr: 1 post

People

Translate

site design / logo © 2022 Grokbase