[PHP-BUG] Bug #54934 [NEW]: Unresolved symbol strtoull

2011-05-26 Thread php at dactar dot ch
From: 
Operating system: HP-UX 11.11
PHP version:  5.3.6
Package:  Compile Failure
Bug Type: Bug
Bug description:Unresolved symbol strtoull

Description:

I've compiled PHP 5.3.6 on HP-UX 11.11 with following parameters : 



./configure --disable-cli --with-config-file-path=/path/to/etc/php
--with-sybase-ct=/path/to/sybase --with-imap=/path/to/imap
--with-imap-ssl=/usr --with-libxml-dir=/path/to/libxml2 --with-gd
--with-png-dir=/path/to/libpng --with-jpeg-dir=/path/to/jpeg
--with-freetype-dir=/path/to/freetype --with-ldap  --prefix=/path/to/php
--with-apxs=/path/to/apache/bin/apxs



When I start apache, I've the following error : 



/usr/lib/dld.sl: Unresolved symbol: strtoull (code)  from
/path/to/apache/libexec/libphp5.so



If I compile without the option "--disable-cli", the error appears at
compile time.



According to this page :
http://gcc.gnu.org/ml/libstdc++/2002-03/msg00164.html,

HP-UX does not provide strtoll or strtoull functions in libc in 64 bit mode
since they are the same as strtol and strtoul so we define the libstdc++
functions to call strtol and strtoul.



I've resolved the situation with replacing all "strtoull" terms by
"strtoul" on the file ext/fileinfo/libmagic/apprentice.c


-- 
Edit bug report at http://bugs.php.net/bug.php?id=54934&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54934&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54934&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=54934&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54934&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54934&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54934&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=54934&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=54934&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=54934&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=54934&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=54934&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=54934&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=54934&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54934&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=54934&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=54934&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=54934&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=54934&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=54934&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=54934&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=54934&r=mysqlcfg



[PHP-BUG] Bug #54935 [NEW]: php_win_err can lead to crash

2011-05-26 Thread freddy77 at gmail dot com
From: 
Operating system: Windows
PHP version:  5.3.6
Package:  Unknown/Other Function
Bug Type: Bug
Bug description:php_win_err can lead to crash

Description:

Under Windows if php fail to load an extension apache crash.



Looking at code I discovered that php_win_err is wrong (I don't know if
this fix my problem).



In win32/winutil.c



PHPAPI char *php_win_err(int error)

{

char *buf = NULL;



FormatMessage(

FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
|   FORMAT_MESSAGE_IGNORE_INSERTS,

NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&buf, 0, NULL

);



return (buf ? (char *) buf : "");

}



now if FormatMessage fails buf is NULL and a "" is returned however in
ext/standard/dl.c a LocalFree is called if err (php_win_err result) is not
NULL.

Expected result:

Program should report error and not crash


-- 
Edit bug report at http://bugs.php.net/bug.php?id=54935&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54935&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54935&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=54935&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54935&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54935&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54935&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=54935&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=54935&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=54935&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=54935&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=54935&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=54935&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=54935&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54935&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=54935&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=54935&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=54935&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=54935&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=54935&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=54935&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=54935&r=mysqlcfg



Bug #54933 [Opn->Bgs]: Notice: Undefined variable: dbname

2011-05-26 Thread rasmus
Edit report at http://bugs.php.net/bug.php?id=54933&edit=1

 ID: 54933
 Updated by: ras...@php.net
 Reported by:future_evolium at yahoo dot com
 Summary:Notice: Undefined variable: dbname
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Program Execution
 Operating System:   WindowsXP
 PHP Version:5.3SVN-2011-05-26 (SVN)
 Block user comment: N
 Private report: N

 New Comment:

Your example works fine exactly as written.


Previous Comments:

[2011-05-26 08:57:17] future_evolium at yahoo dot com

Description:

I want to report a bug as soon as I installed the PHP version 5.3.5



   This bug concern the function include(). For example if I have a php
file which include another php file and if I'm trying to use the
variable declared in the included file for my parent file I have the
error:

Notice: Undefined variable: dbname

Test script:
---
Here is my test with running parent.php

I have three files:

parent.php





declared.php



Expected result:

I expect to recognize my variable and to print out.



this script should work







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54933&edit=1


Bug #54832 [Opn->Fbk]: unable to connect to mysql

2011-05-26 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=54832&edit=1

 ID: 54832
 Updated by: johan...@php.net
 Reported by:giorgio dot liscio at email dot it
 Summary:unable to connect to mysql
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:MySQL related
 Operating System:   windows 7 x64 ultimate
 PHP Version:5.4.0-dev
 Block user comment: N
 Private report: N

 New Comment:

This works on other systems quite well. Are you sure you have no
firewall or such? Pleas etry using 127.0.0.1 instead of localhost (there
had been issues due to Ipv6 vs. IPv4 in the past)


Previous Comments:

[2011-05-21 21:33:41] giorgio dot liscio at email dot it

same error on latest 5.4 revision too



May 21 2011 20:50:15 



i'm using the binaries of windows.php.net

http://windows.php.net/downloads/snaps/php-5.4/r311300/


[2011-05-18 15:03:46] giorgio dot liscio at email dot it

Description:

hi, with same apache + os + mysql installation and php 5.3.6 works
everything good



with trunk of today (not tested on previous trunks) i get always



Warning: mysqli_connect(): (HY000/2002): Impossibile stabilire la
connessione. Risposta non corretta della parte connessa dopo
l'intervallo di tempo oppure mancata risposta dall'host collegato.

 in E:\Lavoro\Software\Apache2\htdocs\index.php on line 20





~translation from italian:



unable to establish the connection. invalid answer in the time interval
or no answer from the host







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54832&edit=1


Req #54861 [Opn->Fbk]: query() optionaly prepared and PDO::PARAM_FIELDNAME(quoting)

2011-05-26 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=54861&edit=1

 ID: 54861
 Updated by: johan...@php.net
 Reported by:harrieva at gmx dot de
 Summary:query() optionaly prepared and
 PDO::PARAM_FIELDNAME(quoting)
-Status: Open
+Status: Feedback
 Type:   Feature/Change Request
 Package:PDO related
 Operating System:   linux
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

I do not understand what you want. Could you be more precise please?



About the " vs. ` thing: You can set the SQL mode in MySQL to be more
standards compliant. The MySQL developers are conservative in changing
the default as it will break many applications unfortunately.
http://dev.mysql.com/doc/refman/5.5/en/server-sql-mode.html (can be set
per session if you don't want/can change it globally)


Previous Comments:

[2011-05-19 13:33:54] harrieva at gmx dot de

Description:

I like prepared statements and its templating. Since query returns a
statement, why not making it a prepared one, when the second parameter
is an array, and execute it directly... Example: See my exPDO-Class at
the bottom.



Since mysql quotes fieldnames(and tablenames) different then
standardconform sqlservers, it is not easy to write/generate sql that
work everywhere... Eg. postgre lowercases fieldnames when they are not
quoted in "... Mysql wants `...



I help my self by deriving from PDO and overwrite quote...

public function quote($txt,$parameter_type = PDO::PARAM_STR ){

if($parameter_type == "12345"){

if($this->getAttribute(PDO::ATTR_DRIVER_NAME) == 
'mysql'){

return '`' . $txt . '`';

}else{

return '"' . $txt . '"';

}

}else{

return parent::quote($txt,$parameter_type);

}

}





By the way: Here is my hole extention Now it is possible to see all
the executed querys, and the time it took to get the result





query_count++;

if(is_array($args)){

if(empty($args)){

$this->sqls[] = 'q: '.$statement;

$start = microtime(true);

$res = parent::query($statement);

$this->query_time += microtime(true) - $start;

return $res;

}else{

//keine zeitmessung da diese durchs statement 
übernomen wird

$res = self::prepare($statement);

$res->execute($args);

$this->prepared_count--;

return $res;

}

}else{

$res = parent::prepare($statement);

$res->execute(array($args));

$this->prepared_count--;

return $res;

}

}

public function exec($statement,$args = array()){

$this->exec_count++;

if(is_array($args)){

if(empty($args)){

$this->sqls[] = 'e: '. $statement;

$start = microtime(true);

$res = parent::exec($statement);

$this->query_time += microtime(true) - $start;

return $res;

}else{

$res = self::prepare($statement);

$res->execute($args);

$this->prepared_count--;

return $res->rowCount();

}

}else{

$res = self::prepare($statement);

$res->execute( array($args) );

$this->prepared_count--;

return $res->rowCount();

}

}

public function quote($txt,$parameter_type = PDO::PARAM_STR ){

if($parameter_type == "12345"){

if($this->getAttribute(PDO::ATTR_DRIVER_NAME) == 
'mysql'){

return '`' . $txt . '`';

}else{

return '"' . $txt . '"';

}

}else{

return parent::quote($txt,$parameter_type);

}

}

public function prepare($statement,array $options = array()){

return parent::prepare($stateme

Bug #54832 [Fbk->Opn]: unable to connect to mysql

2011-05-26 Thread giorgio dot liscio at email dot it
Edit report at http://bugs.php.net/bug.php?id=54832&edit=1

 ID: 54832
 User updated by:giorgio dot liscio at email dot it
 Reported by:giorgio dot liscio at email dot it
 Summary:unable to connect to mysql
-Status: Feedback
+Status: Open
 Type:   Bug
 Package:MySQL related
 Operating System:   windows 7 x64 ultimate
 PHP Version:5.4.0-dev
 Block user comment: N
 Private report: N

 New Comment:

hi johannes, i tested with every combination, including firewall issues



but updating php latest revisions i noticed that not always driver
throws that error



sometimes on a just ran server (or thread?) some queries work, 

and sometimes when i F5 my browser the same queries continue to work,
but if i hold down f5 for a lot of continuous reloads the error
HY000/2002 is thrown



hope this helps to fix the bug


Previous Comments:

[2011-05-26 14:50:06] johan...@php.net

This works on other systems quite well. Are you sure you have no
firewall or such? Pleas etry using 127.0.0.1 instead of localhost (there
had been issues due to Ipv6 vs. IPv4 in the past)


[2011-05-21 21:33:41] giorgio dot liscio at email dot it

same error on latest 5.4 revision too



May 21 2011 20:50:15 



i'm using the binaries of windows.php.net

http://windows.php.net/downloads/snaps/php-5.4/r311300/


[2011-05-18 15:03:46] giorgio dot liscio at email dot it

Description:

hi, with same apache + os + mysql installation and php 5.3.6 works
everything good



with trunk of today (not tested on previous trunks) i get always



Warning: mysqli_connect(): (HY000/2002): Impossibile stabilire la
connessione. Risposta non corretta della parte connessa dopo
l'intervallo di tempo oppure mancata risposta dall'host collegato.

 in E:\Lavoro\Software\Apache2\htdocs\index.php on line 20





~translation from italian:



unable to establish the connection. invalid answer in the time interval
or no answer from the host







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54832&edit=1


Bug #54864 [Opn->Fbk]: Memory leak associated with mysql connector

2011-05-26 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=54864&edit=1

 ID: 54864
 Updated by: johan...@php.net
 Reported by:jas at rephunter dot net
 Summary:Memory leak associated with mysql connector
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:MySQLi related
 Operating System:   FreeBSD
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

Please provide a _complete_ script for testing. Also mind that
increasing memory_get_usage() values don't necessarily represent memory
leaks but includes different cache data or memory which will be re-used.


Previous Comments:

[2011-05-19 18:32:45] jas at rephunter dot net

Description:

I have found a memory leak in connection with several production PHP
scripts. 

While there are many bug reports relating to memory leaks, I did not
find 

anything similar to our situation, which is very easy to reproduce.



The scripts that have been affected by this memory leak have been in
continuous 

production use since 2006. We did not notice a memory leak prior to when
we 

first upgraded to PHP 5.3.5. It is possible that there was a smaller
leak prior 

to this time that merely escaped notice. However, before reporting the
problem, 

we upgraded to 5.3.6 to make sure it had not been corrected. The results
in this 

ticket are thus for 5.3.6.



Below I have given the main loop of a "small reproducible code." As you
can see, 

the only thing done in this test is to fetch the rows, and print out
memory 

usage every 3000 rows.



Regarding the mysql connector: originally the test was run with
mysqli_connect. 

It was suggested via Experts-Exchange to try the mysql_connector. This
was done 

but the results were identical. The full script can works with both 

mysql_connect and mysqli_connect, controlled by a define.



The bug signs:



1. On 5.3.6, the "after SQL" memory usage jumps to 13MB, whereas on
5.2.4 it 

stays at the initial low value (262144 on 5.2.4 but 786432 on 5.3.6).



2. On 5.3.6, the memory usage grows dramatically, whereas on 5.2.4 it
does not 

(the "id" lines are displayed after each 3000 rows, where the id is the
primary 

key for the row). In the production scripts, this leads to a crash when
the 

memory limit is exceeded.



Please note: 



1. the SQL statement is composed of a UNION of 5 relatively simple
SELECTs, 

making the single statement relatively complex.



2. The expected and actual results shown below are achieved by
connecting to the 

same database.



I you would like the URL of the actual script, which has the connection
routines 

and the SQL (which is relatively complex), please let me know as I would
have to 

remove the passwords, etc. I could also send a mysqldump of a sanitized
version 

of the database. The bzip2 of the dump file is about 35MB.

Test script:
---
echo "Test Autoemail Memory Leak\n";

echo 'start run mem=' . memory_get_usage(true) . "\n";

$query = get_query();

$rs = SQL($link, $query);

if ($rs)

{

// main loop

$cnt = 0;

echo 'after SQL mem=' . memory_get_usage(true) . "\n";

$func = (MYSQL_ENHANCED) ? 'mysqli_fetch_row' : 'mysql_fetch_row';

while($row = $func($rs))

{

if (++$cnt % 3000 == 0)

{

echo '   id=' . $row[1] . '  mem=' . 
memory_get_usage(true) . "\n";

}

}

echo "EOJ\n";

}

else

{

echo $errmsg;

}





Full script is at http://www.rephunter.net/test-autoemail-memory.php.
The web server will execute the script if accessed in a browser.

Expected result:

Showing no leak on Windows VM PHP 5.2.4 connecting to same database



F:\Websites\RepHunter\current>php -v

PHP 5.2.4 (cli) (built: Oct  1 2007 20:06:42)

Copyright (c) 1997-2007 The PHP Group

Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

with Zend Core v2.5.0, Copyright (c) 1998-2006, by Zend
Technologies

with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by Zend
Technol

ogies

with Zend Optimizer v3.3.1, Copyright (c) 1998-2007, by Zend
Technologies

with Zend Debugger v5.2.10, Copyright (c) 1999-2007, by Zend
Technologies



F:\Websites\RepHunter\current>php test-autoemail-memory.php

Test Autoemail Memory Leak

Using mysqli_connect

start run mem=262144

after SQL mem=262144

   id=43655  mem=262144

   id=40250  mem=262144

   id=37355  mem=262144

   id=34419  mem=262144

   id=31544  mem=262144

   id=28915  mem=262144

   id=26168  mem=262144

   id=21461  mem=262144

   id=16550  mem=262144

   id=13074  mem=262144

   id=9140  mem=262144

   id=3892  mem=262144

EOJ



F:\Websites\RepHunter\current>



Actual result:
--
Showing the leak on 5.3.6



[jas1@www /var/www/rephunter/www/webroot]$ php

Bug #54929 [Opn]: Parse error with single quote in sql comment (pdo-mysql)

2011-05-26 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=54929&edit=1

 ID: 54929
 Updated by: johan...@php.net
 Reported by:hencke at gmail dot com
 Summary:Parse error with single quote in sql comment
 (pdo-mysql)
 Status: Open
 Type:   Bug
 Package:PDO related
 Operating System:   linux (centos 5.5)
 PHP Version:5.2.17
 Block user comment: N
 Private report: N

 New Comment:

The parser in PDO is extremely simple. The purpose is to translate place
holders according to the DBMS used (some allow ?, some allow :name, some
not ...). It is damn simple for doing that. It doesn't know about
comments. Comments are complicated as different DBMSes treat them
differently. A simple constructed MySQL example:



   SELECT a,b,c FROM t WHERE a>b /*!50122 AND b = ?*/



There the parser has a hard time to guess what happens ...



Not sure there is a _good_ way to properly fix this issue.


Previous Comments:

[2011-05-25 20:00:25] hencke at gmail dot com

Description:

Using php 5.2.17

Tested PDO with mysql, haven't tried other drivers.

Configure Command =>  './configure'  '--disable-cgi' '--with-mysql'
'--enable-pdo' '--with-pdo-mysql' '--with-libdir=lib64'



There is a PDO parsing error when a single quote is inside a block
comment. This seems to only occur when there is an input parameter
between a commented single quote and any other single quote, either as
part of the query or in another comment.



It looks like the single quotes aren't getting ignored in the comment,
and cause parameters to not be replaced with their values.



Example SQL that causes a parse error:

/* ' */ select ? as f1, 'foo' as f2

This also causes errors:

/* ' */ select ? as f1 /* ' */





Test script:
---
prepare($query);

if (!$stmt->execute(array("foo"))) {

$errInfo = $stmt->errorInfo();

print_r($errInfo);

}

?>

Expected result:

The single quotes should be completely ignored when inside comments, and
the ? should be replaced with the input parameter value "'foo'".

Actual result:
--
The query doesn't execute successfully, with the following PDO error
info:

[0] => 42000

[1] => 1064

[2] => You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '? as f1, 'bar' as f2' at line 1








-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54929&edit=1


Bug #54832 [Opn]: unable to connect to mysql

2011-05-26 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=54832&edit=1

 ID: 54832
 Updated by: johan...@php.net
 Reported by:giorgio dot liscio at email dot it
 Summary:unable to connect to mysql
 Status: Open
 Type:   Bug
 Package:MySQL related
 Operating System:   windows 7 x64 ultimate
 PHP Version:5.4.0-dev
 Block user comment: N
 Private report: N

 New Comment:

Have you tried 127.0.0.1 instead of localhost? Or are you actually
connecting to a remote host? As mentioned in my previous statement we
had such timeouts due to IPv6 issues in the past. While then it doesn't
make sense if it works sometimes ...



My next best guess would be to try using a network analyzer (wireshark
or such) to log the network traffic. Not sure I have a better idea
(while I myself am not to familiar with such low level analysis on
windows, maybe there are simpler ways ...)


Previous Comments:

[2011-05-26 14:57:27] giorgio dot liscio at email dot it

hi johannes, i tested with every combination, including firewall issues



but updating php latest revisions i noticed that not always driver
throws that error



sometimes on a just ran server (or thread?) some queries work, 

and sometimes when i F5 my browser the same queries continue to work,
but if i hold down f5 for a lot of continuous reloads the error
HY000/2002 is thrown



hope this helps to fix the bug


[2011-05-26 14:50:06] johan...@php.net

This works on other systems quite well. Are you sure you have no
firewall or such? Pleas etry using 127.0.0.1 instead of localhost (there
had been issues due to Ipv6 vs. IPv4 in the past)


[2011-05-21 21:33:41] giorgio dot liscio at email dot it

same error on latest 5.4 revision too



May 21 2011 20:50:15 



i'm using the binaries of windows.php.net

http://windows.php.net/downloads/snaps/php-5.4/r311300/


[2011-05-18 15:03:46] giorgio dot liscio at email dot it

Description:

hi, with same apache + os + mysql installation and php 5.3.6 works
everything good



with trunk of today (not tested on previous trunks) i get always



Warning: mysqli_connect(): (HY000/2002): Impossibile stabilire la
connessione. Risposta non corretta della parte connessa dopo
l'intervallo di tempo oppure mancata risposta dall'host collegato.

 in E:\Lavoro\Software\Apache2\htdocs\index.php on line 20





~translation from italian:



unable to establish the connection. invalid answer in the time interval
or no answer from the host







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54832&edit=1


Bug #51880 [Com]: Missfunction of mb_eregi() and mb_ereg()

2011-05-26 Thread bgamrat at wirehopper dot com
Edit report at http://bugs.php.net/bug.php?id=51880&edit=1

 ID: 51880
 Comment by: bgamrat at wirehopper dot com
 Reported by:tnpaulik at gmail dot com
 Summary:Missfunction of mb_eregi() and mb_ereg()
 Status: Assigned
 Type:   Bug
 Package:*Regular Expressions
 Operating System:   Windows, Linux, doesn't matter
 PHP Version:Irrelevant
 Assigned To:moriyoshi
 Block user comment: N
 Private report: N

 New Comment:

This may be related.



I had a date string (-MM-DD HH:MM:SS) validation that was
inconsistent.  The code below runs the validation 100 times on the same
values and regex.  Most of the time the mb_ereg works, occasionally it
doesn't.



Earlier issues with case-sensitivity caused me to add a case-insensitive
fallback, and to solve this issue, I added a fallback to use
preg_match.



';;



for ($i=0;$i<100;$i++)

filter ('^\d{4}\-\d{2}\-\d{2} \d{2}\:\d{2}\:\d{2}$','2011-05-15
09:00:07');



function filter($sRegExp,$sInput)

{

if (!isset($sInput))

return false;

$sInput=trim($sInput);

/* mb_ereg functions don't use slashes */

if ($sRegExp[0]=='/')

$sRegExp=substr($sRegExp,1,-1);

$aMatches=array();

$iResult=mb_ereg($sRegExp,$sInput,$aMatches);

echo 'Testing '.$sInput.' against
'.$sRegExp.PHP_EOL.var_export($aMatches,true).' result '.$iResult.'';;

if (strlen($sInput)!=$iResult)

{

  $sLowerCaseRegExp=mb_strtolower($sRegExp);

  $sLowerCaseInput=mb_strtolower($sInput);

 
$iResult=mb_ereg($sLowerCaseRegExp,$sLowerCaseInput,$aMatches);

  echo 'Fallback Testing '.$sLowerCaseInput.' against
'.$sLowerCaseInput.PHP_EOL.var_export($aMatches,true).' result
'.$iResult.'';;

  if (strlen($sInput)!=$iResult)

  {

 
$bResult=preg_match('/'.$sRegExp.'/i',$sLowerCaseInput);

  echo 'preg_match/i '.$bResult.'';

  return $bResult!=0;

  }

}

return true;

}



Linux domain.com 2.6.18-164.9.1.el5 #1 SMP Tue Dec 15 21:04:57 EST 2009
i686 i686 i386 GNU/Linux



Apache/2.2.3 



PHP version 5.1.6



mbstring

Multibyte Support  enabled  

Multibyte string engine  libmbfl  

Multibyte (japanese) regex support  enabled  

Multibyte regex (oniguruma) version  3.7.1  



mbstring extension makes use of "streamable kanji code filter and
converter", which is distributed under the GNU Lesser General Public
License version 2.1. 



Directive Local Value Master Value 

mbstring.detect_order no value no value 

mbstring.encoding_translation Off Off 

mbstring.func_overload 0 0 

mbstring.http_input pass pass 

mbstring.http_output pass pass 

mbstring.internal_encoding no value no value 

mbstring.language neutral neutral 

mbstring.strict_detection Off Off 

mbstring.substitute_character no value no value


Previous Comments:

[2010-05-21 16:13:23] tnpaulik at gmail dot com

Description:

mb_eregi doesnt macht caseinsensitivity for non ASCII signs in PHP 5.2
and 5.3



Example:

mb_eregi('Ü','ü') returns false.





mb_ereg is case insensotoive for non ASCII charakters if i put tem in
[]



Example:

mb_ereg("[Ü]","ü") returns true.

Test script:
---
if (!mb_eregi("Ü","ü"))

echo "THAT shoudldn't be so...\n";



if (mb_ereg("[Ü]","ü"))

echo "THAT shoudldn't be so...\n";

Expected result:

no output

Actual result:
--
THAT shoudldn't be so...

THAT shoudldn't be so...






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51880&edit=1


Req #54861 [Fbk->Opn]: query() optionaly prepared and PDO::PARAM_FIELDNAME(quoting)

2011-05-26 Thread harrieva at gmx dot de
Edit report at http://bugs.php.net/bug.php?id=54861&edit=1

 ID: 54861
 User updated by:harrieva at gmx dot de
 Reported by:harrieva at gmx dot de
 Summary:query() optionaly prepared and
 PDO::PARAM_FIELDNAME(quoting)
-Status: Feedback
+Status: Open
 Type:   Feature/Change Request
 Package:PDO related
 Operating System:   linux
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

1. SQL-Quoting:

Postgresql whants a query like this: Select "Name" from "Persons"

Mysql wants the same query like this: Select `Name` from `Persons`



Mysql has a unique interpretation of the Standard by default. When i
want to write a query whitch runs on mysql and other sql-servers i have
to quote fielnames (and tablenames) diffrent. In my eyes this is
something that should be done by PDO->quote(). 



(This is importend for captalized fieldnames)



2. Queryparameter:

The second thing is an idea i had. This idea is on quoting to. Here is
an example:

  How it is often done:

$sql = "select * from a where bla = " . $bla;

$res = $db->query($sql);

  How it should be done:

$sql = "select * from a where bla = " . $db->quote($bla);

$res = $db->query($sql);

  How should be done (the nicer way):

$stmt = $db->prepare("select * from a where bla = ?");

$stmt->execute($bla)



 And now i like it to be done:

$stmt = $db->query("select * from a where bla = ?",$bla);



 I like the ? and :-Syntax that i can use with prepared statements. And
i like to use this syntax in query() too. Like prepare(), query()
returns a PDO::Statement, so my idea is, that query() should return an
executed prepared statement, when a second parameter is given. It saves
one line of code and it feels smother, then getting an object back, call
execute() for this object, and then call fetchall() on the same object.
Back in the days you mysql returnd resultsets, and so people are still
used to the thinking that db returns results, The Statement-Objects are
diffrent, but most people do not recordnice it because they only use
query(), Furthermore i think many people use prepare() only when a sql
is used more then one time. This is psychological, and so they don't use
the advantages of the ? and :-Syntax, because query() does not support
it...



I hope everything is clearer now ... ? ...





regards, Hendrik


Previous Comments:

[2011-05-26 14:54:26] johan...@php.net

I do not understand what you want. Could you be more precise please?



About the " vs. ` thing: You can set the SQL mode in MySQL to be more
standards compliant. The MySQL developers are conservative in changing
the default as it will break many applications unfortunately.
http://dev.mysql.com/doc/refman/5.5/en/server-sql-mode.html (can be set
per session if you don't want/can change it globally)


[2011-05-19 13:33:54] harrieva at gmx dot de

Description:

I like prepared statements and its templating. Since query returns a
statement, why not making it a prepared one, when the second parameter
is an array, and execute it directly... Example: See my exPDO-Class at
the bottom.



Since mysql quotes fieldnames(and tablenames) different then
standardconform sqlservers, it is not easy to write/generate sql that
work everywhere... Eg. postgre lowercases fieldnames when they are not
quoted in "... Mysql wants `...



I help my self by deriving from PDO and overwrite quote...

public function quote($txt,$parameter_type = PDO::PARAM_STR ){

if($parameter_type == "12345"){

if($this->getAttribute(PDO::ATTR_DRIVER_NAME) == 
'mysql'){

return '`' . $txt . '`';

}else{

return '"' . $txt . '"';

}

}else{

return parent::quote($txt,$parameter_type);

}

}





By the way: Here is my hole extention Now it is possible to see all
the executed querys, and the time it took to get the result





query_count++;

if(is_array($args)){

if(empty($args)){

$this->sqls[] = 'q: '.$statement;

$start = microtime(true);

$res = parent::query($statement);

$this->query_time += microtime(true) - $start;

return $res;

}else{

//keine zeitmessung da diese durchs statement 
übernomen wird

$res = self::prepare($statement);

$res->execute($args);

 

Bug #54935 [Opn->Csd]: php_win_err can lead to crash

2011-05-26 Thread pajoye
Edit report at http://bugs.php.net/bug.php?id=54935&edit=1

 ID: 54935
 Updated by: paj...@php.net
 Reported by:freddy77 at gmail dot com
 Summary:php_win_err can lead to crash
-Status: Open
+Status: Closed
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   Windows
 PHP Version:5.3.6
-Assigned To:
+Assigned To:pajoye
 Block user comment: N
 Private report: N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:

[2011-05-26 16:37:17] paj...@php.net

Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=311444
Log: -fix bug 54935, php_win_err can lead to crash


[2011-05-26 14:32:02] freddy77 at gmail dot com

Description:

Under Windows if php fail to load an extension apache crash.



Looking at code I discovered that php_win_err is wrong (I don't know if
this fix my problem).



In win32/winutil.c



PHPAPI char *php_win_err(int error)

{

char *buf = NULL;



FormatMessage(

FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |   FORMAT_MESSAGE_IGNORE_INSERTS,

NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&buf, 0, NULL

);



return (buf ? (char *) buf : "");

}



now if FormatMessage fails buf is NULL and a "" is returned however in
ext/standard/dl.c a LocalFree is called if err (php_win_err result) is
not NULL.

Expected result:

Program should report error and not crash







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54935&edit=1


Bug #54832 [Com]: unable to connect to mysql

2011-05-26 Thread giorgio dot liscio at email dot it
Edit report at http://bugs.php.net/bug.php?id=54832&edit=1

 ID: 54832
 Comment by: giorgio dot liscio at email dot it
 Reported by:giorgio dot liscio at email dot it
 Summary:unable to connect to mysql
 Status: Open
 Type:   Bug
 Package:MySQL related
 Operating System:   windows 7 x64 ultimate
 PHP Version:5.4.0-dev
 Block user comment: N
 Private report: N

 New Comment:

yes i've tried with 127.0.0.1



wireshark can't capture localhost packets due to a windows limitation
:rage:



i have to try in my network, i will update you



thank you


Previous Comments:

[2011-05-26 15:53:43] johan...@php.net

Have you tried 127.0.0.1 instead of localhost? Or are you actually
connecting to a remote host? As mentioned in my previous statement we
had such timeouts due to IPv6 issues in the past. While then it doesn't
make sense if it works sometimes ...



My next best guess would be to try using a network analyzer (wireshark
or such) to log the network traffic. Not sure I have a better idea
(while I myself am not to familiar with such low level analysis on
windows, maybe there are simpler ways ...)


[2011-05-26 14:57:27] giorgio dot liscio at email dot it

hi johannes, i tested with every combination, including firewall issues



but updating php latest revisions i noticed that not always driver
throws that error



sometimes on a just ran server (or thread?) some queries work, 

and sometimes when i F5 my browser the same queries continue to work,
but if i hold down f5 for a lot of continuous reloads the error
HY000/2002 is thrown



hope this helps to fix the bug


[2011-05-26 14:50:06] johan...@php.net

This works on other systems quite well. Are you sure you have no
firewall or such? Pleas etry using 127.0.0.1 instead of localhost (there
had been issues due to Ipv6 vs. IPv4 in the past)


[2011-05-21 21:33:41] giorgio dot liscio at email dot it

same error on latest 5.4 revision too



May 21 2011 20:50:15 



i'm using the binaries of windows.php.net

http://windows.php.net/downloads/snaps/php-5.4/r311300/


[2011-05-18 15:03:46] giorgio dot liscio at email dot it

Description:

hi, with same apache + os + mysql installation and php 5.3.6 works
everything good



with trunk of today (not tested on previous trunks) i get always



Warning: mysqli_connect(): (HY000/2002): Impossibile stabilire la
connessione. Risposta non corretta della parte connessa dopo
l'intervallo di tempo oppure mancata risposta dall'host collegato.

 in E:\Lavoro\Software\Apache2\htdocs\index.php on line 20





~translation from italian:



unable to establish the connection. invalid answer in the time interval
or no answer from the host







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54832&edit=1


[PHP-BUG] Req #54936 [NEW]: alternative syntax for

2011-05-26 Thread giorgio dot liscio at email dot it
From: 
Operating system: any
PHP version:  5.3.6
Package:  Unknown/Other Function
Bug Type: Feature/Change Request
Bug description:alternative syntax for 

Description:

hi, i don't know if there are some problems (parsing, security) with this,
but an alternative syntax for php open and close tags would be really nice
for xml



editors and xml parsers don't like php used like this:



Homepage



so an alternative syntax, xml compatible, can be useful, for example:



Homepage


-- 
Edit bug report at http://bugs.php.net/bug.php?id=54936&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54936&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54936&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=54936&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54936&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54936&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54936&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=54936&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=54936&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=54936&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=54936&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=54936&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=54936&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=54936&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54936&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=54936&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=54936&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=54936&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=54936&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=54936&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=54936&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=54936&r=mysqlcfg



Req #54936 [Opn->Bgs]: alternative syntax for

2011-05-26 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=54936&edit=1

 ID: 54936
 Updated by: johan...@php.net
 Reported by:giorgio dot liscio at email dot it
 Summary:alternative syntax for 
-Status: Open
+Status: Bogus
 Type:   Feature/Change Request
 Package:Unknown/Other Function
 Operating System:   any
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

Most editors are aware of the PHP syntax.

Your propsed syntax won't work out as there is an conflict with
statements like $a[$b[23]].

You can parse PHP anyways using an XML parset. In your example you'd at
least have to write $item>getUrl();.

You can write the code in a more "compatible" way. (echo 'getUrl(); ?>">Homepage



so an alternative syntax, xml compatible, can be useful, for example:



Homepage







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54936&edit=1


Bug #54924 [Opn->Csd]: assert.active is not being reset upon request shutdown

2011-05-26 Thread iliaa
Edit report at http://bugs.php.net/bug.php?id=54924&edit=1

 ID: 54924
 Updated by: il...@php.net
 Reported by:andreas dot streichardt at gmail dot com
 Summary:assert.active is not being reset upon request
 shutdown
-Status: Open
+Status: Closed
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   Linux
 PHP Version:5.3.6
-Assigned To:
+Assigned To:iliaa
 Block user comment: N
 Private report: N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:

[2011-05-26 20:17:45] il...@php.net

Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=311451
Log: Fixed bug #54924 (assert.* is not being reset upon request
shutdown).


[2011-05-25 14:15:44] steemann at globalpark dot de

Same issue for assert.warning (ASSERT_WARNING).

The value is not reset to the ini setting value at the end of each
request if PHP child processes are reused (e.g. in fastcgi mode).

Probably the same for assert.bail and friends.


[2011-05-25 13:48:50] andreas dot streichardt at gmail dot com

Description:

The assert related functions are saving their state in a global
structure. The 

problem is that the assert state is not being reset in the RSHUTDOWN
function 

and thus the assert state of the last request will be used for the next
request.



Example: If assert is active by default (php.ini assert.active) and you
set it 

to false via assert_options this works fine. However on the next request
the 

default will be that assert is not active.





The fix is to add



  ASSERTG(active)=INI_INT("assert.active");



to asserts RSHUTDOWN function.



I am using the FastCGI SAPI.

Test script:
---
var_dump(assert_options(ASSERT_ACTIVE));

assert(false);

var_dump(assert_options(ASSERT_ACTIVE,1));

assert(false);

var_dump(assert_options(ASSERT_ACTIVE,0));

assert(false);



Expected result:

int(1) 

Warning: assert() [function.assert]: Assertion failed in xxx.php on line
3

int(1) 

Warning: assert() [function.assert]: Assertion failed in xxx.php on line
5

int(1)

Actual result:
--
First request:



int(1) 

Warning: assert() [function.assert]: Assertion failed in xxx.php on line
3

int(1) 

Warning: assert() [function.assert]: Assertion failed in xxx.php on line
5

int(1)



Second request (make sure you hit the same pid):



int(0) int(0) 

Warning: assert() [function.assert]: Assertion failed in xxx.php on line
5

int(1)








-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54924&edit=1


Req #54936 [Com]: alternative syntax for

2011-05-26 Thread giorgio dot liscio at email dot it
Edit report at http://bugs.php.net/bug.php?id=54936&edit=1

 ID: 54936
 Comment by: giorgio dot liscio at email dot it
 Reported by:giorgio dot liscio at email dot it
 Summary:alternative syntax for 
 Status: Bogus
 Type:   Feature/Change Request
 Package:Unknown/Other Function
 Operating System:   any
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

what about



Home


Previous Comments:

[2011-05-26 19:50:59] johan...@php.net

Most editors are aware of the PHP syntax.

Your propsed syntax won't work out as there is an conflict with
statements like $a[$b[23]].

You can parse PHP anyways using an XML parset. In your example you'd at
least have to write $item>getUrl();.

You can write the code in a more "compatible" way. (echo 'getUrl(); ?>">Homepage



so an alternative syntax, xml compatible, can be useful, for example:



Homepage







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54936&edit=1


Req #52647 [Com]: Function to get Windows drive letters

2011-05-26 Thread drgroove at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52647&edit=1

 ID: 52647
 Comment by: drgroove at gmail dot com
 Reported by:shaun dot spiller at yahoo dot com
 Summary:Function to get Windows drive letters
 Status: Assigned
 Type:   Feature/Change Request
 Package:Filesystem function related
 Operating System:   Windows
 PHP Version:5.3.3
 Assigned To:pajoye
 Block user comment: N
 Private report: N

 New Comment:

I'd really like to see this, or something like it, added to the next
version of PHP.


Previous Comments:

[2010-12-10 03:20:24] paj...@php.net

5.3 is not for new features.  And as I said in my comment, there are
issues with this patch. So don't be too much disappointed :)


[2010-12-10 02:37:12] shaun dot spiller at yahoo dot com

I'm very disappointed this wasn't added to PHP 5.3.4. I've been checking
daily since submitting this but the new version of PHP was just released
and my patch has been forgotten.



This code works perfectly (as far as I can tell) and fills a glaring
hole in the PHP filesystem API. All it needs is for somebody to decide
to add it to the source tree. Name the function whatever. I did the best
I could to learn the ins and outs of the PHP internals to integrate it
and provide it in an acceptable form. This is where someone (?) on IRC
told me to submit it.


[2010-08-20 17:33:02] ka...@php.net

That was what I was thinking too, something like sys_get_drives() or
sys_get_devices() was what I had in mind if someone one day was going to
port it so the name is consistent :)


[2010-08-19 22:26:08] paj...@php.net

Sorry Kalle, already looked at that a while back. Also the function name
and co is not that good. >> taking back :)


[2010-08-19 22:24:10] ka...@php.net

I'm re-assigning this one to me, I'll have a look and test of it doing
the weekend and commit it to trunk



Thanks for the contribution! :)




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=52647


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52647&edit=1


Req #52647 [Com]: Function to get Windows drive letters

2011-05-26 Thread asdasdioj at asdojiojasd dot asdasd
Edit report at http://bugs.php.net/bug.php?id=52647&edit=1

 ID: 52647
 Comment by: asdasdioj at asdojiojasd dot asdasd
 Reported by:shaun dot spiller at yahoo dot com
 Summary:Function to get Windows drive letters
 Status: Assigned
 Type:   Feature/Change Request
 Package:Filesystem function related
 Operating System:   Windows
 PHP Version:5.3.3
 Assigned To:pajoye
 Block user comment: N
 Private report: N

 New Comment:

I check back here every day for progress. Never happens. I'm non-plussed
as to how this feature got overlooked for so long, or what mythical
issues pajoye thinks there are with my lovely code. :-(


Previous Comments:

[2011-05-26 23:40:49] drgroove at gmail dot com

I'd really like to see this, or something like it, added to the next
version of PHP.


[2010-12-10 03:20:24] paj...@php.net

5.3 is not for new features.  And as I said in my comment, there are
issues with this patch. So don't be too much disappointed :)


[2010-12-10 02:37:12] shaun dot spiller at yahoo dot com

I'm very disappointed this wasn't added to PHP 5.3.4. I've been checking
daily since submitting this but the new version of PHP was just released
and my patch has been forgotten.



This code works perfectly (as far as I can tell) and fills a glaring
hole in the PHP filesystem API. All it needs is for somebody to decide
to add it to the source tree. Name the function whatever. I did the best
I could to learn the ins and outs of the PHP internals to integrate it
and provide it in an acceptable form. This is where someone (?) on IRC
told me to submit it.


[2010-08-20 17:33:02] ka...@php.net

That was what I was thinking too, something like sys_get_drives() or
sys_get_devices() was what I had in mind if someone one day was going to
port it so the name is consistent :)


[2010-08-19 22:26:08] paj...@php.net

Sorry Kalle, already looked at that a while back. Also the function name
and co is not that good. >> taking back :)




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=52647


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52647&edit=1


Bug #51880 [Com]: Missfunction of mb_eregi() and mb_ereg()

2011-05-26 Thread bgamrat at wirehopper dot com
Edit report at http://bugs.php.net/bug.php?id=51880&edit=1

 ID: 51880
 Comment by: bgamrat at wirehopper dot com
 Reported by:tnpaulik at gmail dot com
 Summary:Missfunction of mb_eregi() and mb_ereg()
 Status: Assigned
 Type:   Bug
 Package:*Regular Expressions
 Operating System:   Windows, Linux, doesn't matter
 PHP Version:Irrelevant
 Assigned To:moriyoshi
 Block user comment: N
 Private report: N

 New Comment:

Some of my coworkers found that mb_regex_set_options is global in scope
for the thread.  If mb_regex_set_options is set differently on different
threads, the mb_ereg functions will function differently as well.



To verify, echo mb_regex_set_options() on each request of the earlier
submitted test code.  If it is incompatible with the regex, mb_ereg will
not match.


Previous Comments:

[2011-05-26 16:17:58] bgamrat at wirehopper dot com

This may be related.



I had a date string (-MM-DD HH:MM:SS) validation that was
inconsistent.  The code below runs the validation 100 times on the same
values and regex.  Most of the time the mb_ereg works, occasionally it
doesn't.



Earlier issues with case-sensitivity caused me to add a case-insensitive
fallback, and to solve this issue, I added a fallback to use
preg_match.



';;



for ($i=0;$i<100;$i++)

filter ('^\d{4}\-\d{2}\-\d{2} \d{2}\:\d{2}\:\d{2}$','2011-05-15
09:00:07');



function filter($sRegExp,$sInput)

{

if (!isset($sInput))

return false;

$sInput=trim($sInput);

/* mb_ereg functions don't use slashes */

if ($sRegExp[0]=='/')

$sRegExp=substr($sRegExp,1,-1);

$aMatches=array();

$iResult=mb_ereg($sRegExp,$sInput,$aMatches);

echo 'Testing '.$sInput.' against
'.$sRegExp.PHP_EOL.var_export($aMatches,true).' result '.$iResult.'';;

if (strlen($sInput)!=$iResult)

{

  $sLowerCaseRegExp=mb_strtolower($sRegExp);

  $sLowerCaseInput=mb_strtolower($sInput);

 
$iResult=mb_ereg($sLowerCaseRegExp,$sLowerCaseInput,$aMatches);

  echo 'Fallback Testing '.$sLowerCaseInput.' against
'.$sLowerCaseInput.PHP_EOL.var_export($aMatches,true).' result
'.$iResult.'';;

  if (strlen($sInput)!=$iResult)

  {

 
$bResult=preg_match('/'.$sRegExp.'/i',$sLowerCaseInput);

  echo 'preg_match/i '.$bResult.'';

  return $bResult!=0;

  }

}

return true;

}



Linux domain.com 2.6.18-164.9.1.el5 #1 SMP Tue Dec 15 21:04:57 EST 2009
i686 i686 i386 GNU/Linux



Apache/2.2.3 



PHP version 5.1.6



mbstring

Multibyte Support  enabled  

Multibyte string engine  libmbfl  

Multibyte (japanese) regex support  enabled  

Multibyte regex (oniguruma) version  3.7.1  



mbstring extension makes use of "streamable kanji code filter and
converter", which is distributed under the GNU Lesser General Public
License version 2.1. 



Directive Local Value Master Value 

mbstring.detect_order no value no value 

mbstring.encoding_translation Off Off 

mbstring.func_overload 0 0 

mbstring.http_input pass pass 

mbstring.http_output pass pass 

mbstring.internal_encoding no value no value 

mbstring.language neutral neutral 

mbstring.strict_detection Off Off 

mbstring.substitute_character no value no value


[2010-05-21 16:13:23] tnpaulik at gmail dot com

Description:

mb_eregi doesnt macht caseinsensitivity for non ASCII signs in PHP 5.2
and 5.3



Example:

mb_eregi('Ü','ü') returns false.





mb_ereg is case insensotoive for non ASCII charakters if i put tem in
[]



Example:

mb_ereg("[Ü]","ü") returns true.

Test script:
---
if (!mb_eregi("Ü","ü"))

echo "THAT shoudldn't be so...\n";



if (mb_ereg("[Ü]","ü"))

echo "THAT shoudldn't be so...\n";

Expected result:

no output

Actual result:
--
THAT shoudldn't be so...

THAT shoudldn't be so...






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51880&edit=1


Req #40046 [Com]: OpenSSL CRL generation support

2011-05-26 Thread rsmaia at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=40046&edit=1

 ID: 40046
 Comment by: rsmaia at gmail dot com
 Reported by:mbechler at eenterphace dot org
 Summary:OpenSSL CRL generation support
 Status: Assigned
 Type:   Feature/Change Request
 Package:OpenSSL related
 PHP Version:*
 Assigned To:pajoye
 Block user comment: N
 Private report: N

 New Comment:

I am waiting for this patch too. Would be great to see this patch
applied into PHP core.

+1 for this improvement!


Previous Comments:

[2010-04-12 17:50:29] pm at datasphere dot ch

I'm also very interested in having this feature supported in the PHP
standards. Can I expect to see it soon available ?


[2010-02-15 09:07:32] cnyegle at gmail dot com

Will the patch be merged into PHP?It's two years after the last
modification of this issue.


[2007-09-23 19:51:19] paj...@php.net

>From Moritz Bechler:



It took some time - but I now managed to put together some test cases

(which hopefully can also serve as examples). I noticed that the
current

"openssl_x509_checkpurpose" function does not allow for passing

verification flags so I introduced a new function "openssl_x509_check"

(verify might be better but might cause confusion with openssl_verify)

which does pretty much the same thing but takes a flags parameter which

can be used to enable CRL checking and some other checking features

which I did not test yet. I chose to add a new function because a)

adding the argument to the end forces passing two (one unused in most

cases) optional arguments b) _checkpurpose is a bit too specific. I
hope

that approach is okay.



The updated patch is at

http://mbechler.eenterphace.org/php6-openssl-crl.patch

and the phpt and required data (needs a small CA, included files are

valid for 5 years) at

http://mbechler.eenterphace.org/php6-openssl-crl-tests.tar.bz2





I noted my test fails (even for ascii filenames) when run in unicode

mode which is a result of

this check in php_openssl_x509_from_zval:



if (!(Z_TYPE_PP(val) == IS_STRING || Z_TYPE_PP(val) == IS_OBJECT)) {

   return NULL;

}



maybe I'll find some time to have a look at proper filesystem encoding

conversions for ext/openssl.


[2007-08-03 11:37:24] paj...@php.net

Add the note here too :)



Please provide some test cases as well, including the required data (if
any).


[2007-01-07 02:47:19] mbechler at eenterphace dot org

Ok, finally found the bug - new patch is here:

http://mbechler.eenterphace.org/ext-openssl-crl.patch




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=40046


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=40046&edit=1


Bug #54934 [PATCH]: Unresolved symbol strtoull

2011-05-26 Thread fel...@php.net
Edit report at http://bugs.php.net/bug.php?id=54934&edit=1

 ID: 54934
 Patch added by: fel...@php.net
 Reported by:php at dactar dot ch
 Summary:Unresolved symbol strtoull
 Status: Open
 Type:   Bug
 Package:Compile Failure
 Operating System:   HP-UX 11.11
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

The following patch has been added/updated:

Patch Name: fix-build
Revision:   1306457948
URL:   
http://bugs.php.net/patch-display.php?bug=54934&patch=fix-build&revision=1306457948


Previous Comments:

[2011-05-26 09:58:31] php at dactar dot ch

Description:

I've compiled PHP 5.3.6 on HP-UX 11.11 with following parameters : 



./configure --disable-cli --with-config-file-path=/path/to/etc/php
--with-sybase-ct=/path/to/sybase --with-imap=/path/to/imap
--with-imap-ssl=/usr --with-libxml-dir=/path/to/libxml2 --with-gd
--with-png-dir=/path/to/libpng --with-jpeg-dir=/path/to/jpeg
--with-freetype-dir=/path/to/freetype --with-ldap  --prefix=/path/to/php
--with-apxs=/path/to/apache/bin/apxs



When I start apache, I've the following error : 



/usr/lib/dld.sl: Unresolved symbol: strtoull (code)  from
/path/to/apache/libexec/libphp5.so



If I compile without the option "--disable-cli", the error appears at
compile time.



According to this page :
http://gcc.gnu.org/ml/libstdc++/2002-03/msg00164.html,

HP-UX does not provide strtoll or strtoull functions in libc in 64 bit
mode since they are the same as strtol and strtoul so we define the
libstdc++ functions to call strtol and strtoul.



I've resolved the situation with replacing all "strtoull" terms by
"strtoul" on the file ext/fileinfo/libmagic/apprentice.c







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54934&edit=1


Bug #54934 [Opn->Fbk]: Unresolved symbol strtoull

2011-05-26 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=54934&edit=1

 ID: 54934
 Updated by: fel...@php.net
 Reported by:php at dactar dot ch
 Summary:Unresolved symbol strtoull
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Compile Failure
 Operating System:   HP-UX 11.11
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

Can you test the attached patch, please?


Previous Comments:

[2011-05-27 02:59:08] fel...@php.net

The following patch has been added/updated:

Patch Name: fix-build
Revision:   1306457948
URL:   
http://bugs.php.net/patch-display.php?bug=54934&patch=fix-build&revision=1306457948


[2011-05-26 09:58:31] php at dactar dot ch

Description:

I've compiled PHP 5.3.6 on HP-UX 11.11 with following parameters : 



./configure --disable-cli --with-config-file-path=/path/to/etc/php
--with-sybase-ct=/path/to/sybase --with-imap=/path/to/imap
--with-imap-ssl=/usr --with-libxml-dir=/path/to/libxml2 --with-gd
--with-png-dir=/path/to/libpng --with-jpeg-dir=/path/to/jpeg
--with-freetype-dir=/path/to/freetype --with-ldap  --prefix=/path/to/php
--with-apxs=/path/to/apache/bin/apxs



When I start apache, I've the following error : 



/usr/lib/dld.sl: Unresolved symbol: strtoull (code)  from
/path/to/apache/libexec/libphp5.so



If I compile without the option "--disable-cli", the error appears at
compile time.



According to this page :
http://gcc.gnu.org/ml/libstdc++/2002-03/msg00164.html,

HP-UX does not provide strtoll or strtoull functions in libc in 64 bit
mode since they are the same as strtol and strtoul so we define the
libstdc++ functions to call strtol and strtoul.



I've resolved the situation with replacing all "strtoull" terms by
"strtoul" on the file ext/fileinfo/libmagic/apprentice.c







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54934&edit=1


Bug #54925 [Com]: build php on solaris for 64 bits

2011-05-26 Thread eugene at zhegan dot in
Edit report at http://bugs.php.net/bug.php?id=54925&edit=1

 ID: 54925
 Comment by: eugene at zhegan dot in
 Reported by:michel dot henaut at everyware dot ch
 Summary:build php on solaris for 64 bits
 Status: Open
 Type:   Bug
 Package:*General Issues
 Operating System:   solaris
 PHP Version:5.2.17
 Block user comment: N
 Private report: N

 New Comment:

Same here.

PHP 5.3.6.



# cc -V

cc: Sun C 5.10 SunOS_i386 2009/06/03



Same workaround does help (thanks, Michael, by the way).


Previous Comments:

[2011-05-25 14:31:09] michel dot henaut at everyware dot ch

Description:

Build php on solaris with Sun compiler:



The default build for 64 bits, i.e. CFLAGS='-m64' produces strange
results.

Rebuilding all with CFLAGS='-m64 -O -xs -xstrconst -zlazyload' seems to
work.



To reproduce it:



$obj[0]['data'][0]['Usr'] = 0.009035;

echo json_encode($obj);



with just CFLAGS='-m64'

[{"data":[{"Usr":INF}]}]



with CFLAGS='-m64 -O -xs -xstrconst -zlazyload'

[{"data":[{"Usr":0.009035}]}]

which is correct.



may be a problem in main/snprintf.c and in main/spprintf.c



regards 







Test script:
---
$obj[0]['data'][0]['Usr'] = 0.009035;

echo json_encode($obj);



Expected result:

[{"data":[{"Usr":0.009035}]}]

Actual result:
--
[{"data":[{"Usr":INF}]}]






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54925&edit=1