OSDN Git Service

Bug fix fixed thanks to xforce.iss.net ^_^
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Sat, 9 May 2009 02:37:16 +0000 (02:37 +0000)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Sat, 9 May 2009 02:37:16 +0000 (02:37 +0000)
http://xforce.iss.net/xforce/xfdb/49697

git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@251 2b68903e-0b30-0410-9a39-a2e4f3c5be39

inc/misc/functions.php
inc/profilemain.php
inc/versioninfo.php
mysql.php

index ce7ff2f..f584d82 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/
     Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/
 
-    $FileInfo: functions.php - Last Update: 12/10/2008 SVN 209 - Author: cooldude2k $
+    $FileInfo: functions.php - Last Update: 5/08/2009 SVN 251 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="functions.php"||$File3Name=="/functions.php") {
@@ -131,6 +131,28 @@ $varname = preg_replace("/(HTTP_SERVER_VARS|HTTP_ENV_VARS)/i", null, $varname);
 $varname = preg_replace("/(HTTP_COOKIE_VARS|HTTP_SESSION_VARS)/i", null, $varname);
 $varname = preg_replace("/(HTTP_GET_VARS|HTTP_POST_VARS|HTTP_POST_FILES)/i", null, $varname);
        return $varname; }
+// Trying to fix this bug. ^_^
+// http://xforce.iss.net/xforce/xfdb/49697
+if(!isset($Settings['DefaultTheme'])) {
+       $Settings['DefaultTheme'] = "iDB"; }
+$BoardTheme = $Settings['DefaultTheme'];
+function chack_themes($theme) {
+global $BoardTheme;
+if(!isset($theme)) { $theme = null; }
+require('settings.php');
+$ckskindir = dirname(realpath("settings.php"))."/".$SettDir['themes'];
+if ($handle = opendir($ckskindir)) { $dirnum = null;
+   while (false !== ($ckfile = readdir($handle))) {
+          if ($dirnum==null) { $dirnum = 0; }
+          if (file_exists($ckskindir.$ckfile."/info.php")) {
+                  if ($ckfile != "." && $ckfile != "..") {
+          include($ckskindir.$ckfile."/info.php");
+       $cktheme[$dirnum] =  $ckfile;
+          ++$dirnum; } } }
+   closedir($handle); asort($cktheme); }
+$theme=preg_replace("/(.*?)\.\/(.*?)/", $BoardTheme, $theme);
+if(!in_array($theme,$cktheme)||strlen($theme)>26) {
+       $theme = $BoardTheme; } return $theme; }
 // Change the text to icons(smileys)
 function text2icons($Text,$sqlt) {
 global $Settings;
index 9434cf9..db38421 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2009 Cool Dude 2k - http://idb.berlios.de/
     Copyright 2004-2009 Game Maker 2k - http://intdb.sourceforge.net/
 
-    $FileInfo: profilemain.php - Last Update: 2/22/2008 SVN 232 - Author: cooldude2k $
+    $FileInfo: profilemain.php - Last Update: 5/08/2009 SVN 251 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="profilemain.php"||$File3Name=="/profilemain.php") {
@@ -518,7 +518,7 @@ if($_POST['act']=="settings"&&
        if(!is_numeric($_POST['RepliesPerPage'])) { $_POST['RepliesPerPage'] = "10"; }
        if(!is_numeric($_POST['TopicsPerPage'])) { $_POST['TopicsPerPage'] = "10"; }
        if(!is_numeric($_POST['MessagesPerPage'])) { $_POST['MessagesPerPage'] = "10"; }
-       $querynewskin = query("UPDATE `".$Settings['sqltable']."members` SET `UseTheme`='%s',`TimeZone`='%s',`DST`='%s',`LastActive`=%i,RepliesPerPage=%i,TopicsPerPage=%i,MessagesPerPage=%i,`IP`='%s' WHERE `id`=%i", array($_POST['skin'],$_POST['YourOffSet'],$_POST['DST'],$NewDay,$_POST['RepliesPerPage'],$_POST['TopicsPerPage'],$_POST['MessagesPerPage'],$NewIP,$_SESSION['UserID']));
+       $querynewskin = query("UPDATE `".$Settings['sqltable']."members` SET `UseTheme`='%s',`TimeZone`='%s',`DST`='%s',`LastActive`=%i,RepliesPerPage=%i,TopicsPerPage=%i,MessagesPerPage=%i,`IP`='%s' WHERE `id`=%i", array(chack_themes($_POST['skin']),$_POST['YourOffSet'],$_POST['DST'],$NewDay,$_POST['RepliesPerPage'],$_POST['TopicsPerPage'],$_POST['MessagesPerPage'],$NewIP,$_SESSION['UserID']));
        mysql_query($querynewskin); } } }
 if($_GET['act']=="profile") {
 if($_POST['update']!="now") {
index 7cc1b88..455f09a 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2009 Cool Dude 2k - http://idb.berlios.de/
     Copyright 2004-2009 Game Maker 2k - http://intdb.sourceforge.net/
 
-    $FileInfo: versioninfo.php - Last Update: 5/06/2009 SVN 250 - Author: cooldude2k $
+    $FileInfo: versioninfo.php - Last Update: 5/08/2009 SVN 251 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") {
@@ -27,8 +27,8 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
        return $return_var; }
 // Version number and date stuff. :P
 $VER1[0] = 0; $VER1[1] = 2; $VER1[2] = 7; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 250; $RName = "iDB"; $SFName = "IntDB";
-$SVNDay[0] = 5; $SVNDay[1] = 06; $SVNDay[2] = 2009; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
+$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 251; $RName = "iDB"; $SFName = "IntDB";
+$SVNDay[0] = 5; $SVNDay[1] = 08; $SVNDay[2] = 2009; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
 $VerInfo['iDB_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,false);
 $VerInfo['iDB_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,true);
 $VerInfo['iDB_Full_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[0],$SubVerN,false);
index e0e9a74..7f12a8f 100644 (file)
--- a/mysql.php
+++ b/mysql.php
@@ -11,7 +11,7 @@
     Copyright 2004-2009 Cool Dude 2k - http://idb.berlios.de/
     Copyright 2004-2009 Game Maker 2k - http://intdb.sourceforge.net/
 
-    $FileInfo: mysql.php - Last Update: 5/01/2009 SVN 247 - Author: cooldude2k $
+    $FileInfo: mysql.php - Last Update: 5/08/2009 SVN 251 - Author: cooldude2k $
 */
 //@ini_set("display_errors", true); 
 //@ini_set("display_startup_errors", true);
@@ -270,7 +270,7 @@ if($_GET['theme']==null) {
        if($_GET['css']!=null) {
                $_GET['theme'] = $_GET['css']; } }
 if($_GET['theme']!=null) {
-$_GET['theme']=preg_replace("/(.*?)\.\/(.*?)/", "iDB", $_GET['theme']);
+$_GET['theme'] = chack_themes($_GET['theme']);
 if($_GET['theme']=="../"||$_GET['theme']=="./") {
 $_GET['theme']="iDB"; $_SESSION['Theme']="iDB"; }
 if (file_exists($SettDir['themes'].$_GET['theme']."/settings.php")) {