| 1 |
<?php |
| 2 |
|
| 3 |
namespace JchOptimize\WordPress; |
| 4 |
|
| 5 |
use function base64_decode; |
| 6 |
use function base64_encode; |
| 7 |
use function strtr; |
| 8 |
|
| 9 |
if (! function_exists('JchOptimize\WordPress\base64_encode_url')) { |
| 10 |
function base64_encode_url(string $string): string |
| 11 |
{ |
| 12 |
return strtr(base64_encode($string), '+/=', '._-'); |
| 13 |
} |
| 14 |
} |
| 15 |
|
| 16 |
if (! function_exists('JchOptimize\WordPress\base64_decode_url')) { |
| 17 |
function base64_decode_url(string $string): string |
| 18 |
{ |
| 19 |
return base64_decode(strtr($string, '._-', '+/=')); |
| 20 |
} |
| 21 |
} |
| 22 |
|