Changeset 639 for trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php
- Timestamp:
- Aug 23, 2010, 10:01:59 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php
r583 r639 417 417 } 418 418 419 function icon_exists($str = '') 420 { 421 global $xpress_config; 422 if (empty($str)) return false; 423 $root_path = $_SERVER['DOCUMENT_ROOT']; 424 $root_pattern = str_replace(".","\.",$root_path); 425 $root_pattern = '/'. str_replace("/","\/",$root_pattern) . '/'; 426 $host = str_replace(".","\.",$_SERVER['SERVER_NAME']); 427 $pattern = "/https?:\/\/{$host}/"; 428 if (preg_match($pattern,$str)){ 429 $str = preg_replace($pattern,$root_path,$str); 430 } else if (!preg_match($root_pattern,$str)){ 431 $str = $root_path.$str; 432 } 433 return file_exists($str); 434 } 419 435 ?>
Note: See TracChangeset
for help on using the changeset viewer.