Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33220 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16960 invoked by uid 1010); 17 Nov 2007 13:45:59 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 16945 invoked from network); 17 Nov 2007 13:45:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2007 13:45:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=sembee@ngweb.it; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sembee@ngweb.it; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ngweb.it from 85.33.2.26 cause and error) X-PHP-List-Original-Sender: sembee@ngweb.it X-Host-Fingerprint: 85.33.2.26 smtp-out26.alice.it Windows 2000 SP4, XP SP1 Received: from [85.33.2.26] ([85.33.2.26:3033] helo=smtp-out26.alice.it) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5C/98-51194-090FE374 for ; Sat, 17 Nov 2007 08:45:55 -0500 Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out26.alice.it with Microsoft SMTPSVC(6.0.3790.1830); Sat, 17 Nov 2007 14:45:21 +0100 Received: from FBCMCL01B06.fbc.local ([192.168.69.87]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Sat, 17 Nov 2007 14:45:21 +0100 Received: from [127.0.0.1] ([79.18.111.138]) by FBCMCL01B06.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Sat, 17 Nov 2007 14:45:21 +0100 Message-ID: <473EF05C.9070208@ngweb.it> Date: Sat, 17 Nov 2007 14:45:00 +0100 User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: multipart/mixed; boundary="------------020102080406080906000708" X-Antivirus: avast! (VPS 071116-0, 16/11/2007), Outbound message X-Antivirus-Status: Clean X-OriginalArrivalTime: 17 Nov 2007 13:45:21.0252 (UTC) FILETIME=[18D76240:01C82920] Subject: [PATCH] Bug #42866 str_split() returns extra char when given string size is not multiple of length From: sembee@ngweb.it (Claudio Cherubino) --------------020102080406080906000708 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Bug Description: ----------------- str_split() returns extra characters when given string is not multiple of given length. For example if the given string size is 22 and split length is 5, then the last element of the returned array contains 5 or more than 5 chars, which is wrong. The last element of the return array should only contain 2 chars. The bug only occurs on PHP6 with UNICODE ON. It can be fixed by changing only a single line of the code. Please give a look at the attached patch, I don't have CVS access to commit it. Thanks Claudio Cherubino --------------020102080406080906000708 Content-Type: text/plain; name="42866.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="42866.patch" SW5kZXg6IGV4dC9zdGFuZGFyZC9zdHJpbmcuYw0KPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KUkNTIGZpbGU6 IC9yZXBvc2l0b3J5L3BocC1zcmMvZXh0L3N0YW5kYXJkL3N0cmluZy5jLHYNCnJldHJpZXZp bmcgcmV2aXNpb24gMS42NTUNCmRpZmYgLXUgLXIxLjY1NSBzdHJpbmcuYw0KLS0tIGV4dC9z dGFuZGFyZC9zdHJpbmcuYwk3IE9jdCAyMDA3IDA1OjE1OjA2IC0wMDAwCTEuNjU1DQorKysg ZXh0L3N0YW5kYXJkL3N0cmluZy5jCTE1IE5vdiAyMDA3IDE3OjI5OjAwIC0wMDAwDQpAQCAt NzgwMiw3ICs3ODAyLDcgQEANCiAJfQ0KIA0KIAlpZiAocCAhPSAoc3RyLnMgKyBzdHJfbGVu ICogY2hhcnNpemUpKSB7DQotCQlhZGRfbmV4dF9pbmRleF96c3RybChyZXR1cm5fdmFsdWUs IHN0cl90eXBlLCBaU1RSKHApLCAoc3RyLnMgKw0Kc3RyX2xlbiAqIGNoYXJzaXplIC0gcCks IDEpOw0KKwkJYWRkX25leHRfaW5kZXhfenN0cmwocmV0dXJuX3ZhbHVlLCBzdHJfdHlwZSwg WlNUUihwKSwgKHN0ci5zICsNCnN0cl9sZW4gKiBjaGFyc2l6ZSAtIHApL2NoYXJzaXplLCAx KTsNCiAJfQ0KIH0NCiAvKiB9fX0gKi8= --------------020102080406080906000708--