Changeset 25615
- Timestamp:
- Nov 21, 2013, 12:22:42 PM (10 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r25550 r25615 833 833 834 834 /** 835 * returns $_SERVER['QUERY_STRING'] whithout keys given in parameters836 *837 * @param string[] $rejects838 * @param boolean $escape escape *&* to *&*839 * @returns string840 */841 function get_query_string_diff($rejects=array(), $escape=true)842 {843 if (empty($_SERVER['QUERY_STRING']))844 {845 return '';846 }847 848 parse_str($_SERVER['QUERY_STRING'], $vars);849 850 $vars = array_diff_key($vars, array_flip($rejects));851 852 return '?' . http_build_query($vars, '', $escape ? '&' : '&');853 }854 855 /**856 * returns true if the url is absolute (begins with http)857 *858 * @param string $url859 * @returns boolean860 */861 function url_is_remote($url)862 {863 if ( strncmp($url, 'http://', 7)==0864 or strncmp($url, 'https://', 8)==0 )865 {866 return true;867 }868 return false;869 }870 871 /**872 835 * returns available themes 873 836 * -
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.