[dev] [commits] Horde branch master updated.
Jan Schneider
jan at horde.org
Tue Jul 14 09:51:10 UTC 2009
Zitat von Michael M Slusarz <slusarz at horde.org>:
> Quoting Jan Schneider <jan at horde.org>:
>
>> Zitat von Michael M Slusarz <slusarz at horde.org>:
>>
>>> commit 17ddc46a041053ad32f460cced1e5abf5a8225e6
>>> Author: Michael M Slusarz <slusarz at curecanti.org>
>>> Date: Wed Jul 1 16:57:35 2009 -0600
>>>
>>> Less resource intensive search for null character
>>>
>>> framework/Mime/lib/Horde/Mime/Part.php | 6 ++++--
>>> 1 files changed, 4 insertions(+), 2 deletions(-)
>>>
>>> http://git.horde.org/diff.php/framework/Mime/lib/Horde/Mime/Part.php?rt=horde-git&r1=0aecab94bc2087b6127d2988368748d40b68da92&r2=17ddc46a041053ad32f460cced1e5abf5a8225e6
>>
>> null has nothing to with NUL. In this context it's casted to ''.
>
> No it isn't.
>
> ---
>
> <?php
> $a = "1234";
> $b = "12" . "\0" . "34";
>
> print "A length: " . strlen($a) . "\n";
> print "B: " . strlen($b) . "\n";
>
> if (strpos($a, "\0") !== false) {
> print "A1\n";
> }
> if (strpos($b, "\0") !== false) {
> print "B1\n";
> }
>
> if (strpos($a, null) !== false) {
> print "A2\n";
> }
> if (strpos($b, null) !== false) {
> print "B2\n";
> }
>
> ---
>
> Output:
>
> ---
> A length: 4
> B length: 5
> B1
> B2
> ---
Uh, since when did this work? My apologies. For clarity, I'm still in
favor of using "\0" instead.
Jan.
--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digitale PGP-Unterschrift
URL: <http://lists.horde.org/archives/dev/attachments/20090714/b57a9758/attachment.bin>
More information about the dev
mailing list