php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39838 split function correctly
Submitted: 2006-12-15 01:45 UTC Modified: 2006-12-17 14:15 UTC
From: lu at icst dot org dot tw Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.0 OS: Fedora Core 3 and 6
Private report: No CVE-ID: None
 [2006-12-15 01:45 UTC] lu at icst dot org dot tw
Description:
------------
Test on FC3, FC6 ( RedHat Fedora)
On FC3, PHP version is 4.3.11
On FC6, PHP version is 5.1.6

    $strary = split("[@#^!]", $password);  <== 
                                              if $password = aaaaa@ , $num =2 <= incorrectly on FC3 , FC6 (Fedora)
                                              if $password = @aaaaa , $num =2 <= incorrectly on FC3 , FC6 (Fedora)

                                              if $password = a@a@a , $num=3 <= correctly
                                              if $password = a@a ,   $num=2 <= correctly
    $num = count($strary);

    $s="";  // debug
    if (!(ctype_alnum($s))) echo "false<br>";  // debug
    echo "num = " . $num . "<BR>";  // debug  

    for ($ii = 0; $ii < $num; $ii++)
    {
       echo "strary[ii] = " . $strary[$ii] . "<BR>";  // debug
          if (!(ctype_alnum($strary[$ii])))
            {
              return "Password must contain?w@ # ^ !?x";//"a password should contain only alphanumeric characters and @ # ^ !";
            }
    }


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-15 02:02 UTC] judas dot iscariote at gmail dot com
hank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
 [2006-12-17 14:15 UTC] bjori@php.net
(see previous comment)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 06:01:27 2025 UTC