<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=Validate</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/29034" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19630" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19132" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17975" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17043" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16897" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13825" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/29034">
      <title>Validate: Bug 29034 [Open] Non-static method Validate::_modf() cannot be called statically</title>
      <link>http://pear.php.net/bugs/29034</link>
      <content:encoded><![CDATA[<pre>Validate Bug
Reported by neufeind
2025-04-18T17:35:00+00:00
PHP: 8.0.0 (Specify exact version in description) OS:  Package Version: 0.8.6

Description:
------------
PHP 8.4.x (although that doesn't really matter; code is unclean)

Inside Validate.php there is a static call to _modf(). That function needs to be declared &quot;static&quot;.

error says:
called statically in /usr/share/pear/Validate.php:1004 Stack trace: #0 /usr/share/pear/Validate.php(1033)</pre>]]></content:encoded>
      <description><![CDATA[<pre>Validate Bug
Reported by neufeind
2025-04-18T17:35:00+00:00
PHP: 8.0.0 (Specify exact version in description) OS:  Package Version: 0.8.6

Description:
------------
PHP 8.4.x (although that doesn't really matter; code is unclean)

Inside Validate.php there is a static call to _modf(). That function needs to be declared &quot;static&quot;.

error says:
called statically in /usr/share/pear/Validate.php:1004 Stack trace: #0 /usr/share/pear/Validate.php(1033)</pre>]]></description>
      <dc:date>2025-04-18T17:35:00+00:00</dc:date>
      <dc:creator>pear &amp;#x64;&amp;#111;&amp;#x74; neufeind &amp;#x61;&amp;#116; speedpartner &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>Validate Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19630">
      <title>Validate: Bug 19630 [Open] Validate::string returns true for &quot;max_length&quot;=&gt;0 when it shouldn't.</title>
      <link>http://pear.php.net/bugs/19630</link>
      <content:encoded><![CDATA[<pre>Validate Bug
Reported by helen_griffiths
2012-10-03T17:58:46+00:00
PHP: 5.4.6 OS: Linux Fedora 3.5.3-1.fc17.x86_64 Package Version: 0.8.5

Description:
------------
Validate::string used with max_length=&gt;0 in the options array ought to return false when a string is longer than 0 characters, but actually returns true.

Test script:
---------------
$tucaspn = &quot;0001234567&quot; ;
$tsha1 = &quot;8216f35ab34f4e3910fd384565636f57dd7f50a2&quot; ;
$tpepper = &quot;kittens0ft&quot; ;
$tchars = VALIDATE_NUM ;
$tmin = 0 ;
$tmax = 0 ;

function ucasPnCheckerF($ucaspn,$pepper,$sha1,$min,$max,$chars) {  // returns true or false
  return (Validate::string($ucaspn, array(&quot;min_length&quot;=&gt;$min, &quot;max_length&quot;=&gt;$max, &quot;format&quot;=&gt;$chars)) &amp;&amp; sha1PepperChecker($ucaspn, $pepper, $sha1)) ;
}
if (ucasPnCheckerF($tucaspn,$tpepper,$tsha1,$tmin,$tmax,$tchars)) {
  echo &quot;This should have failed but didn't.&lt;br /&gt;&quot; ;
} else echo &quot;I'll eat my hat.&quot; ;
function ucasPnCheckerT($ucaspn,$pepper,$sha1,$min,$max,$chars) {  // returns true or false
  return ((0 &lt; $max) &amp;&amp; Validate::string($ucaspn, array(&quot;min_length&quot;=&gt;$min, &quot;max_length&quot;=&gt;$max, &quot;format&quot;=&gt;$chars)) &amp;&amp; sha1PepperChecker($ucaspn, $pepper, $sha1)) ;
}
if (ucasPnCheckerT($tucaspn,$tpepper,$tsha1,$tmin,$tmax,$tchars)) {
  echo &quot;This should have failed.&lt;br /&gt;&quot; ;
} else echo &quot;Workaround for bug.&quot; ;

Expected result:
----------------
I'll eat my hat.
Workaround for bug.

Actual result:
--------------
This should have failed but didn't.
Workaround for bug.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Validate Bug
Reported by helen_griffiths
2012-10-03T17:58:46+00:00
PHP: 5.4.6 OS: Linux Fedora 3.5.3-1.fc17.x86_64 Package Version: 0.8.5

Description:
------------
Validate::string used with max_length=&gt;0 in the options array ought to return false when a string is longer than 0 characters, but actually returns true.

Test script:
---------------
$tucaspn = &quot;0001234567&quot; ;
$tsha1 = &quot;8216f35ab34f4e3910fd384565636f57dd7f50a2&quot; ;
$tpepper = &quot;kittens0ft&quot; ;
$tchars = VALIDATE_NUM ;
$tmin = 0 ;
$tmax = 0 ;

function ucasPnCheckerF($ucaspn,$pepper,$sha1,$min,$max,$chars) {  // returns true or false
  return (Validate::string($ucaspn, array(&quot;min_length&quot;=&gt;$min, &quot;max_length&quot;=&gt;$max, &quot;format&quot;=&gt;$chars)) &amp;&amp; sha1PepperChecker($ucaspn, $pepper, $sha1)) ;
}
if (ucasPnCheckerF($tucaspn,$tpepper,$tsha1,$tmin,$tmax,$tchars)) {
  echo &quot;This should have failed but didn't.&lt;br /&gt;&quot; ;
} else echo &quot;I'll eat my hat.&quot; ;
function ucasPnCheckerT($ucaspn,$pepper,$sha1,$min,$max,$chars) {  // returns true or false
  return ((0 &lt; $max) &amp;&amp; Validate::string($ucaspn, array(&quot;min_length&quot;=&gt;$min, &quot;max_length&quot;=&gt;$max, &quot;format&quot;=&gt;$chars)) &amp;&amp; sha1PepperChecker($ucaspn, $pepper, $sha1)) ;
}
if (ucasPnCheckerT($tucaspn,$tpepper,$tsha1,$tmin,$tmax,$tchars)) {
  echo &quot;This should have failed.&lt;br /&gt;&quot; ;
} else echo &quot;Workaround for bug.&quot; ;

Expected result:
----------------
I'll eat my hat.
Workaround for bug.

Actual result:
--------------
This should have failed but didn't.
Workaround for bug.</pre>]]></description>
      <dc:date>2012-10-03T18:32:44+00:00</dc:date>
      <dc:creator>helen &amp;#x61;&amp;#116; helengriffiths &amp;#x64;&amp;#111;&amp;#x74; me &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>Validate Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19132">
      <title>Validate: Bug 19132 [Open] VALIDATE_EALPHA_UPPER/LOWER Turkish accents are wrong</title>
      <link>http://pear.php.net/bugs/19132</link>
      <content:encoded><![CDATA[<pre>Validate Bug
Reported by tkorkunckaya
2011-12-13T05:08:09+00:00
PHP: 5.3.6 OS: Debian GNU/Linux Package Version: 0.8.4

Description:
------------
define('VALIDATE_EALPHA_LOWER', VALIDATE_ALPHA_LOWER . 
'Ã¡Ã©Ã­Ã³ÃºÃ½Ã Ã¨Ã¬Ã²Ã¹Ã¤Ã«Ã¯Ã¶Ã¼Ã¿Ã¢ÃªÃ®Ã´Ã»Ã£Ã±ÃµÂ¨Ã¥Ã¦Ã§Â½Ã°Ã¸Ã¾Ã');
define('VALIDATE_EALPHA_UPPER', VALIDATE_ALPHA_UPPER . 
'ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ¾ÃÃÃÃÃÃÃÃÂ¦ÃÃÃÂ¼ÃÃÃ');

accented Turkish chars (???,???) are wrong: (Ã,?,Ã,Ã°,?,Ã¾)

Test script:
---------------
if (Validate::string(&quot;A?RI ?EHR?&quot;, array(
    'format' =&gt; VALIDATE_SPACE . VALIDATE_EALPHA_UPPER))) {
    echo 'Valid!';
} else {
    echo 'Invalid!';
}

returns Invalid!

Expected result:
----------------
must return Valid!

Actual result:
--------------
define('VALIDATE_EALPHA_LOWER', VALIDATE_ALPHA_LOWER . 
'Ã¡Ã©Ã­Ã³ÃºÃ½Ã Ã¨Ã¬Ã²Ã¹Ã¤Ã«Ã¯Ã¶Ã¼Ã¿Ã¢ÃªÃ®Ã´Ã»Ã£Ã±ÃµÂ¨Ã¥Ã¦Ã§Â½Ã¸Ã???');
define('VALIDATE_EALPHA_UPPER', VALIDATE_ALPHA_UPPER . 
'ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ¾ÃÃÃÃÃÃÃÃÂ¦ÃÃÃÂ¼Ã???');

if you define VALIDATE_EALPHA_UPPER as stated above it 
validates correctly.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Validate Bug
Reported by tkorkunckaya
2011-12-13T05:08:09+00:00
PHP: 5.3.6 OS: Debian GNU/Linux Package Version: 0.8.4

Description:
------------
define('VALIDATE_EALPHA_LOWER', VALIDATE_ALPHA_LOWER . 
'Ã¡Ã©Ã­Ã³ÃºÃ½Ã Ã¨Ã¬Ã²Ã¹Ã¤Ã«Ã¯Ã¶Ã¼Ã¿Ã¢ÃªÃ®Ã´Ã»Ã£Ã±ÃµÂ¨Ã¥Ã¦Ã§Â½Ã°Ã¸Ã¾Ã');
define('VALIDATE_EALPHA_UPPER', VALIDATE_ALPHA_UPPER . 
'ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ¾ÃÃÃÃÃÃÃÃÂ¦ÃÃÃÂ¼ÃÃÃ');

accented Turkish chars (???,???) are wrong: (Ã,?,Ã,Ã°,?,Ã¾)

Test script:
---------------
if (Validate::string(&quot;A?RI ?EHR?&quot;, array(
    'format' =&gt; VALIDATE_SPACE . VALIDATE_EALPHA_UPPER))) {
    echo 'Valid!';
} else {
    echo 'Invalid!';
}

returns Invalid!

Expected result:
----------------
must return Valid!

Actual result:
--------------
define('VALIDATE_EALPHA_LOWER', VALIDATE_ALPHA_LOWER . 
'Ã¡Ã©Ã­Ã³ÃºÃ½Ã Ã¨Ã¬Ã²Ã¹Ã¤Ã«Ã¯Ã¶Ã¼Ã¿Ã¢ÃªÃ®Ã´Ã»Ã£Ã±ÃµÂ¨Ã¥Ã¦Ã§Â½Ã¸Ã???');
define('VALIDATE_EALPHA_UPPER', VALIDATE_ALPHA_UPPER . 
'ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ¾ÃÃÃÃÃÃÃÃÂ¦ÃÃÃÂ¼Ã???');

if you define VALIDATE_EALPHA_UPPER as stated above it 
validates correctly.</pre>]]></description>
      <dc:date>2011-12-13T17:08:05+00:00</dc:date>
      <dc:creator>tolga &amp;#x61;&amp;#116; profelis &amp;#x64;&amp;#111;&amp;#x74; com &amp;#x64;&amp;#111;&amp;#x74; tr</dc:creator>
      <dc:subject>Validate Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17975">
      <title>Validate: Bug 17975 [Open] Validate E_STRICT incompatibility</title>
      <link>http://pear.php.net/bugs/17975</link>
      <content:encoded><![CDATA[<pre>Validate Bug
Reported by jdolecek
2010-10-19T19:04:25+00:00
PHP: 5.3.3 OS: MacOS Package Version: 0.8.4

Description:
------------
Package is not compatible with running under E_STRICT - 
methods are not marked as static, so one gets warning when 
calling e.g. Validate::uri() from other code (such as 
Services_Facebook).

It would be cool to mark all functions as static and private/public 
as appropriate, to make it possible to run Validate with 
E_STRICT.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Validate Bug
Reported by jdolecek
2010-10-19T19:04:25+00:00
PHP: 5.3.3 OS: MacOS Package Version: 0.8.4

Description:
------------
Package is not compatible with running under E_STRICT - 
methods are not marked as static, so one gets warning when 
calling e.g. Validate::uri() from other code (such as 
Services_Facebook).

It would be cool to mark all functions as static and private/public 
as appropriate, to make it possible to run Validate with 
E_STRICT.</pre>]]></description>
      <dc:date>2010-10-20T16:31:57+00:00</dc:date>
      <dc:creator>jaromir &amp;#x64;&amp;#111;&amp;#x74; dolecek &amp;#x61;&amp;#116; skype &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Validate Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17043">
      <title>Validate: Bug 17043 [Open] openbase_dir and new includePathFileExists method causes warings</title>
      <link>http://pear.php.net/bugs/17043</link>
      <content:encoded><![CDATA[<pre>Validate Bug
Reported by alan_k
2010-01-29T09:31:31+00:00
PHP: Irrelevant OS: Linux Package Version: 0.8.3

Description:
------------
I could not think of a better way to hide the warnings, but this fixes the code in there.

function _includePathFileExists($filename)
    {
        $paths = explode(&quot;:&quot;, ini_get(&quot;include_path&quot;));
        $bd = explode(&quot;:&quot;, ini_get('open_basedir')); 
	$result = false;
	foreach($paths as $val) {
            // silenced due to open_basedir	
            $result = @file_exists($val . &quot;/&quot; . $filename);
	    if ($result) { 
		return true;
	   }
        }
        return false; 
    }
}</pre>]]></content:encoded>
      <description><![CDATA[<pre>Validate Bug
Reported by alan_k
2010-01-29T09:31:31+00:00
PHP: Irrelevant OS: Linux Package Version: 0.8.3

Description:
------------
I could not think of a better way to hide the warnings, but this fixes the code in there.

function _includePathFileExists($filename)
    {
        $paths = explode(&quot;:&quot;, ini_get(&quot;include_path&quot;));
        $bd = explode(&quot;:&quot;, ini_get('open_basedir')); 
	$result = false;
	foreach($paths as $val) {
            // silenced due to open_basedir	
            $result = @file_exists($val . &quot;/&quot; . $filename);
	    if ($result) { 
		return true;
	   }
        }
        return false; 
    }
}</pre>]]></description>
      <dc:date>2010-01-29T09:31:59+00:00</dc:date>
      <dc:creator>alan &amp;#x61;&amp;#116; akbkhome &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Validate Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16897">
      <title>Validate: Bug 16897 [Open] Validate fractional numbers less than 1</title>
      <link>http://pear.php.net/bugs/16897</link>
      <content:encoded><![CDATA[<pre>Validate Bug
Reported by davidsimpson
2009-12-10T16:28:08+00:00
PHP: 5.2.5 OS: Windows and Solaris Package Version: 0.8.3

Description:
------------
Validation of decimal numbers such as &quot;.5&quot; fails, although &quot;0.5&quot; 
passes.  As db engines (in our case Oracle) do not store the 
leading zero, we get validation failures using DB_DataObject in 
combination with Validate.

Test script:
---------------
 $testval='-.5';
 $test = Validate::number( $testval, array('decimal'=&gt;'.'));
 var_dump($test);


Replacing line 270 of Validate.php with the following two lines gives the expected result:

$num_regex = $dec_regex == '' ? &quot;|^[-+]?\s*[0-9]+\$|&quot; : &quot;/^[-+]?\s*(([0-9]+)([$decimal][0-9]+)?)|([$decimal][0-9]+)\$/&quot;;
if (!preg_match($num_regex, $number)) {


Expected result:
----------------
bool(true)

Actual result:
--------------
bool(false)</pre>]]></content:encoded>
      <description><![CDATA[<pre>Validate Bug
Reported by davidsimpson
2009-12-10T16:28:08+00:00
PHP: 5.2.5 OS: Windows and Solaris Package Version: 0.8.3

Description:
------------
Validation of decimal numbers such as &quot;.5&quot; fails, although &quot;0.5&quot; 
passes.  As db engines (in our case Oracle) do not store the 
leading zero, we get validation failures using DB_DataObject in 
combination with Validate.

Test script:
---------------
 $testval='-.5';
 $test = Validate::number( $testval, array('decimal'=&gt;'.'));
 var_dump($test);


Replacing line 270 of Validate.php with the following two lines gives the expected result:

$num_regex = $dec_regex == '' ? &quot;|^[-+]?\s*[0-9]+\$|&quot; : &quot;/^[-+]?\s*(([0-9]+)([$decimal][0-9]+)?)|([$decimal][0-9]+)\$/&quot;;
if (!preg_match($num_regex, $number)) {


Expected result:
----------------
bool(true)

Actual result:
--------------
bool(false)</pre>]]></description>
      <dc:date>2009-12-10T16:28:08+00:00</dc:date>
      <dc:creator>david &amp;#x64;&amp;#111;&amp;#x74; simpson &amp;#x61;&amp;#116; tronsystems &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>Validate Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13825">
      <title>Validate: Bug 13825 [Assigned] Email validation not working for '&amp;'</title>
      <link>http://pear.php.net/bugs/13825</link>
      <content:encoded><![CDATA[<pre>Validate Bug
Reported by ctj951
2008-05-02T21:00:52+00:00
PHP: 5.2.5 OS: Mac OS X Package Version: 0.8.1

Description:
------------
The email validation in the Validate PEAR package doesn't work correctly.  This is because the '&amp;' symbol though valid in emails such as: &quot;Joe &amp; Mac&quot;@example.com isn't accepted by the email parser.  This is caused by the simple fact that the __stringToUtf7() routine doesn't recognize any string with a '&amp;' sign as valid UTF7.  This is despite the fact that the '&amp;' character is valid UTF7 as defined by RFC 2152 as I read it:
http://www.faqs.org/rfcs/rfc2152.html

In the __stringToUtf7() routine the following substitution is made for the '&amp;' character:

elseif ($char == '&amp;') 
{
   $return .= '&amp;-';
}

Thus when the UTF7 &quot;return&quot; string is returned it doesn't match the original string passed to the UTF7 routine and all '&amp;' characters are replaced by '&amp;-'.  Its not clear why this substitution is made at all.  Especially since this routine is only used from within the email parser.  In any case the result is that the following test in __emailRFC822() fails with emails like &quot;Joe &amp; Mac&quot;@example.com:

if (Validate::__stringToUtf7($email) != $email) {
  return false;
}

Leading to the email parser returning that emails like &quot;Joe &amp; Mac&quot;@example.com are invalid email addresses when in fact they are valid. 

Test script:
---------------
Script 1: (fails when should succeed)
$Email = '&quot;Joe &amp; Mac&quot;@example.com';
$Options = 0;
assert( Validate::__emailRFC822( $Email, $Options ) );

Script 2: (fails when should succeed)
$string = '&amp;';
assert( __stringToUtf7($string) == $string );

Expected result:
----------------
Scripts fail when they should succeed

Actual result:
--------------
Scripts faile.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Validate Bug
Reported by ctj951
2008-05-02T21:00:52+00:00
PHP: 5.2.5 OS: Mac OS X Package Version: 0.8.1

Description:
------------
The email validation in the Validate PEAR package doesn't work correctly.  This is because the '&amp;' symbol though valid in emails such as: &quot;Joe &amp; Mac&quot;@example.com isn't accepted by the email parser.  This is caused by the simple fact that the __stringToUtf7() routine doesn't recognize any string with a '&amp;' sign as valid UTF7.  This is despite the fact that the '&amp;' character is valid UTF7 as defined by RFC 2152 as I read it:
http://www.faqs.org/rfcs/rfc2152.html

In the __stringToUtf7() routine the following substitution is made for the '&amp;' character:

elseif ($char == '&amp;') 
{
   $return .= '&amp;-';
}

Thus when the UTF7 &quot;return&quot; string is returned it doesn't match the original string passed to the UTF7 routine and all '&amp;' characters are replaced by '&amp;-'.  Its not clear why this substitution is made at all.  Especially since this routine is only used from within the email parser.  In any case the result is that the following test in __emailRFC822() fails with emails like &quot;Joe &amp; Mac&quot;@example.com:

if (Validate::__stringToUtf7($email) != $email) {
  return false;
}

Leading to the email parser returning that emails like &quot;Joe &amp; Mac&quot;@example.com are invalid email addresses when in fact they are valid. 

Test script:
---------------
Script 1: (fails when should succeed)
$Email = '&quot;Joe &amp; Mac&quot;@example.com';
$Options = 0;
assert( Validate::__emailRFC822( $Email, $Options ) );

Script 2: (fails when should succeed)
$string = '&amp;';
assert( __stringToUtf7($string) == $string );

Expected result:
----------------
Scripts fail when they should succeed

Actual result:
--------------
Scripts faile.</pre>]]></description>
      <dc:date>2008-06-21T06:05:07+00:00</dc:date>
      <dc:creator>chadsspameateremail &amp;#x61;&amp;#116; yahoo &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Validate Bug</dc:subject>
    </item>
</rdf:RDF>
