From b923520bbf30b8ed86a35901745936340b1a41c5 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Thu, 22 Oct 2009 13:00:37 +0000 Subject: [PATCH] Fix for multiple 0.7 -> 0.8 upgrade issues. --- e107_handlers/arraystorage_class.php | 17 +++++++++++++---- e107_handlers/db_debug_class.php | 10 ++++------ e107_handlers/e_parse_class.php | 27 +++++++++++++++++---------- e107_handlers/login.php | 10 ++++++---- e107_handlers/mysql_class.php | 15 +++++++++------ e107_handlers/notify_class.php | 15 +++++++++------ e107_plugins/linkwords/e_tohtml.php | 10 +++++----- e107_plugins/linkwords/linkwords.php | 10 +++++----- 8 files changed, 68 insertions(+), 46 deletions(-) diff --git a/e107_handlers/arraystorage_class.php b/e107_handlers/arraystorage_class.php index bb63419cb..286ca1186 100644 --- a/e107_handlers/arraystorage_class.php +++ b/e107_handlers/arraystorage_class.php @@ -4,7 +4,7 @@ + ----------------------------------------------------------------------------+ | e107 website system | -| ©Steve Dunstan 2001-2002 +| �Steve Dunstan 2001-2002 | http://e107.org | jalist@e107.org | @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/arraystorage_class.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:33:42 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2009-10-22 13:00:09 $ +| $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -54,6 +54,15 @@ class ArrayData { if ($ArrayData == ""){ return false; } + + // Saftety mechanism for 0.7 -> 0.8 transition. + if(substr($ArrayData,0,2)=='a:' || substr($ArrayData,0,2)=='s:') + { + $dat = unserialize($ArrayData); + $ArrayData = $this->WriteArray($dat,FALSE); + } + + $data = ""; $ArrayData = '$data = '.trim($ArrayData).';'; @eval($ArrayData); diff --git a/e107_handlers/db_debug_class.php b/e107_handlers/db_debug_class.php index e56d55c30..e9b53db32 100644 --- a/e107_handlers/db_debug_class.php +++ b/e107_handlers/db_debug_class.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/db_debug_class.php,v $ -| $Revision: 1.15 $ -| $Date: 2009-10-22 04:14:35 $ +| $Revision: 1.16 $ +| $Date: 2009-10-22 13:00:10 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -598,7 +598,7 @@ class e107_db_debug { // function e107_debug_shutdown() { -global $error_handler,$e107_Clean_Exit,$In_e107_Footer,$ADMIN_DIRECTORY,$THEME_DIRECTORY; +global $error_handler,$e107_Clean_Exit,$In_e107_Footer,$ADMIN_DIRECTORY; if (isset($e107_Clean_Exit)) return; if (!isset($In_e107_Footer)) @@ -609,9 +609,7 @@ global $error_handler,$e107_Clean_Exit,$In_e107_Footer,$ADMIN_DIRECTORY,$THEME_D require_once($filewanted); } else if (defset('USER_AREA')) { - $filewanted=realpath(dirname(__FILE__)."/../".$THEME_DIRECTORY.'templates/')."/footer_default.php"; // FOOTERF; - // Works better than FOOTERF for e107_files/e_jslib.php. - + $filewanted=realpath(dirname(__FILE__)).'/../'.FOOTERF; require_once($filewanted); } } diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 8b8f989ad..2966c92f0 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -9,9 +9,9 @@ * Text processing and parsing functions * * $Source: /cvs_backup/e107_0.8/e107_handlers/e_parse_class.php,v $ -* $Revision: 1.66 $ -* $Date: 2009-10-20 14:47:05 $ -* $Author: secretr $ +* $Revision: 1.67 $ +* $Date: 2009-10-22 13:00:10 $ +* $Author: e107coders $ * */ if (!defined('e107_INIT')) { exit; } @@ -776,7 +776,7 @@ class e_parse return constant(trim($text)); } - + if ($opts['no_tags']) { @@ -1046,9 +1046,13 @@ class e_parse { if (!is_object($this->e_hook[$hook])) { - require_once(e_PLUGIN.$hook."/".$hook.".php"); - $hook_class = "e_".$hook; - $this->e_hook[$hook] = new $hook_class; + if(is_readable(e_PLUGIN.$hook."/".$hook.".php")) + { + require_once(e_PLUGIN.$hook."/".$hook.".php"); + $hook_class = "e_".$hook; + $this->e_hook[$hook] = new $hook_class; + } + } $sub_blk = $this->e_hook[$hook]->$hook($sub_blk,$opts['context']); } @@ -1060,9 +1064,12 @@ class e_parse { if (!is_object($this->e_hook[$hook])) { - require_once(e_PLUGIN.$hook."/e_tohtml.php"); - $hook_class = "e_tohtml_".$hook; - $this->e_hook[$hook] = new $hook_class; + if(is_readable(e_PLUGIN.$hook."/e_tohtml.php")) + { + require_once(e_PLUGIN.$hook."/e_tohtml.php"); + $hook_class = "e_tohtml_".$hook; + $this->e_hook[$hook] = new $hook_class; + } } $sub_blk = $this->e_hook[$hook]->to_html($sub_blk, $opts['context']); } diff --git a/e107_handlers/login.php b/e107_handlers/login.php index 914374db2..e04ec85bd 100644 --- a/e107_handlers/login.php +++ b/e107_handlers/login.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $ -| $Revision: 1.25 $ -| $Date: 2009-07-25 21:18:09 $ -| $Author: e107steved $ +| $Revision: 1.26 $ +| $Date: 2009-10-22 13:00:11 $ +| $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -122,6 +122,8 @@ class userlogin } + + $qry[0] = "`user_loginname`= '".$tp -> toDB($username)."'"; // username only (default) $qry[1] = "`user_email` = '".$tp -> toDB($username)."'"; // email only $qry[2] = (strpos($username,'@') !== FALSE ) ? "`user_loginname`= '".$tp -> toDB($username)."' OR `user_email` = '".$tp -> toDB($username)."'" : $qry[0]; //username or email @@ -133,7 +135,7 @@ class userlogin { // Invalid user return $this->invalidLogin($username,LOGIN_BAD_USER,$fip); } - + // User is in DB here $lode = $sql -> db_Fetch(MYSQL_ASSOC); // Get user info $lode['user_perms'] = trim($lode['user_perms']); diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index 7cd67a081..879646cc0 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -9,9 +9,9 @@ * mySQL Handler * * $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $ - * $Revision: 1.58 $ - * $Date: 2009-10-21 09:12:12 $ - * $Author: secretr $ + * $Revision: 1.59 $ + * $Date: 2009-10-22 13:00:11 $ + * $Author: e107coders $ */ if(defined('MYSQL_LIGHT')) @@ -49,8 +49,8 @@ $db_ConnectionID = NULL; // Stores ID for the first DB connection used - which s * * @package e107 * @category e107_handlers - * @version $Revision: 1.58 $ - * @author $Author: secretr $ + * @version $Revision: 1.59 $ + * @author $Author: e107coders $ * */ class e_db_mysql { @@ -310,6 +310,7 @@ class e_db_mysql { global $db_mySQLQueryCount; $table = $this->db_IsLang($table); + $this->mySQLcurTable = $table; if ($arg != '' && $mode == 'default') { @@ -915,7 +916,9 @@ class e_db_mysql { { global $pref; - if ((!$this->mySQLlanguage || !$pref['multilanguage']) && $multiple==FALSE) + //When running a multi-language site with english included. English must be the main site language. + + if ((!$this->mySQLlanguage || !$pref['multilanguage'] || $this->mySQLlanguage=='English') && $multiple==FALSE) { return $table; } diff --git a/e107_handlers/notify_class.php b/e107_handlers/notify_class.php index c0900882d..4f8e897c5 100644 --- a/e107_handlers/notify_class.php +++ b/e107_handlers/notify_class.php @@ -9,9 +9,9 @@ * Forum plugin notify configuration * * $Source: /cvs_backup/e107_0.8/e107_handlers/notify_class.php,v $ -* $Revision: 1.6 $ -* $Date: 2009-08-11 17:25:48 $ -* $Author: marj_nl_fr $ +* $Revision: 1.7 $ +* $Date: 2009-10-22 13:00:11 $ +* $Author: e107coders $ * */ @@ -26,11 +26,14 @@ class notify global $sysprefs, $e_event, $eArrayStorage; $this->notify_prefs = $sysprefs->get('notify_prefs'); $this->notify_prefs = $eArrayStorage->ReadArray($this->notify_prefs); - foreach ($this->notify_prefs['event'] as $id => $status) + if(varset($this->notify_prefs['event'])) { - if ($status['class'] != 255) + foreach ($this->notify_prefs['event'] as $id => $status) { - $e_event->register($id, 'notify_'.$id); + if ($status['class'] != 255) + { + $e_event->register($id, 'notify_'.$id); + } } } diff --git a/e107_plugins/linkwords/e_tohtml.php b/e107_plugins/linkwords/e_tohtml.php index 712f76fe2..7876a704f 100755 --- a/e107_plugins/linkwords/e_tohtml.php +++ b/e107_plugins/linkwords/e_tohtml.php @@ -3,7 +3,7 @@ + ----------------------------------------------------------------------------+ | e107 website system | -| ©Steve Dunstan 2001-2002 +| �Steve Dunstan 2001-2002 | http://e107.org | jalist@e107.org | @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/linkwords/e_tohtml.php,v $ -| $Revision: 1.6 $ -| $Date: 2009-07-19 11:44:28 $ -| $Author: marj_nl_fr $ +| $Revision: 1.7 $ +| $Date: 2009-10-22 13:00:37 $ +| $Author: e107coders $ | | *utf - flags functions which need utf-8-aware code TODO: @@ -25,7 +25,7 @@ TODO: */ if (!defined('e107_INIT')) { exit; } -if (!plugInstalled('linkwords')) exit; +// if (!plugInstalled('linkwords')) exit; // This will completely break a site during upgrades. define('LW_CACHE_ENABLE', TRUE); define('LW_CACHE_TAG', 'nomd5_linkwords'); diff --git a/e107_plugins/linkwords/linkwords.php b/e107_plugins/linkwords/linkwords.php index 3f8907899..4b6271438 100644 --- a/e107_plugins/linkwords/linkwords.php +++ b/e107_plugins/linkwords/linkwords.php @@ -3,7 +3,7 @@ + ----------------------------------------------------------------------------+ | e107 website system | -| ©Steve Dunstan 2001-2002 +| �Steve Dunstan 2001-2002 | http://e107.org | jalist@e107.org | @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/linkwords/linkwords.php,v $ -| $Revision: 1.11 $ -| $Date: 2009-08-15 11:55:30 $ -| $Author: marj_nl_fr $ +| $Revision: 1.12 $ +| $Date: 2009-10-22 13:00:37 $ +| $Author: e107coders $ | | This is just a stub so that systems migrated from 0.7 don't crash | It auto-updates the prefs so that the newer routine is called in future. @@ -22,7 +22,7 @@ */ if (!defined('e107_INIT')) { exit; } -if (!plugInstalled('linkwords')) exit; +// if (!plugInstalled('linkwords')) exit; // This will break a site completely under some circumstance. class e_linkwords