note 71135 added to function.mcrypt-generic
| From: | tmacedoatlinuxdotimedotuspdotbr at osu1 dot php dot net | Date: | Mon, 13 Nov 2006 17:22:32 +0000 |
| Subject: | note 71135 added to function.mcrypt-generic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119677@lists.php.net to get a copy of this message | ||
completing the post from Ryan Thomas, ryanrst at gmail dot com, if u post a cookie w/ HTTP method,
its may be encoded;
As some chars in base64 will be encoded to another things, u can just replace them before encode and
after decode;
Its a tweak from dawgeatschikin at hotmail dot com to original idea from massimo dot scamarcia at
gmail dot com
(see @ http://www.php.net/manual/en/function.base64-encode.php):
<?php
function urlsafe_b64encode($string)
{
$data = base64_encode($string);
$data =
str_replace(array('+','/','='),array('-','_','.'),$data);
return $data;
}
function urlsafe_b64decode($string)
{
$data =
str_replace(array('-','_','.'),array('+','/','='),$string);
$mod4 = strlen($data) % 4;
if ($mod4) {
$data .= substr('====', $mod4);
}
return base64_decode($data);
}
?>
----
Server IP: 66.163.161.117
Probable Submitter: 201.43.150.61
----
Manual Page -- http://www.php.net/manual/en/function.mcrypt-generic.php
Edit -- https://master.php.net/note/edit/71135
Del: integrated -- https://master.php.net/note/delete/71135/integrated
Del: useless -- https://master.php.net/note/delete/71135/useless
Del: bad code -- https://master.php.net/note/delete/71135/bad+code
Del: spam -- https://master.php.net/note/delete/71135/spam
Del: non-english -- https://master.php.net/note/delete/71135/non-english
Del: in docs -- https://master.php.net/note/delete/71135/in+docs
Del: other reasons-- https://master.php.net/note/delete/71135
Reject -- https://master.php.net/note/reject/71135
Search -- https://master.php.net/manage/user-notes.php