cvs: pear /Pager Common.php

From: Date: Tue, 07 Mar 2006 10:36:13 +0000
Subject: cvs: pear /Pager Common.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38962@lists.php.net to get a copy of this message
quipo Tue Mar 7 10:36:13 2006 UTC Modified files: /pear/Pager Common.php Log: - added 'fixFileName' boolean option (true by default). It allows overriding the safe-check on the file name. Use at your own risk. - cosmetic and phpdoc fixes http://cvs.php.net/viewcvs.cgi/pear/Pager/Common.php?r1=1.49&r2=1.50&diff_format=u Index: pear/Pager/Common.php diff -u pear/Pager/Common.php:1.49 pear/Pager/Common.php:1.50 --- pear/Pager/Common.php:1.49 Thu Mar 2 14:44:49 2006 +++ pear/Pager/Common.php Tue Mar 7 10:36:13 2006 @@ -33,7 +33,7 @@ * @author Richard Heyes <richard@phpguru.org> * @copyright 2003-2006 Lorenzo Alberton, Richard Heyes * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) - * @version CVS: $Id: Common.php,v 1.49 2006/03/02 14:44:49 quipo Exp $ + * @version CVS: $Id: Common.php,v 1.50 2006/03/07 10:36:13 quipo Exp $ * @link http://pear.php.net/package/Pager */ @@ -129,6 +129,12 @@ var $_fileName = CURRENT_FILENAME; /** + * @var boolean If false, don't override the fileName option. Use at your own risk. + * @access private + */ + var $_fixFileName = true; + + /** * @var boolean you have to use FALSE with mod_rewrite * @access private */ @@ -677,8 +683,7 @@ $altText, $linkText ); - } - if ($this->_httpMethod == 'POST') { + } elseif ($this->_httpMethod == 'POST') { return sprintf("<a href='javascript:void(0)' onClick='%s'%s%s title='%s'>%s</a>", $this->_generateFormOnClick($this->_url, $this->_linkData), empty($this->_classString) ? '' : ' '.$this->_classString, @@ -703,9 +708,9 @@ * and _generateFormOnClick('foo.php', $arr) * will yield * $_REQUEST['array'][0][0] === 'hello' - * $_REQUEST['array'][0][0] === 'world' + * $_REQUEST['array'][0][1] === 'world' * $_REQUEST['array']['things'][0] === 'stuff' - * $_REQUEST['array']['things'][0] === 'junk' + * $_REQUEST['array']['things'][1] === 'junk' * * However, instead of generating a query string, it generates * Javascript to create and submit a form. @@ -783,7 +788,6 @@ } $escapedData = htmlentities($escapedData, ENT_QUOTES, 'UTF-8'); - $str .= 'input = document.createElement("input"); '; $str .= 'input.type = "hidden"; '; $str .= sprintf('input.name = "%s"; ', $prev); @@ -1058,7 +1062,7 @@ * - 'optionText': text to show in each option. * Use '%d' where you want to see the number of pages selected. * - 'attributes': (html attributes) Tag attributes or - * HTML attributes id="foo" pairs, will be inserted in the + * HTML attributes (id="foo" pairs), will be inserted in the * <select> tag * @return string xhtml select box * @access public @@ -1313,6 +1317,7 @@ 'linkClass', 'path', 'fileName', + 'fixFileName', 'append', 'httpMethod', 'formID', @@ -1375,7 +1380,9 @@ $this->_path = rtrim($this->_path, '/'); //strip trailing slash if ($this->_append) { - $this->_fileName = CURRENT_FILENAME; //avoid possible user error; + if ($this->_fixFileName) { + $this->_fileName = CURRENT_FILENAME; //avoid possible user error; + } $this->_url = $this->_path.'/'.$this->_fileName; } else { $this->_url = $this->_path;

« previous php.pear.cvs (#38962) next »