Changeset 725018
- Timestamp:
- 06/10/2013 06:10:09 PM (13 years ago)
- File:
-
- 1 edited
-
travel-search/tags/1.2.5/ajax/functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
travel-search/tags/1.2.5/ajax/functions.php
r723445 r725018 75 75 return readRemoteFile($url, $headersString, $data_url); 76 76 } 77 return array( 'content' => file_get_contents ( 77 /* otherwise, if file_get_contents is enabled => use it */ 78 return array( 'content' => @file_get_contents ( 78 79 $url, 79 80 false, … … 195 196 if( !function_exists('apache_request_headers') ) { 196 197 function apache_request_headers() { 197 $arh = array();198 $rx_http = '/\AHTTP_/';198 $arh = array(); 199 $rx_http = '/\AHTTP_/'; 199 200 foreach($_SERVER as $key => $val) { 200 if( preg_match($rx_http, $key)) {201 $arh_key = preg_replace($rx_http, '', $key);202 $rx_matches = array();201 if(preg_match($rx_http, $key)) { 202 $arh_key = preg_replace($rx_http, '', $key); 203 $rx_matches = array(); 203 204 // do some nasty string manipulations to restore the original letter case 204 205 // this should work in most cases 205 $rx_matches = explode('_', $arh_key); 206 if( count($rx_matches) > 0 and strlen($arh_key) > 2 ) { 207 foreach($rx_matches as $ak_key => $ak_val) $rx_matches[$ak_key] = ucfirst($ak_val); 208 $arh_key = implode('-', $rx_matches); 206 $rx_matches = explode('_', $arh_key); 207 if(count($rx_matches) > 0 and strlen($arh_key) > 2 ) { 208 foreach($rx_matches as $ak_key => $ak_val) 209 $rx_matches[$ak_key] = ucfirst(strtolower($ak_val)); 210 $arh_key = implode('-', $rx_matches); 209 211 } 210 $arh[$arh_key] = $val;212 $arh[$arh_key] = $val; 211 213 } 212 214 } 213 return( $arh);215 return($arh); 214 216 } 215 217 }
Note: See TracChangeset
for help on using the changeset viewer.