#47029 [Opn]: quoted_printable_decode() produces duplicate warning

From: Date: Wed, 07 Jan 2009 17:16:21 +0000
Subject: #47029 [Opn]: quoted_printable_decode() produces duplicate warning
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-132636@lists.php.net to get a copy of this message
 ID:               47029
 Updated by:       scottmac@php.net
 Reported By:      wharmby at uk dot ibm dot com
 Status:           Open
 Bug Type:         Scripting Engine problem
 Operating System: Windows XP
 PHP Version:      5.3CVS-2009-01-07 (snap)
 New Comment:

Go ahead and fix this yourself if you have karma.


Previous Comments:
------------------------------------------------------------------------

[2009-01-07 17:04:34] 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


------------------------------------------------------------------------


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



Thread (4 messages)

« previous php.bugs (#132636) next »