I tried this snippet on both PC ....weirdest things happen.

See attached files

In short:
LPC -> Local PC -> slack (5.2.1)
RPC -> Remote PC -> debian (5.1.6-0.dotdeb.2)


on LPC I get warning + returned  false on test.
on RPC I get no warning + returned  true on test.

On both I get

"PCRE is not compiled with UTF-8 and Unicode support"


See attached files for output + script used.


Andries Seutens wrote:
>
> Joshua (and others that are facing the same problem),
>
> Please try running the following code on the machine where the AlNum
> filter is failing:
>
> <?php
> if (!preg_match('/\pL/u', 'a')) die('PCRE is not compiled with UTF-8
> and Unicode support');
>
> You'll probably see "PCRE is not compiled with UTF-8 and Unicode
> support" ... ? Let me/us know if this isn't the case, because that
> would be really weird.
>
> Best,
>
>
>
> Andries Seutens
> http://andries.systray.be
>
>> We are also having problems using Zend_Validate_Alpha and
>> Zend_Validate_Alnum but only on our production RHEL5 server.  Using
>> xampp locally on windows XP the same code works perfectly.  Prior to
>> 1.0RC3 this worked on production as well.  We are running ZF 1.0RC3. 
>> Here is the test code(similar to original post):
>>
>> $validator = new Zend_Validate_Alnum();
>>
>> $vars = array('Alnum' => 'foobar1',
>>               'notAlnum' => '[EMAIL PROTECTED]');
>> foreach ($vars as $var) {
>>         echo $validator->isValid($var) ? $var.":true\n":$var.":false\n";
>> }
>>
>> RHEL5 response:
>> foobar1:false
>> [EMAIL PROTECTED]:false
>>
>> WindowsXP response:
>> foobar1:true
>> [EMAIL PROTECTED]:false
>>
>>
>> RHEL 5 System details:
>> ******************************************************
>> PHP 5.1.6 (cli) (built: Apr  4 2007 11:38:24)
>> Copyright (c) 1997-2006 The PHP Group
>> Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
>>     with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by
>> Zend Technologies
>>     with Zend Optimizer v3.2.6, Copyright (c) 1998-2007, by Zend
>> Technologies
>>
>> yum info:
>> *******
>> PCRE
>> ---------------------------------------------------------------
>> pcre.x86_64                              6.6-1.1               
>> installed
>>
>> PHP
>> ---------------------------------------------------------------
>> php.x86_64                               5.1.6-11.el5          
>> installed
>> php-bcmath.x86_64                        5.1.6-11.el5          
>> installed
>> php-cli.x86_64                           5.1.6-11.el5          
>> installed
>> php-common.x86_64                        5.1.6-11.el5          
>> installed
>> php-dba.x86_64                           5.1.6-11.el5          
>> installed
>> php-devel.x86_64                         5.1.6-11.el5          
>> installed
>> php-gd.x86_64                            5.1.6-11.el5          
>> installed
>> php-imap.x86_64                          5.1.6-11.el5          
>> installed
>> php-ldap.x86_64                          5.1.6-11.el5          
>> installed
>> php-mbstring.x86_64                      5.1.6-11.el5          
>> installed
>> php-mysql.x86_64                         5.1.6-11.el5          
>> installed
>> php-ncurses.x86_64                       5.1.6-11.el5          
>> installed
>> php-odbc.x86_64                          5.1.6-11.el5          
>> installed
>> php-pdo.x86_64                           5.1.6-11.el5          
>> installed
>> php-pear.noarch                          1:1.4.9-4             
>> installed
>> php-pgsql.x86_64                         5.1.6-11.el5          
>> installed
>> php-snmp.x86_64                          5.1.6-11.el5          
>> installed
>> php-soap.x86_64                          5.1.6-11.el5          
>> installed
>> php-xml.x86_64                           5.1.6-11.el5          
>> installed
>> php-xmlrpc.x86_64                        5.1.6-11.el5          
>> installed
>>
>>
>>
>> WindowsXP System details:
>> **************************************************
>> PHP 5.2.1 (cli) (built: Feb  7 2007 23:11:26)
>> Copyright (c) 1997-2007 The PHP Group
>> Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
>>     with Zend Extension Manager v1.0.11, Copyright (c) 2003-2006, by
>> Zend Technologies
>>     with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend
>> Technologies
>>
>> PCRE:
>> *************************************************
>> PCRE Library Version => 6.7 04-Jul-2006
>>
>>
>> Josh
>>
>> "Darby Felton" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>>  
>>> Hi Graham,
>>>
>>> I just added the potentially offending data to the unit tests for
>>> Zend_Validate_Alnum, but I have been unable to reproduce the problem on
>>> either of the two following platforms:
>>>
>>> * PHP 5.1.4, WinXP, PCRE 6.6
>>>
>>> * PHP 5.2.1, Ubuntu, PCRE 6.7
>>>
>>> Are you on FreeBSD by chance?
>>>
>>> Anyone else experiencing such a problem?
>>>
>>> On another note, I would highly recommend upgrading your PHP beyond
>>> 5.2.0, which introduced some problems that have since been addressed in
>>> later releases.
>>>
>>> Best regards,
>>> Darby
>>>
>>> Graham Anderson wrote:
>>>    
>>>> I updated against trunk and now...
>>>>
>>>> require_once('Zend/Validate/Alnum.php');
>>>>
>>>> $validator = new Zend_Validate_Alnum();
>>>>
>>>> $vars = array ( 'Alnum' => 'foobar1',
>>>> 'NotAlnum' => '[EMAIL PROTECTED]' );
>>>>
>>>> foreach ( $vars as $var ) {
>>>> echo $validator->isValid($var) ? $var .':true ' : $var . ':false ';
>>>> }
>>>>
>>>> -- 
>>>> result: foobar1:false [EMAIL PROTECTED]:false
>>>> -- 
>>>>
>>>> php5 -v
>>>> PHP 5.2.0 with Suhosin-Patch 0.9.6.1 (cli) (built: May  8 2007
>>>> 20:00:45)
>>>> Copyright (c) 1997-2006 The PHP Group
>>>> Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
>>>>     with Suhosin v0.9.10, (C) Copyright 2006, by Hardened-PHP Project
>>>>
>>>>       
>>
>>
>>
>>
>>   
>
>
> ------------------------------------------------------------------------
>
> Gecontroleerd op virussen door de JOJO Secure Gateway.
>   

HP Version: 5.1.6-0.dotdeb.2
PHP OS: Linux
Error Reporting: 2047 (E_ALL)
Register Globals: Off
Short Tags: On
Display Errors: On
Magic Quotes GPC: On
Magic Quotes Runtime: Off
Magic Quotes Sybase: Off
Loaded Extensions:
   libxml           xsl              xmlwriter        xmlrpc        
   dom              xmlreader        xml              wddx          
   tokenizer        sysvshm          sysvsem          sysvmsg       
   standard         SimpleXML        SPL              session       
   sockets          soap             PDO              shmop         
   SQLite           Reflection       posix            mime_magic    
   mbstring         iconv            hash             gettext       
   ftp              filepro          exif             dbase         
   dba              date             ctype            calendar      
   bz2              bcmath           zlib             pcre          
   openssl          apache2handler   imagick          gd            
   mysqli           pdo_mysql        mysql            Zend Optimizer

Is Alnum: asdf1234   -> true
Is Alnum: asdf   -> true
PCRE is not compiled with UTF-8 and Unicode support

============================================================================================================================================


error_reporting(E_ALL);

$neg = array('off', 0, false, '', null);
$flags = array(
        'Register Globals' => 'register_globals',
        'Short Tags' => 'short_open_tag',
        'Display Errors' => 'display_errors',
        'Magic Quotes GPC' => 'magic_quotes_gpc',
        'Magic Quotes Runtime' => 'magic_quotes_runtime',
        'Magic Quotes Sybase' => 'magic_quotes_sybase',
);
$ve = phpversion();
$os = PHP_OS;
$er = intval(error_reporting());
foreach ($flags as $n => $v)
{
        $flags[$n] = (in_array(strtolower(ini_get($v)), $neg) ? 'Off' : 'On');
}
$cli = (php_sapi_name() == 'cli');
$eol = "\n";

$gle = get_loaded_extensions();
$rows = array();
$le = '';
$wide = 4;
$j = count($gle);
$pad = $wide - $j % $wide;
$len = max(array_map('strlen', $gle));
$func = create_function('$a', 'return str_pad($a, ' . intval($len) . ');');
$gle = array_map($func, $gle);
for($i = 0; $i < $j; $i += $wide)
{
        $le .= '   ' . implode('   ', array_slice($gle, $i, $wide)) . $eol;
}

$ec = array(
        'E_STRICT' => 2048, 'E_ALL' => 2047, 'E_USER_NOTICE' => 1024,
        'E_USER_WARNING' => 512, 'E_USER_ERROR' => 256, 'E_COMPILE_WARNING' => 
128,
        'E_COMPILE_ERROR' => 64, 'E_CORE_WARNING' => 32, 'E_CORE_ERROR' => 16,
        'E_NOTICE' => 8, 'E_PARSE' => 4, 'E_WARNING' => 2, 'E_ERROR' => 1,
);

$e = array();
$t = $er;
foreach ($ec as $n => $v)
{
        if (($t & $v) == $v)
        {
                $e[] = $n;
                $t ^= $v;
        }
}
if (ceil(count($ec) / 2) + 1 < count($e))
{
        $e2 = array();
        foreach ($ec as $n => $v)
        {
                if (!in_array($n, $e) and $n != 'E_ALL')
                {
                        $e2[] = $n;
                }
        }
        $er = $er . ' ((E_ALL | E_STRICT) ^ ' . implode(' ^ ', $e2) . '))';
}
else
{
        $er = $er . ' (' . implode(' | ', $e) . ')';
}

if (!$cli)
{
        echo '

', $eol;
}

echo 'PHP Version: ', $ve, $eol;
echo 'PHP OS: ', $os, $eol;
echo 'Error Reporting: ', $er, $eol;
foreach ($flags as $n => $v)
{
        echo $n, ': ', $v, $eol;
}
echo 'Loaded Extensions:', $eol, $le, $eol;




set_include_path('.' . PATH_SEPARATOR . "../library/zf");
require_once("Zend/Loader.php");
Zend_Loader::loadClass('Zend_Validate_Alnum');


$f = new Zend_Validate_Alnum();
echo "Is Alnum: asdf1234   -> " . var_export($f->isValid('asdf1234'),1);
echo $eol;
echo "Is Alnum: asdf   -> " . var_export($f->isValid('asdf'),1);
echo $eol;


if (!preg_match('/\pL/u', 'a')) echo ('PCRE is not compiled with UTF-8 and 
Unicode support');
echo $eol;


PHP Version: 5.2.1
PHP OS: Linux Slackware
Error Reporting: 6143 (E_ALL)
Register Globals: Off
Short Tags: Off
Display Errors: On
Magic Quotes GPC: Off
Magic Quotes Runtime: Off
Magic Quotes Sybase: Off
Loaded Extensions:
   libxml       xsl          xmlwriter    dom       
   xmlreader    xml          wddx         tokenizer 
   sysvshm      sysvsem      session      pcre      
   SimpleXML    sockets      soap         SPL       
   shmop        standard     Reflection   posix     
   mhash        mbstring     ldap         json      
   imap         iconv        hash         gmp       
   gd           ftp          filter       exif      
   dbase        dba          date         curl      
   ctype        calendar     bz2          bcmath    
   zlib         openssl      apache       mysql     
   gettext      mysqli       PDO          pdo_mysql 
   pdo_sqlite   SQLite       xmlrpc       xdebug    

Is Alnum: asdf1234   -> false
Is Alnum: asdf   -> false


( ! ) Warning: preg_match() [function.preg-match]: Compilation failed: support 
for \P, \p, and \X has not been compiled at offset 1 in 
/storage/www/vision22/php/surveyor.vision22.net/web/test.php on line 101
Call Stack
#       Time    Memory  Function        Location
1       0.0010  79800   {main}( )       ../test.php:0
2       0.0064  204712  preg_match ( )  ../test.php:101

PCRE is not compiled with UTF-8 and Unicode support


============================================================================================================================================

error_reporting(E_ALL);

$neg = array('off', 0, false, '', null);
$flags = array(
        'Register Globals' => 'register_globals',
        'Short Tags' => 'short_open_tag',
        'Display Errors' => 'display_errors',
        'Magic Quotes GPC' => 'magic_quotes_gpc',
        'Magic Quotes Runtime' => 'magic_quotes_runtime',
        'Magic Quotes Sybase' => 'magic_quotes_sybase',
);
$ve = phpversion();
$os = PHP_OS;
$er = intval(error_reporting());
foreach ($flags as $n => $v)
{
        $flags[$n] = (in_array(strtolower(ini_get($v)), $neg) ? 'Off' : 'On');
}
$cli = (php_sapi_name() == 'cli');
$eol = "\n";

$gle = get_loaded_extensions();
$rows = array();
$le = '';
$wide = 4;
$j = count($gle);
$pad = $wide - $j % $wide;
$len = max(array_map('strlen', $gle));
$func = create_function('$a', 'return str_pad($a, ' . intval($len) . ');');
$gle = array_map($func, $gle);
for($i = 0; $i < $j; $i += $wide)
{
        $le .= '   ' . implode('   ', array_slice($gle, $i, $wide)) . $eol;
}

$ec = array(
        'E_STRICT' => 2048, 'E_ALL' => 2047, 'E_USER_NOTICE' => 1024,
        'E_USER_WARNING' => 512, 'E_USER_ERROR' => 256, 'E_COMPILE_WARNING' => 
128,
        'E_COMPILE_ERROR' => 64, 'E_CORE_WARNING' => 32, 'E_CORE_ERROR' => 16,
        'E_NOTICE' => 8, 'E_PARSE' => 4, 'E_WARNING' => 2, 'E_ERROR' => 1,
);

$e = array();
$t = $er;
foreach ($ec as $n => $v)
{
        if (($t & $v) == $v)
        {
                $e[] = $n;
                $t ^= $v;
        }
}
if (ceil(count($ec) / 2) + 1 < count($e))
{
        $e2 = array();
        foreach ($ec as $n => $v)
        {
                if (!in_array($n, $e) and $n != 'E_ALL')
                {
                        $e2[] = $n;
                }
        }
        $er = $er . ' ((E_ALL | E_STRICT) ^ ' . implode(' ^ ', $e2) . '))';
}
else
{
        $er = $er . ' (' . implode(' | ', $e) . ')';
}

if (!$cli)
{
        echo '

', $eol;
}

echo 'PHP Version: ', $ve, $eol;
echo 'PHP OS: ', $os, $eol;
echo 'Error Reporting: ', $er, $eol;
foreach ($flags as $n => $v)
{
        echo $n, ': ', $v, $eol;
}
echo 'Loaded Extensions:', $eol, $le, $eol;




set_include_path('.' . PATH_SEPARATOR . "../library/zf");
require_once("Zend/Loader.php");
Zend_Loader::loadClass('Zend_Validate_Alnum');


$f = new Zend_Validate_Alnum();
echo "Is Alnum: asdf1234   -> " . var_export($f->isValid('asdf1234'),1);
echo $eol;
echo "Is Alnum: asdf   -> " . var_export($f->isValid('asdf'),1);
echo $eol;


if (!preg_match('/\pL/u', 'a')) echo ('PCRE is not compiled with UTF-8 and 
Unicode support');
echo $eol;


Reply via email to