#50089 [Opn->Fbk]: quoted_printable_encode incorrect

2009-11-06 Thread jani
 ID:   50089
 Updated by:   j...@php.net
 Reported By:  susafon at seznam dot cz
-Status:   Open
+Status:   Feedback
-Bug Type: *Encryption and hash functions
+Bug Type: Strings related
 Operating System: Windows XP
 PHP Version:  5.3.0
 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2009-11-05 15:38:03] susafon at seznam dot cz

Proper location of the error is at the end of the string reported in
Actual result: "=o=20katal=C3=B3gu!?=". The first sign "=" of this
ending is not supposed to be there



[2009-11-05 15:13:36] susafon at seznam dot cz

Description:

The function quoted_printable_encode returns string incorrectly.
Input string is plain text. The function generate errors if the length
of the string is longer.

Reproduce code:
---
quoted_printable_encode($_POST['not_encoded'])

Expected result:

original string:
"Objavte novinky a vianočné tipy z nášho najnovšieho katalógu!"

returned string:
"=?utf-8?Q?Objavte=20novinky=20a=20viano=C4=8Dn=C3=A9=20tipy=20z=20n=C3=A1=C5=A1ho=20najnov=C5=A1ieho=20katal=C3=B3gu!?="

Actual result:
--
original string:
"Objavte novinky a vianočné tipy z nášho najnovšieho katalógu!"

returned string:
"=?utf-8?Q?Objavte=20novinky=20a=20viano=C4=8Dn=C3=A9=20tipy=20z=20n=C3=A1=C5=A1ho=20najnov=C5=A1ieh=o=20katal=C3=B3gu!?="
  ^
  |
sign "=" does not |
suppose be there 





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



#50098 [NEW]: preg_replace cause Apache error and retart.

2009-11-06 Thread zhongxueming at gmail dot com
From: zhongxueming at gmail dot com
Operating system: Windows XP, Windows Server 2003
PHP version:  5.2.11
PHP Bug Type: Scripting Engine problem
Bug description:  preg_replace cause Apache error and retart.

Description:

When I execute a sql by Zend DB, I got a connection error, 
and found an error in apache error log. 
After tracking, I found the problem is preg_replace function.
I think you can replay this problem by the test code.

Env:
 Windows XP, Windows Server 2003
 Apache 2.2.13
 PHP php-5.2.11

 

Reproduce code:
---
function testPregReplace() {
$sql = "SELECT \"t_skill_label\".\"c_name\" FROM \"t_skill_label\" WHERE
(\"c_name\" =
'‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨')
AND (\"c_id\" != '3') LIMIT 1";
echo preg_replace("/'(''|{2}|[^'])*'/", '', $sql);
}
testPregReplace();


Expected result:

Apache not be restarted.

Actual result:
--
This test code will cause apache error. 
You can confirm it in the apache error log.
The browser display a connection error.


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