Not sure why = forbidden, but you can also leave equal signs.
$base_64 = base64_encode($data); $url_param = rtrim($base_64, '='); // and later: $base_64 = $url_param . str_repeat('=', strlen($url_param) % 4); $data = base64_decode($base_64);
The base64 specification allows only = characters at the end of a line, and they are used solely as an addition, there is no possibility of data loss.
Edit: Perhaps this does not mean that it is a compatibility option. There is no reason why I can think in terms of security, but there is a chance that it could ruin the query string, somewhere in the tool chain.
source share