Changeset 768 for trunk/lib/Utilities.inc.php
- Timestamp:
- Jun 9, 2022 7:24:04 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Utilities.inc.php
r765 r768 998 998 } 999 999 return $url_args; 1000 } 1001 1002 /* 1003 * Encode/decode a string that is safe for URLs. 1004 * 1005 * @access public 1006 * @param string $string Input string 1007 * @return string Encoded/decoded string. 1008 * @author Rasmus Schultz <https://www.php.net/manual/en/function.base64-encode.php#123098> 1009 * @since 09 Jun 2022 07:50:49 1010 */ 1011 function base64_encode_url($string) { 1012 return str_replace(['+','/','='], ['-','_',''], base64_encode($string)); 1013 } 1014 function base64_decode_url($string) { 1015 return base64_decode(str_replace(['-','_'], ['+','/'], $string)); 1000 1016 } 1001 1017
Note: See TracChangeset
for help on using the changeset viewer.