فهرست منبع

! fixed a couple of mistakes from the db_last_error settings update

Signed-off-by: Spuds <[email protected]>
Spuds 12 سال پیش
والد
کامیت
fa68a68c5c
2فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 1 1
      Sources/Subs-Admin.php
  2. 2 2
      other/Settings.php

+ 1 - 1
Sources/Subs-Admin.php

@@ -386,7 +386,7 @@ function updateDbLastError($time)
 	global $boarddir; 
 	
 	// Write out the db_last_error file with the error timestamp 
-	file_put_contents($boarddir . '/db_last_error.php', "<?php\n$db_last_error = " . $time . ";\n?" . ">\n", LOCK_EX);
+	file_put_contents($boarddir . '/db_last_error.php', '<' . '?' . "php\n" . '$db_last_error = ' . $time . ';' . "\n" . '?' . '>', LOCK_EX);
 	@touch($boarddir . '/' . 'Settings.php');
 }
 /**

+ 2 - 2
other/Settings.php

@@ -156,13 +156,13 @@ $sourcedir = dirname(__FILE__) . '/Sources';
 
 ########## Error-Catching ##########
 # Note: You shouldn't touch these settings.
-if (file_exists(dirname(__FILE__) . '/db_last_error.php')); 
+if (file_exists(dirname(__FILE__) . '/db_last_error.php'))
 	include(dirname(__FILE__) . '/db_last_error.php'); 
 
 if (!isset($db_last_error))
 {
 	// File does not exist so lets try to create it
-	updateDbLastError(0); 
+	file_put_contents(dirname(__FILE__) . '/db_last_error.php', '<' . '?' . "php\n" . '$db_last_error = 0;' . "\n" . '?' . '>');
 	$db_last_error = 0; 
 }