Changeset 25615 for trunk/include/functions_url.inc.php
- Timestamp:
- Nov 21, 2013, 12:22:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_url.inc.php
r25018 r25615 795 795 } 796 796 } 797 798 /** 799 * returns $_SERVER['QUERY_STRING'] whithout keys given in parameters 800 * 801 * @param string[] $rejects 802 * @param boolean $escape escape *&* to *&* 803 * @returns string 804 */ 805 function get_query_string_diff($rejects=array(), $escape=true) 806 { 807 if (empty($_SERVER['QUERY_STRING'])) 808 { 809 return ''; 810 } 811 812 parse_str($_SERVER['QUERY_STRING'], $vars); 813 814 $vars = array_diff_key($vars, array_flip($rejects)); 815 816 return '?' . http_build_query($vars, '', $escape ? '&' : '&'); 817 } 818 819 /** 820 * returns true if the url is absolute (begins with http) 821 * 822 * @param string $url 823 * @returns boolean 824 */ 825 function url_is_remote($url) 826 { 827 if ( strncmp($url, 'http://', 7)==0 828 or strncmp($url, 'https://', 8)==0 ) 829 { 830 return true; 831 } 832 return false; 833 } 834 797 835 ?>
Note: See TracChangeset
for help on using the changeset viewer.