XPressME Integration Kit

Trac


Ignore:
Timestamp:
Aug 23, 2010, 10:01:59 AM (14 years ago)
Author:
toemon
Message:

ナビアイコン設定時、ソースが有効であるかチェックする Fixes#361

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php

    r638 r639  
    483483        return ( strlen($str) - $start <= $length ) ? substr( $str, $start, $length ) : substr( $str, $start, $length - strlen($trimmarker) ) . $trimmarker; 
    484484    } 
    485 } 
    486  
    487 function icon_exists($str = '') 
    488 { 
    489         global $xpress_config; 
    490         $root_path = $_SERVER['DOCUMENT_ROOT']; 
    491         $root_pattern = str_replace(".","\.",$root_path); 
    492         $root_pattern = '/'. str_replace("/","\/",$root_pattern) . '/'; 
    493         $host = str_replace(".","\.",$_SERVER['SERVER_NAME']); 
    494         $pattern = "/https?:\/\/{$host}/"; 
    495         if (preg_match($pattern,$str)){ 
    496                 $str = preg_replace($pattern,$root_path,$str); 
    497         } else if (!preg_match($root_pattern,$str)){ 
    498                 $str = $root_path.$str; 
    499         } 
    500         return file_exists($str); 
    501485} 
    502486 
Note: See TracChangeset for help on using the changeset viewer.