ソースを参照

include 使用__DIR__绝对路径

visuddhinanda 4 年 前
コミット
be94552955
4 ファイル変更7 行追加7 行削除
  1. 2 2
      app/pcdl/head_bar.php
  2. 3 3
      app/pcdl/html_head.php
  3. 1 1
      app/public/config.php
  4. 1 1
      app/public/load_lang_js.php

+ 2 - 2
app/pcdl/head_bar.php

@@ -513,8 +513,8 @@
 				</svg>
 			</a>
 		</button>
-		<?php include "../ucenter/user.php"; ?>
-		<?php include "../lang/lang.php"; ?>
+		<?php include __DIR__."/../ucenter/user.php"; ?>
+		<?php include __DIR__."/../lang/lang.php"; ?>
 	</div>
 
 	<label for="nav-toggle" class="nav-toggle-label">

+ 3 - 3
app/pcdl/html_head.php

@@ -1,6 +1,6 @@
 <?php
-require_once '../config.php';
-require_once '../public/load_lang.php';
+require_once __DIR__.'/../config.php';
+require_once __DIR__.'/../public/load_lang.php';
 
 if (isset($_GET["language"])) {
 	$currLanguage = $_GET["language"];
@@ -134,7 +134,7 @@ if (isset($_GET["language"])) {
 	<script src="../public/charcode/converter_tai_tham.js"></script>
 	<script src="../public/charcode/converter_thai.js"></script>
 	<script>
-		<?php require_once '../public/load_lang_js.php'; ?>
+		<?php require_once __DIR__.'/../public/load_lang_js.php'; ?>
 	</script>
 
 	<script src="../../node_modules/diff/dist/diff.js"></script>

+ 1 - 1
app/public/config.php

@@ -12,7 +12,7 @@ $dir_dict_system="../../appdata/dict/system/";
 $dir_dict_3rd="../../appdata/dict/3rd/";
 $dir_dict_term="../../appdata/dict/dhammaterm/";
 $dir_language = "language/";
-$_dir_lang="../public/lang/";
+$_dir_lang=__DIR__."/../public/lang/";
 $_dir_book_index="../public/book_index/";
 $dir_palicanon="../../appdata/palicanon/";
 $dir_palitext="../../appdata/palicanon/pali_text/";

+ 1 - 1
app/public/load_lang_js.php

@@ -1,5 +1,5 @@
 	<?php
-	require_once '../public/config.php';
+	require_once __DIR__.'/../public/config.php';
 	/*
 	加载js 语言包
 	范例