[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-cvs
Subject:    [PEAR-CVS] cvs: pear /Pager Common.php package.xml
From:       "Lorenzo Alberton" <quipo () php ! net>
Date:       2008-05-31 12:44:55
Message-ID: cvsquipo1212237895 () cvsserver
[Download RAW message or body]

quipo		Sat May 31 12:44:55 2008 UTC

  Modified files:              
    /pear/Pager	Common.php package.xml 
  Log:
  fixed bug #13881: fix for relative links (introduced in v.2.4.5) may cause some \
issues with absolute links  
http://cvs.php.net/viewvc.cgi/pear/Pager/Common.php?r1=1.81&r2=1.82&diff_format=u
Index: pear/Pager/Common.php
diff -u pear/Pager/Common.php:1.81 pear/Pager/Common.php:1.82
--- pear/Pager/Common.php:1.81	Sun May 18 18:06:38 2008
+++ pear/Pager/Common.php	Sat May 31 12:44:55 2008
@@ -33,7 +33,7 @@
  * @author    Richard Heyes <richard@phpguru.org>
  * @copyright 2003-2007 Lorenzo Alberton, Richard Heyes
  * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
- * @version   CVS: $Id: Common.php,v 1.81 2008/05/18 18:06:38 quipo Exp $
+ * @version   CVS: $Id: Common.php,v 1.82 2008/05/31 12:44:55 quipo Exp $
  * @link      http://pear.php.net/package/Pager
  */
 
@@ -1562,23 +1562,27 @@
             $this->_httpMethod = strtoupper($this->_httpMethod);
         }
 
-        $this->_fileName = ltrim($this->_fileName, '/');  //strip leading slash
-        $this->_path     = rtrim($this->_path, '/');      //strip trailing slash
+        if (substr($this->_path, -1, 1) == '/') {
+            $this->_fileName = ltrim($this->_fileName, '/');  //strip leading slash
+        }
 
         if ($this->_append) {
             if ($this->_fixFileName) {
                 $this->_fileName = PAGER_CURRENT_FILENAME; //avoid possible user \
error;  }
-            $this->_url = $this->_path.(!empty($this->_path) ? '/' : \
'').$this->_fileName; +            $this->_url = $this->_path.(empty($this->_path) ? \
'' : '/').$this->_fileName;  } else {
             $this->_url = $this->_path;
             if (0 != strncasecmp($this->_fileName, 'javascript', 10)) {
-                $this->_url .= (!empty($this->_path) ? '/' : '');
+                $this->_url .= (empty($this->_path) ? '' : '/');
             }
             if (false === strpos($this->_fileName, '%d')) {
                 trigger_error($this->errorMessage(ERROR_PAGER_INVALID_USAGE), \
E_USER_WARNING);  }
         }
+        if (substr($this->_url, 0, 2) == '//') {
+            $this->_url = substr($this->_url, 1);
+        }
         if (false === strpos($this->_altPage, '%d')) {
             //by default, append page number at the end
             $this->_altPage .= ' %d';
http://cvs.php.net/viewvc.cgi/pear/Pager/package.xml?r1=1.111&r2=1.112&diff_format=u
Index: pear/Pager/package.xml
diff -u pear/Pager/package.xml:1.111 pear/Pager/package.xml:1.112
--- pear/Pager/package.xml:1.111	Sun May 18 18:06:38 2008
+++ pear/Pager/package.xml	Sat May 31 12:44:55 2008
@@ -22,8 +22,8 @@
   <email>richard@phpguru.org</email>
   <active>no</active>
  </lead>
- <date>2008-05-18</date>
- <time>20:04:27</time>
+ <date>2008-05-31</date>
+ <time>14:44:27</time>
  <version>
   <release>2.4.7</release>
   <api>2.4.7</api>
@@ -36,6 +36,8 @@
  <notes>- fixed bug #13604: WARNINGS with PHP 5.3-dev [thanks to Chris Troup]
 - request #13567: support for regexp in 'excludeVars' [thanks to Stefano Coletta]
 - fixed bug #13913 empty prev/next image shown when only one page exists [cweiske]
+- fixed bug #13881: fix for relative links (introduced in v.2.4.5) may cause some
+  issues with absolute links
  </notes>
  <contents>
   <dir name="/">
@@ -99,11 +101,13 @@
     <release>stable</release>
     <api>stable</api>
    </stability>
-   <date>2008-05-18</date>
+   <date>2008-05-31</date>
    <license uri="http://www.debian.org/misc/bsd.license">BSD</license>
    <notes>- fixed bug #13604: WARNINGS with PHP 5.3-dev [thanks to Chris Troup]
 - request #13567: support for regexp in 'excludeVars' [thanks to Stefano Coletta]
 - fixed bug #13913 empty prev/next image shown when only one page exists [cweiske]
+- fixed bug #13881: fix for relative links (introduced in v.2.4.5) may cause some
+  issues with absolute links
    </notes>
   </release>
   <release>



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic