Ignore:
Timestamp:
Jun 9, 2022 7:24:04 PM (2 years ago)
Author:
anonymous
Message:

Minor improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Utilities.inc.php

    r765 r768  
    998998    }
    999999    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*/
     1011function base64_encode_url($string) {
     1012    return str_replace(['+','/','='], ['-','_',''], base64_encode($string));
     1013}
     1014function base64_decode_url($string) {
     1015    return base64_decode(str_replace(['-','_'], ['+','/'], $string));
    10001016}
    10011017
Note: See TracChangeset for help on using the changeset viewer.