[dev] [commits] Horde branch master updated.

Michael M Slusarz slusarz at horde.org
Tue Jul 14 04:06:38 UTC 2009


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
---

michael

-- 
___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list