Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45341 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42078 invoked from network); 24 Aug 2009 01:44:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2009 01:44:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=listas@rafaeldohms.com.br; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=listas@rafaeldohms.com.br; sender-id=unknown Received-SPF: error (pb1.pair.com: domain rafaeldohms.com.br from 209.85.217.219 cause and error) X-PHP-List-Original-Sender: listas@rafaeldohms.com.br X-Host-Fingerprint: 209.85.217.219 mail-gx0-f219.google.com Received: from [209.85.217.219] ([209.85.217.219:41224] helo=mail-gx0-f219.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/AC-03363-260F19A4 for ; Sun, 23 Aug 2009 21:44:03 -0400 Received: by gxk19 with SMTP id 19so3588247gxk.0 for ; Sun, 23 Aug 2009 18:44:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.130.41 with SMTP id c41mr6860613ybd.240.1251078240248; Sun, 23 Aug 2009 18:44:00 -0700 (PDT) Date: Sun, 23 Aug 2009 22:44:00 -0300 Message-ID: <33cd61490908231844i2872db24qae62d00a229f60f8@mail.gmail.com> To: PHP internals Content-Type: multipart/alternative; boundary=000e0cd58f3c18a3780471d95afe Subject: [PATCH] GD - imagecolorallocatealpha From: listas@rafaeldohms.com.br (Rafael Dohms) --000e0cd58f3c18a3780471d95afe Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit First time suggesting a patch, please correct me if i do something wrong. I was writing tests for imagecolorallocatealpha and noticed a change applied in 5.3 is not in head, that is the validation of the first parameter, delacred as 'r' in 5.3 and 'z' in HEAD (also in 5.2) This is not a absolute problem since there is a resource type validation right after looking for Image Resource. So i don't know how important this fix is, but i wrote the patch below and it worked according to my tests. I will also be commiting the tests in a few minutes. PATCH: Index: ext/gd/gd.c =================================================================== --- ext/gd/gd.c (revision 287587) +++ ext/gd/gd.c (working copy) @@ -1729,7 +1729,7 @@ gdImagePtr im; int ct = (-1); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zllll", &IM, &red, &green, &blue, &alpha) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) { RETURN_FALSE; } Cheers everyone! -- Rafael Dohms PHP Evangelist and Community Leader http://www.rafaeldohms.com.br http://www.phpsp.org.br --000e0cd58f3c18a3780471d95afe--