Posted by Robin Vickery on 12/09/05 17:53
Ummmm.... I made a mistake in the second test for validity in the unpad function. It should be this: function pkcs5_unpad ($text) { $pad = ord($text{strlen($text)-1}); if ($pad > strlen($text)) return false; if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) return false; return substr($text, 0, -1 * $pad); }
[Reply to this message]
Copyright © 2005-2006 Powered by Custom PHP Programming