php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47029 quoted_printable_decode() produces duplicate warning
Submitted: 2009-01-07 17:04 UTC Modified: 2009-01-07 19:19 UTC
From: wharmby at uk dot ibm dot com Assigned:
Status: Closed Package: Strings related
PHP Version: 5.3CVS-2009-01-07 (snap) OS: Windows XP
Private report: No CVE-ID: None
 [2009-01-07 17:04 UTC] wharmby at uk dot ibm dot com
Description:
------------
Duplicate warning messages issued by quoted_printable_decode () when invalid input supplied:

Problem only on 5.3; PHP 5.2 and 6 code OK.

Fix is to remove the call to WRONG_PARAM_COUNT on line 206 of quot_print.c and replace with a "return" as in following patch.

### Eclipse Workspace Patch 1.0
#P php-5.3
Index: ext/standard/quot_print.c
===================================================================
RCS file: /repository/php-src/ext/standard/quot_print.c,v
retrieving revision 1.29.2.2.2.1.2.5
diff -u -r1.29.2.2.2.1.2.5 quot_print.c
--- ext/standard/quot_print.c	31 Dec 2008 11:15:45 -0000	1.29.2.2.2.1.2.5
+++ ext/standard/quot_print.c	7 Jan 2009 16:53:40 -0000
@@ -203,7 +203,7 @@
 	int arg1_len, i = 0, j = 0, k;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg1, &arg1_len) == FAILURE) {
-		WRONG_PARAM_COUNT;
+		return;
 	}
     
 	if (arg1_len == 0) {



Reproduce code:
---------------
<?php
	quoted_printable_decode("", true);
?>

Expected result:
----------------
Warning: quoted_printable_decode() expects exactly 1 parameter, 2 given in <script path> on line 3

Actual result:
--------------
Warning: quoted_printable_decode() expects exactly 1 parameter, 2 given in <script path> on line 3

Warning: Wrong parameter count for quoted_printable_decode() in <script path> on line 3

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-07 17:16 UTC] scottmac@php.net
Go ahead and fix this yourself if you have karma.
 [2009-01-07 17:22 UTC] felipe@php.net
This bug has been fixed in CVS.

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.


 [2009-01-07 19:19 UTC] wharmby at uk dot ibm dot com
Thanks guys. By the time I saw Scott's msg Felipe had applied the patch to 5.3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC