Ignore:
Timestamp:
2007/03/31 21:59:45 (17 years ago)
Author:
nanasess
Message:

header("Location: 〜") で相対パスが使用されていたのを絶対パスに変更.
data/lib/slib.php に sfGetCurrentUri(boolean) と sfGetCurrentSchema() を追加

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu/data/lib/slib.php

    r11984 r12039  
    261261    if(!defined('ECCUBE_INSTALL')) { 
    262262        if(!ereg("/install/", $_SERVER['PHP_SELF'])) { 
    263             header("Location: ./install/"); 
     263            header("Location: " . sfGetCurrentUri() . "/install/"); 
    264264        } 
    265265    } else { 
     
    29172917} 
    29182918 
     2919/** 
     2920 * ¸½ºß¤Î URI ¤ò¼èÆÀ¤¹¤ë. 
     2921 *  
     2922 * <p> 
     2923 * $_SERVER["SERVER_PORT"] ¤¬ 443 ¤Î¾ì¹ç¤Ï, ¥¹¥­¡¼¥Þ¤Ë https:// ¤ò»ÈÍÑ. 
     2924 * ¤½¤ì°Ê³°¤Ï http:// ¤ò»ÈÍѤ¹¤ë. 
     2925 * <strong>URI ËöÈø¤Î / ¤Ïºï½ü¤µ¤ì¤Þ¤¹.</strong> 
     2926 * </p> 
     2927 * @param boolean $hasFileName ¥Õ¥¡¥¤¥ë̾¤ò´Þ¤á¤ë¾ì¹ç true 
     2928 * @return string ¸½ºß¤Î URI 
     2929 */ 
     2930function sfGetCurrentUri($hasFileName = false) { 
     2931    $host = $_SERVER["HTTP_HOST"]; 
     2932    $path = rtrim(dirname($_SERVER["SCRIPT_NAME"]), "/\\"); 
     2933     
     2934    if ($hasFileName === true) { 
     2935        return sfGetCurrentSchema() . $host . $_SERVER["SCRIPT_NAME"]; 
     2936    } else { 
     2937        return sfGetCurrentSchema() . $host . $path; 
     2938    } 
     2939} 
     2940 
     2941/** 
     2942 * ¸½ºß¤Î ¥¹¥­¡¼¥Þ̾¤òÊÖ¤¹. 
     2943 *  
     2944 * <p> 
     2945 * $_SERVER["SERVER_PORT"] ¤¬ 443 ¤Î¾ì¹ç¤Ï, https:// ¤òÊÖ¤¹. 
     2946 * ¤½¤ì°Ê³°¤Ï http:// ¤òÊÖ¤¹. 
     2947 * </p> 
     2948 * @return string http:// ¤Þ¤¿¤Ï https:// ¤Î string. 
     2949 */ 
     2950function sfGetCurrentSchema() { 
     2951     
     2952    if ($_SERVER["SERVER_PORT"] == 443) { 
     2953        return "https://"; 
     2954    } else { 
     2955        return "http://"; 
     2956    } 
     2957} 
     2958 
    29192959/* ¥Ç¥Ð¥Ã¥°ÍÑ ------------------------------------------------------------------------------------------------*/ 
    29202960function sfPrintR($obj) { 
Note: See TracChangeset for help on using the changeset viewer.