Skip to content

Commit

Permalink
* Fixed #12736: regexps with unicode escape codes didn't work client…
Browse files Browse the repository at this point in the history
…-side

 * Fixed #15520: remove element name from _required array in removeElement()
 * Fixed #15955: clear selects in hierselect when no options are present

Also updated copyright years everywhere


git-svn-id: http://svn.php.net/repository/pear/packages/HTML_QuickForm/trunk@278257 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
sad-spirit committed Apr 4, 2009
1 parent 2f85a7b commit f0996e1
Show file tree
Hide file tree
Showing 43 changed files with 53 additions and 43 deletions.
3 changes: 2 additions & 1 deletion QuickForm.php
Expand Up @@ -17,7 +17,7 @@
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down Expand Up @@ -1030,6 +1030,7 @@ function &removeElement($elementName, $removeRules = true)
$this->_elementIndex[$elementName] = array_shift($this->_duplicateIndex[$elementName]);
}
if ($removeRules) {
$this->_required = array_diff($this->_required, array($elementName));
unset($this->_rules[$elementName], $this->_errors[$elementName]);
if ('group' == $el->getType()) {
foreach (array_keys($el->getElements()) as $key) {
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Renderer.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Renderer/Array.php
Expand Up @@ -18,7 +18,7 @@
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Thomas Schulz <ths@4bconsult.de>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Renderer/ArraySmarty.php
Expand Up @@ -18,7 +18,7 @@
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Thomas Schulz <ths@4bconsult.de>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Renderer/Default.php
Expand Up @@ -17,7 +17,7 @@
* @author Alexey Borzov <avb@php.net>
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Renderer/ITDynamic.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Renderer/ITStatic.php
Expand Up @@ -16,7 +16,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Renderer/Object.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Renderer/ObjectFlexy.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Renderer/QuickHtml.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Jason Rust <jrust@rustyparts.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Rule.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Rule/Callback.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Rule/Compare.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Rule/Email.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Rule/Range.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
8 changes: 7 additions & 1 deletion QuickForm/Rule/Regex.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down Expand Up @@ -94,6 +94,12 @@ function getValidationScript($options = null)
{
$regex = isset($this->_data[$this->name]) ? $this->_data[$this->name] : $options;

// bug #12376, converting unicode escapes and stripping 'u' modifier
if ($pos = strpos($regex, 'u', strrpos($regex, '/'))) {
$regex = substr($regex, 0, $pos) . substr($regex, $pos + 1);
$regex = preg_replace('/(?<!\\\\)(?>\\\\\\\\)*\\\\x{([a-fA-F0-9]+)}/', '\\u$1', $regex);
}

return array(" var regex = " . $regex . ";\n", "{jsVar} != '' && !regex.test({jsVar})");
} // end func getValidationScript

Expand Down
2 changes: 1 addition & 1 deletion QuickForm/Rule/Required.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/RuleRegistry.php
Expand Up @@ -17,7 +17,7 @@
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/advcheckbox.php
Expand Up @@ -16,7 +16,7 @@
* @package HTML_QuickForm
* @author Jason Rust <jrust@php.net>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/autocomplete.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Matteo Di Giovinazzo <matteodg@infinito.it>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/button.php
Expand Up @@ -16,7 +16,7 @@
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/checkbox.php
Expand Up @@ -17,7 +17,7 @@
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/date.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/element.php
Expand Up @@ -17,7 +17,7 @@
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/file.php
Expand Up @@ -17,7 +17,7 @@
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/group.php
Expand Up @@ -17,7 +17,7 @@
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/header.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/hidden.php
Expand Up @@ -16,7 +16,7 @@
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/hiddenselect.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Isaac Shepard <ishepard@bsiweb.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
5 changes: 4 additions & 1 deletion QuickForm/hierselect.php
Expand Up @@ -17,7 +17,7 @@
* @author Herim Vasquez <vasquezh@iro.umontreal.ca>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down Expand Up @@ -313,6 +313,9 @@ function toHtml()
$this->_js .= <<<JAVASCRIPT
function _hs_findOptions(ary, keys)
{
if (ary == undefined) {
return {};
}
var key = keys.shift();
if (!key in ary) {
return {};
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/html.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/image.php
Expand Up @@ -16,7 +16,7 @@
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/input.php
Expand Up @@ -16,7 +16,7 @@
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/link.php
Expand Up @@ -16,7 +16,7 @@
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/password.php
Expand Up @@ -16,7 +16,7 @@
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/radio.php
Expand Up @@ -16,7 +16,7 @@
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/reset.php
Expand Up @@ -16,7 +16,7 @@
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/select.php
Expand Up @@ -17,7 +17,7 @@
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/static.php
Expand Up @@ -15,7 +15,7 @@
* @category HTML
* @package HTML_QuickForm
* @author Wojciech Gdela <eltehaem@poczta.onet.pl>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/submit.php
Expand Up @@ -16,7 +16,7 @@
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down
2 changes: 1 addition & 1 deletion QuickForm/text.php
Expand Up @@ -16,7 +16,7 @@
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2007 The PHP Group
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/HTML_QuickForm
Expand Down

0 comments on commit f0996e1

Please sign in to comment.