diff --git a/contact.php b/contact.php
index 6c5687d2f..66a2ef3a8 100644
--- a/contact.php
+++ b/contact.php
@@ -25,8 +25,10 @@ require_once(e_HANDLER."secure_img_handler.php");
$sec_img = new secure_image;
e107::lan('core','contact');
-
-define('PAGE_NAME', LANCONTACT_00);
+if(!defined('PAGE_NAME'))
+{
+ define('PAGE_NAME', LANCONTACT_00); // FIX ME
+}
e107::canonical('contact');
require_once(HEADERF);
@@ -292,5 +294,4 @@ elseif($active == e_UC_MEMBER && ($pref['sitecontacts'] != e_UC_NOBODY))
require_once(FOOTERF);
-exit;
-?>
+
diff --git a/e107_admin/header.php b/e107_admin/header.php
index 9ee136db6..83a88eacc 100644
--- a/e107_admin/header.php
+++ b/e107_admin/header.php
@@ -575,7 +575,10 @@ function getAlert()
// Header included notification, from this point header includes are not possible
-define('HEADER_INIT', TRUE);
+if(!defined('HEADER_INIT'))
+{
+ define('HEADER_INIT', TRUE);
+}
e107::getDebug()->logTime("End Head, Start Body");
diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php
index 4967e9e49..d4ebb5abe 100644
--- a/e107_core/shortcodes/batch/admin_shortcodes.php
+++ b/e107_core/shortcodes/batch/admin_shortcodes.php
@@ -13,7 +13,7 @@
if (!defined('e107_INIT')) { exit; }
-class admin_shortcodes
+class admin_shortcodes extends e_shortcode
{
const ADMIN_NAV_HOME = 'enav_home'; // Must match with admin_template. ie. {ADMIN_NAVIGATION=enav_home} and $E_ADMIN_NAVIGATION['button_enav_home']
diff --git a/e107_core/shortcodes/batch/login_shortcodes.php b/e107_core/shortcodes/batch/login_shortcodes.php
index 3d88f0835..f1959c0eb 100644
--- a/e107_core/shortcodes/batch/login_shortcodes.php
+++ b/e107_core/shortcodes/batch/login_shortcodes.php
@@ -40,7 +40,7 @@ class login_shortcodes extends e_shortcode
return null;
}
- return LOGINMESSAGE;
+ return defset('LOGINMESSAGE');
}
/* example: {LOGIN_TABLE_USERNAME} */
diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php
index 20f8b46c4..3193be338 100644
--- a/e107_core/shortcodes/batch/news_shortcodes.php
+++ b/e107_core/shortcodes/batch/news_shortcodes.php
@@ -952,9 +952,9 @@ class news_shortcodes extends e_shortcode
function sc_news_video($parm=null)
{
$tmp = $this->handleMultiple($parm,'video');
- $file = $tmp['file'];
+ $file = varset($tmp['file']);
- if($video = e107::getParser()->toVideo($file, array('class'=> 'news-video-'.$tmp['count'])))
+ if($video = e107::getParser()->toVideo($file, array('class'=> 'news-video-'.varset($tmp['count']))))
{
return $video;
}
diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php
index 6f616f0ac..5dc0fb897 100644
--- a/e107_core/templates/header_default.php
+++ b/e107_core/templates/header_default.php
@@ -16,7 +16,10 @@ if(!defined('USER_AREA'))
//overload is now possible, prevent warnings
define('USER_AREA',TRUE);
}
-define('ADMIN_AREA', FALSE);
+if(!defined('ADMIN_AREA'))
+{
+ define('ADMIN_AREA', false);
+}
$e107 = e107::getInstance();
$sql = e107::getDb();
@@ -730,7 +733,10 @@ if(deftrue('BOOTSTRAP'))
// Header included notification, from this point header includes are not possible
-define('HEADER_INIT', TRUE);
+if(!defined('HEADER_INIT'))
+{
+ define('HEADER_INIT', TRUE);
+}
e107::getDebug()->logTime("Main Page Body");
diff --git a/e107_handlers/cron_class.php b/e107_handlers/cron_class.php
index 547c9f5d0..46708c84c 100644
--- a/e107_handlers/cron_class.php
+++ b/e107_handlers/cron_class.php
@@ -967,11 +967,11 @@ class cronScheduler
*/
public function __construct()
{
- global $_E107, $pref;
+ global $_E107;
$this->cron = new CronParser();
$this->debug = $_E107['debug'];
- $this->pref = $pref;
+ $this->pref = e107::getPref();
}
/**
@@ -1157,7 +1157,7 @@ class cronScheduler
$pwd = str_replace('token=', '', $pwd);
}
- if(($this->pref['e_cron_pwd'] != $pwd) || empty($this->pref['e_cron_pwd']))
+ if(empty($this->pref['e_cron_pwd']) || (varset($this->pref['e_cron_pwd']) != $pwd))
{
if(!empty($pwd))
{
@@ -1165,7 +1165,7 @@ class cronScheduler
$msg .= "
";
$msg .= "Sent from cron: " . $pwd;
$msg .= "
";
- $msg .= "Stored in e107: " . $this->pref['e_cron_pwd'];
+ $msg .= "Stored in e107: " . varset($this->pref['e_cron_pwd'], "(none set)");
$msg .= "
";
$msg .= "You should regenerate the cron command in admin and enter it again in your server configuration.";
diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php
index ccdaf79d6..0f606c82a 100644
--- a/e107_handlers/e107_class.php
+++ b/e107_handlers/e107_class.php
@@ -213,6 +213,7 @@ class e107
'e_profanity' => '{e_HANDLER}e_profanity_class.php',
'e_ranks' => '{e_HANDLER}e_ranks_class.php',
'e_render' => '{e_HANDLER}e_render_class.php',
+ 'e_search' => '{e_HANDLER}search_class.php',
'e_shortcode' => '{e_HANDLER}shortcode_handler.php',
'e_system_user' => '{e_HANDLER}user_model.php',
'e_theme' => '{e_HANDLER}theme_handler.php',
@@ -1459,6 +1460,16 @@ class e107
return self::getSingleton('e_parse_shortcode');
}
+ /**
+ * Retrieve search class singleton object
+ *
+ * @return array|Object|secure_image
+ */
+ public static function getSearch()
+ {
+ return self::getSingleton('e_search'); // more flexible.
+ // return self::getObject('secure_image');
+ }
/**
* Retrieve secure_image singleton object
@@ -3854,6 +3865,11 @@ class e107
*/
public static function canonical($plugin = '', $key = 'index', $row = array())
{
+ if($plugin === '_RESET_') // for testing only, may be removed in future.
+ {
+ e107::setRegistry('core/e107/canonical');
+ }
+
$alreadyDone = e107::getRegistry('core/e107/canonical');
diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php
index c08caf559..6ad03d3c4 100644
--- a/e107_handlers/e_parse_class.php
+++ b/e107_handlers/e_parse_class.php
@@ -37,9 +37,10 @@ class e_parse
// 'Hooked' parsers (array)
private $e_hook = array();
- private $search = array(''', ''', ''', '"', 'onerror', '>', '"', ' & ');
+ // Used in search_class.php (move??)
+ public $search = array(''', ''', ''', '"', 'onerror', '>', '"', ' & ');
- private $replace = array("'", "'", "'", '"', 'onerror', '>', '"', ' & ');
+ public $replace = array("'", "'", "'", '"', 'onerror', '>', '"', ' & ');
// Set to TRUE or FALSE once it has been calculated
protected $e_highlighting;
diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php
index bcde7f146..8a2766fff 100644
--- a/e107_handlers/plugin_class.php
+++ b/e107_handlers/plugin_class.php
@@ -4494,7 +4494,10 @@ class e107plugin
if (file_exists($_path . 'plugin.xml'))
{
- unset($_POST['uninstall_confirm']);
+ if(isset($_POST['uninstall_confirm']))
+ {
+ unset($_POST['uninstall_confirm']);
+ }
$this->install_plugin_xml($plug, 'uninstall', $options); //$_POST must be used.
}
else
diff --git a/e107_handlers/search/search_comment.php b/e107_handlers/search/search_comment.php
index 1b6a98af6..af39d888d 100644
--- a/e107_handlers/search/search_comment.php
+++ b/e107_handlers/search/search_comment.php
@@ -50,7 +50,7 @@ $search_fields = array('c.comment_comment', 'c.comment_author_name');
$weights = array('1.2', '0.6');
$no_results = LAN_198;
$where = "comment_type IN (".implode(',', $in).") AND".$advanced_where;
-$order = array('comment_datestamp' => DESC);
+$order = array('comment_datestamp' => 'DESC');
$table = "comments AS c ".implode(' ', $join);
$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_comment', $no_results, $where, $order);
diff --git a/e107_handlers/search_class.php b/e107_handlers/search_class.php
index 711ee3c9a..98146c457 100644
--- a/e107_handlers/search_class.php
+++ b/e107_handlers/search_class.php
@@ -335,8 +335,8 @@ class e_search
foreach ($matches as $this -> text)
{
$this -> text = nl2br($this -> text);
- $t_search = $tp -> search;
- $t_replace = $tp -> replace;
+ $t_search = $tp->search;
+ $t_replace = $tp->replace;
$s_search = array('
', '[', ']');
$s_replace = array(' ', '<', '>');
$search = array_merge($t_search, $s_search);
diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php
index a642a5ed3..1f168ee5b 100644
--- a/e107_handlers/shortcode_handler.php
+++ b/e107_handlers/shortcode_handler.php
@@ -1266,12 +1266,14 @@ class e_parse_shortcode
$_class = strtolower($code);
$_path = e_CORE.'shortcodes/single/'.strtolower($code).'.php';
- include_once(e_CORE.'shortcodes/single/'.strtolower($code).'.php');
+ include_once($_path);
+
if (class_exists($_class, false)) // prevent __autoload - performance
{
// SecretR - fix array(parm, sc_mode) causing parm to become an array, see issue 424
- $ret = call_user_func(array($_class, $_function), $parm, $sc_mode);
+ // $ret = call_user_func(array($_class, $_function), $parm, $sc_mode);
+ $ret = e107::callMethod($_class, $_function, $parm, $sc_mode); // v2.3.1
}
elseif (function_exists($_function))
{
diff --git a/e107_languages/English/English.php b/e107_languages/English/English.php
index b1468528c..af1835d41 100644
--- a/e107_languages/English/English.php
+++ b/e107_languages/English/English.php
@@ -149,4 +149,4 @@ define("LAN_CHOOSE_FILE", "Choose a file");
define("LAN_REQUIRED", "Required");
-define("LAN_DEVELOPERMODE_CHECK", "[b]Developer mode is currently enabled. Use this mode only when developing![/b] [br]Please disable developer mode when using your website in live production. When developer mode is enabled, sensitive information may be shown to the public!");
\ No newline at end of file
+define("LAN_DEVELOPERMODE_CHECK", "[b]Developer mode is currently enabled. Use this mode only when developing![/b] [br]Please disable developer mode when using your website in live production. When developer mode is enabled, sensitive information may be shown to the public!");
diff --git a/e107_languages/English/admin/lan_newspost.php b/e107_languages/English/admin/lan_newspost.php
index 5193963ae..b05087866 100644
--- a/e107_languages/English/admin/lan_newspost.php
+++ b/e107_languages/English/admin/lan_newspost.php
@@ -14,7 +14,7 @@ define("NWSLAN_4", "News - Existing News");
define("NWSLAN_6", "Category");
// define("NWSLAN_9", "tick to confirm");
-define("NWSLAN_10", "No news categories");
+// define("NWSLAN_10", "No news categories");
// define("NWSLAN_11", "Add/Edit Categories");
//define("NWSLAN_12", "Title");
define("NWSLAN_13", "Body");
diff --git a/e107_languages/English/lan_submitnews.php b/e107_languages/English/lan_submitnews.php
index 901866820..6e5965c0f 100644
--- a/e107_languages/English/lan_submitnews.php
+++ b/e107_languages/English/lan_submitnews.php
@@ -7,7 +7,10 @@
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
-define("PAGE_NAME", "Submit News");
+if(!defined('PAGE_NAME'))
+{
+ define("PAGE_NAME", "Submit News");
+}
//define("LAN_7", "Name: ");//LAN_NAME
//define("LAN_62", "News Title: ");//LAN_TITLE
//define("LAN_112", "Email Address: ");//LAN_EMAIL
diff --git a/e107_languages/English/lan_upload.php b/e107_languages/English/lan_upload.php
index ec9de3264..1315836bf 100644
--- a/e107_languages/English/lan_upload.php
+++ b/e107_languages/English/lan_upload.php
@@ -2,14 +2,13 @@
/*
+ ----------------------------------------------------------------------------+
| e107 website system - Language File.
-|
-| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_upload.php,v $
-| $Revision$
-| $Date$
-| $Author$
+
+----------------------------------------------------------------------------+
*/
-define("PAGE_NAME", "Upload");
+if(!defined('PAGE_NAME'))
+{
+ define("PAGE_NAME", "Upload");
+}
define("LAN_UL_001","Invalid email address");
define("LAN_UL_002", "You do not have the correct permissions to upload files to this server."); // LAN_403
@@ -47,12 +46,12 @@ define("LAN_411", "File");
define("LAN_413", "Description");
define("LAN_414", "Working demo");
define("LAN_415", "enter URL to site where demo can be viewed");
-define("LAN_416", "Submit and Upload");
-define("LAN_417", "Upload File");
+
+// define("LAN_417", "Upload File");
define("LAN_418", "Absolute maximum file size: ");
define("DOWLAN_11", "Category");
define("LAN_419", "Allowed filetypes");
define("LAN_420", "fields are required");
-
+define("LAN_UL_039", "Submit and Upload"); // LAN_416
diff --git a/e107_plugins/banner/banner.php b/e107_plugins/banner/banner.php
index 51e1ae5c4..a18dfedfb 100644
--- a/e107_plugins/banner/banner.php
+++ b/e107_plugins/banner/banner.php
@@ -20,7 +20,7 @@ if (!e107::isInstalled('banner'))
exit;
}
-e107::includeLan(e_PLUGIN."banner/languages/".e_LANGUAGE."_banner.php"); // TODO
+// e107::includeLan(e_PLUGIN."banner/languages/".e_LANGUAGE."_banner.php"); // TODO
e107::lan('banner');
diff --git a/e107_plugins/forum/templates/forum_icons_template.php b/e107_plugins/forum/templates/forum_icons_template.php
index cc79b284c..bfd1c6f5c 100644
--- a/e107_plugins/forum/templates/forum_icons_template.php
+++ b/e107_plugins/forum/templates/forum_icons_template.php
@@ -92,8 +92,18 @@ define('IMAGE_admin_unlock', 'src="'.img_path('admin_unlock.png').'" alt="'.LAN_
// Multi Language Images
define('IMAGE_newthread', '');
define('IMAGE_reply', '');
-define('IMAGE_rank_moderator_image', '');
-define('IMAGE_rank_main_admin_image', '');
-define('IMAGE_rank_admin_image', '');
+
+if(!defined('IMAGE_rank_moderator_image'))
+{
+ define('IMAGE_rank_moderator_image', '');
+}
+if(!defined('IMAGE_rank_main_admin_image'))
+{
+ define('IMAGE_rank_main_admin_image', '');
+}
+if(!defined('IMAGE_rank_admin_image'))
+{
+ define('IMAGE_rank_admin_image', '');
+}
diff --git a/e107_plugins/list_new/list_shortcodes.php b/e107_plugins/list_new/list_shortcodes.php
index 0d8fb01f3..3a44398f4 100644
--- a/e107_plugins/list_new/list_shortcodes.php
+++ b/e107_plugins/list_new/list_shortcodes.php
@@ -22,7 +22,7 @@ if (!defined('e107_INIT')) { exit; }
//register_shortcode('list_shortcodes', true);
//initShortcodeClass('list_shortcodes');
-class list_shortcodes
+class list_shortcodes extends e_shortcode
{
var $rc; // list class.
var $e107;
diff --git a/e107_plugins/news/news.php b/e107_plugins/news/news.php
index 3eb954db9..5985f9f35 100644
--- a/e107_plugins/news/news.php
+++ b/e107_plugins/news/news.php
@@ -1894,78 +1894,3 @@ if(E107_DBG_BASIC && ADMIN)
$newsObj->debug();
}
require_once(FOOTERF);
-exit;
-
-
-
-
-//require_once(e_HANDLER."comment_class.php");
-//$cobj = new comment;
-
-
-
-//------------------------------------------------------
-// DISPLAY NEWS IN 'CATEGORY' LIST FORMAT HERE
-//------------------------------------------------------
-// Just title and a few other details
-
-
-
-
-
-//------------------------------------------------------
-// DISPLAY SINGLE ITEM IN EXTENDED FORMAT HERE
-//------------------------------------------------------
-
-
-
-//------------------------------------------------------
-// DISPLAY NEWS IN LIST FORMAT HERE
-//------------------------------------------------------
-// Show title, author, first part of news item...
-
-
-// ##### --------------------------------------------------------------------------------------------------------------
-
-
-// #### new: news archive ---------------------------------------------------------------------------------------------
-
-// #### END -----------------------------------------------------------------------------------------------------------
-
-if ($action != "item") {
- if (is_numeric($action)){
- $action = "";
- }
- // $parms = $news_total.",".ITEMVIEW.",".$newsfrom.",".e_SELF.'?'."[FROM].".$action.(isset($sub_action) ? ".".$sub_action : "");
- // $nextprev = $tp->parseTemplate("{NEXTPREV={$parms}}");
- // echo ($nextprev ? "
".$nextprev."
" : "");
-}
-
-if(is_dir("remotefile")) {
- require_once(e_HANDLER."file_class.php");
- $file = new e_file;
- // $reject = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*', 'Readme.txt');
- // $crem = $file -> get_files(e_BASE."remotefile", "", $reject);
- $crem = $file -> get_files(e_BASE."remotefile", '~Readme\.txt');
- if(count($crem)) {
- foreach($crem as $loadrem) {
- if(strpos($loadrem['fname'], "load_") !== false) {
- require_once(e_BASE."remotefile/".$loadrem['fname']);
- }
- }
- }
-}
-
-if (isset($this->pref['nfp_display']) && $this->pref['nfp_display'] == 2 && is_readable(e_PLUGIN."newforumposts_main/newforumposts_main.php"))
-{
- require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php");
-}
-
-render_newscats();
-
-require_once(FOOTERF);
-
-
-// =========================================================================
-
-
diff --git a/e107_plugins/siteinfo/e_shortcode.php b/e107_plugins/siteinfo/e_shortcode.php
index 84a918a34..6f1fac023 100644
--- a/e107_plugins/siteinfo/e_shortcode.php
+++ b/e107_plugins/siteinfo/e_shortcode.php
@@ -167,7 +167,7 @@ class siteinfo_shortcodes // must match the folder name of the plugin.
if((isset($parm['w']) || isset($parm['h'])))
{
//
- $dimensions[0] = $parm['w'];
+ $dimensions[0] = isset($parm['w']) ? $parm['w'] : 0;
$dimensions[1] = !empty($parm['h']) ? $parm['h'] : 0;
if(empty($parm['noresize']) && !empty($logopref)) // resize by default - avoiding large files.
diff --git a/e107_tests/tests/unit/e107Test.php b/e107_tests/tests/unit/e107Test.php
index 06d4679b6..e7bb7d6e8 100644
--- a/e107_tests/tests/unit/e107Test.php
+++ b/e107_tests/tests/unit/e107Test.php
@@ -848,7 +848,7 @@ class e107Test extends \Codeception\Test\Unit
{
// Make sure nothing else loaded the language files.
- $this->assertFalse(defined('BANNERLAN_19'), 'BANNERLAN_19 is already defined!');
+ // $this->assertFalse(defined('BANNERLAN_19'), 'BANNERLAN_19 is already defined!');
// $this->assertFalse(defined('LAN_FORUM_0002'), 'LAN_FORUM_0002 is already defined!');
$this->assertFalse(defined('LAN_GALLERY_ADMIN_01'), 'LAN_GALLERY_ADMIN_01 is already defined!');
$this->assertFalse(defined('CM_L1'), 'Comment Menu English file already defined');
@@ -970,7 +970,7 @@ class e107Test extends \Codeception\Test\Unit
public function testCanonical()
{
$e107 = $this->e107;
-
+ $e107::canonical('_RESET_');
$e107::canonical('news');
$result = $e107::canonical();
diff --git a/e107_tests/tests/unit/e_parse_shortcodeTest.php b/e107_tests/tests/unit/e_parse_shortcodeTest.php
index f73c41388..bb4d26277 100644
--- a/e107_tests/tests/unit/e_parse_shortcodeTest.php
+++ b/e107_tests/tests/unit/e_parse_shortcodeTest.php
@@ -168,6 +168,9 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
+ $sc->__construct();
+
+
$this->processShortcodeMethods($sc);
}
@@ -185,6 +188,8 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
+ $sc->__construct();
+
$this->processShortcodeMethods($sc);
}
@@ -230,6 +235,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
'user_join' => 1518441749
);
+ $sc->__construct();
$sc->setVars($values);
$this->processShortcodeMethods($sc);
@@ -251,6 +257,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
+ $sc->__construct();
$this->processShortcodeMethods($sc);
}
@@ -269,6 +276,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
+ $sc->__construct();
$this->processShortcodeMethods($sc);
}
@@ -287,6 +295,8 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
+ $sc->__construct();
+
$this->processShortcodeMethods($sc);
}
@@ -321,6 +331,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
'link_owner' => 'news'
);
+ $sc->__construct();
$sc->setVars($vars);
$this->processShortcodeMethods($sc);
@@ -389,6 +400,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
'user_name' => 'admin'
);
+ $sc->__construct();
$sc->setVars($vars);
$this->processShortcodeMethods($sc);
@@ -502,7 +514,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
'menu_button_text' => ''
);
-
+ $sc->__construct();
$sc->setVars($vars);
$exclude = array('sc_cpagemessage'); // system messages
@@ -569,7 +581,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
)
;
-
+ $sc->__construct();
$sc->setVars($vars);
// $exclude = array('sc_cpagemessage'); // system messages
@@ -613,6 +625,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
+ $sc->__construct();
$this->processShortcodeMethods($sc);
}
@@ -662,8 +675,10 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
);
+ $sc->__construct();
$sc->setVars($vars);
+
$exclude = array('sc_user_email'); // uses random obfiscation.
$this->processShortcodeMethods($sc, null, $exclude);
@@ -742,6 +757,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
+
$vars = array(
'cb_id' => '11',
'cb_nick' => '1.admin',
@@ -751,6 +767,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
'cb_ip' => '0000:0000:0000:0000:0000:ffff:7f00:0001'
);
+ $sc->__construct();
$sc->setVars($vars);
$this->processShortcodeMethods($sc);
@@ -804,6 +821,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
);
+ $sc->__construct();
$sc->setVars($values);
$this->processShortcodeMethods($sc);
@@ -903,6 +921,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
);
+ $sc->__construct();
$sc->setVars($vars);
$this->processShortcodeMethods($sc);
@@ -1177,7 +1196,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
);
-
+ $sc->__construct();
$sc->setVars($vars);
$exclude = array('sc_gallery_slides'); // uses a counter.
$this->processShortcodeMethods($sc, null, $exclude);
@@ -1259,7 +1278,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
);
-
+ $sc->__construct();
$sc->setVars($vars);
// $exclude = array('sc_gallery_slides'); // uses a counter.
$this->processShortcodeMethods($sc);
@@ -1281,7 +1300,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
-
+ $sc->__construct();
$this->processShortcodeMethods($sc);
@@ -1415,12 +1434,15 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
{
/** @var list_shortcodes $sc */
$sc = $this->make('list_shortcodes');
+
}
catch (Exception $e)
{
$this->fail($e->getMessage());
}
+ $sc->__construct();
+
$sc->rc = new listclass;
$vars = array (
@@ -1464,6 +1486,8 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
private function processShortcodeMethods($sc, $parms=array(), $exclude=array())
{
+ $sc->wrapper('non-existent/wrapper');
+
$list = get_class_methods($sc);
foreach($list as $meth)
diff --git a/e107_tests/tests/unit/scriptsTest.php b/e107_tests/tests/unit/scriptsTest.php
index 662cd8d4a..fd0858b45 100644
--- a/e107_tests/tests/unit/scriptsTest.php
+++ b/e107_tests/tests/unit/scriptsTest.php
@@ -35,7 +35,58 @@
}
- private function loadScripts($folder, $exclude= array())
+ public function testFrontend()
+ {
+ e107::getConfig()->setPref('plug_installed/gsitemap', '1.0');
+
+ $include = array (
+ 0 => 'banner.php',
+ // 1 => 'class2.php',
+ // 2 => 'comment.php',
+ 3 => 'contact.php',
+
+ // 5 => 'cron.php',
+ // 6 => 'download.php',
+ // 7 => 'e107_config.php',
+
+ // 12 => 'email.php',
+ 13 => 'error.php',
+
+ 15 => 'fpw.php',
+ 16 => 'gsitemap.php',
+ // 17 => 'index.php', // redirects
+ // 18 => 'install.php', // not compatible with core.
+
+ 20 => 'login.php',
+ 21 => 'membersonly.php',
+ // 22 => 'metaweblog.php',
+ 23 => 'news.php',
+ 24 => 'online.php',
+ 25 => 'page.php',
+ // 26 => 'print.php',
+ // 27 => 'rate.php', // has a redirect.
+ // 28 => 'request.php', // redirects
+ 29 => 'search.php',
+ // 30 => 'signup.php', too many 'exit';
+ 31 => 'sitedown.php',
+ 32 => 'submitnews.php',
+
+ // 34 => 'thumb.php', // separate test.
+ 35 => 'top.php',
+ 36 => 'unsubscribe.php',
+ // 37 => 'upload.php', // FIXME LAN conflict.
+ 38 => 'user.php',
+ // 39 => 'userposts.php', // FIXME needs a rework
+ 40 => 'usersettings.php',
+ );
+
+ $this->loadScripts(e_BASE, array(), $include);
+ }
+
+
+
+
+ private function loadScripts($folder, $exclude= array(), $include=array())
{
// $globalList = e107::getPref('lan_global_list');
@@ -67,12 +118,12 @@
{
$ext = pathinfo($folder.$file, PATHINFO_EXTENSION);
- if($ext !== 'php' || in_array($file, $exclude))
+ if($ext !== 'php' || in_array($file, $exclude) || (!empty($include) && !in_array($file,$include)))
{
continue;
}
- // echo " --- ".$file." --- \n";
+ echo " --- ".$file." --- \n";
ob_start();
// test for PHP Notice/Warning etc.
$error = false;
diff --git a/email.php b/email.php
index 8bef736b2..5040be4d5 100644
--- a/email.php
+++ b/email.php
@@ -19,7 +19,7 @@
require_once('class2.php');
if (!check_class(varset($pref['email_item_class'],e_UC_MEMBER)))
{
- header('Location: '.e_BASE.'index.php');
+ e107::redirect('Location: '.e_BASE.'index.php');
exit();
}
@@ -255,4 +255,3 @@ $text .= "
$ns->tablerender(LAN_EMAIL_5, $text);
require_once(FOOTERF);
-?>
\ No newline at end of file
diff --git a/login.php b/login.php
index 0d540405e..719181526 100644
--- a/login.php
+++ b/login.php
@@ -121,6 +121,3 @@ if (!USER || getperms('0'))
require_once(FOOTERF);
-exit;
-
-?>
\ No newline at end of file
diff --git a/membersonly.php b/membersonly.php
index 549d60644..d7d5789aa 100644
--- a/membersonly.php
+++ b/membersonly.php
@@ -3,94 +3,101 @@
+ ----------------------------------------------------------------------------+
| e107 website system
|
-| Copyright (C) 2008-2009 e107 Inc
+| Copyright (C) 2008-2021
| http://e107.org
|
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
-|
-| $Source: /cvs_backup/e107_0.8/membersonly.php,v $
-| $Revision$
-| $Date$
-| $Author$
+
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
+e107::coreLan('membersonly');
- e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
+//e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
- if(deftrue('BOOTSTRAP')) //v2.x
+if(deftrue('BOOTSTRAP')) //v2.x
+{
+ $MEMBERSONLY_TEMPLATE = e107::getCoretemplate('membersonly');
+}
+else // Legacy
+{
+ if(is_readable(THEME . "membersonly_template.php"))
{
- $MEMBERSONLY_TEMPLATE = e107::getCoretemplate('membersonly');
+ require_once(THEME . "membersonly_template.php");
}
- else // Legacy
+ else
{
- if(is_readable(THEME."membersonly_template.php"))
- {
- require_once(THEME."membersonly_template.php");
- }
- else
- {
- require_once(e_CORE."templates/membersonly_template.php");
- }
-
- $MEMBERSONLY_TEMPLATE['default']['caption'] = $MEMBERSONLY_CAPTION;
- $MEMBERSONLY_TEMPLATE['default']['header'] = $MEMBERSONLY_BEGIN;
- $MEMBERSONLY_TEMPLATE['default']['body'] = $MEMBERSONLY_TABLE;
- $MEMBERSONLY_TEMPLATE['default']['footer'] = $MEMBERSONLY_END;
+ require_once(e_CORE . "templates/membersonly_template.php");
}
- define('e_IFRAME',true);
+ $MEMBERSONLY_TEMPLATE['default']['caption'] = $MEMBERSONLY_CAPTION;
+ $MEMBERSONLY_TEMPLATE['default']['header'] = $MEMBERSONLY_BEGIN;
+ $MEMBERSONLY_TEMPLATE['default']['body'] = $MEMBERSONLY_TABLE;
+ $MEMBERSONLY_TEMPLATE['default']['footer'] = $MEMBERSONLY_END;
+}
+
+if(!defined('e_IFRAME'))
+{
+ define('e_IFRAME', true);
+}
+
class membersonly
{
function sc_membersonly_signup()
{
+
$pref = e107::pref('core');
- if (intval($pref['user_reg'])===1)
+ if(intval($pref['user_reg']) === 1)
{
- $srch = array("[","]");
- $repl = array("","");
- return str_replace($srch,$repl, LAN_MEMBERS_3);
+ $srch = array("[", "]");
+ $repl = array("", "");
+
+ return str_replace($srch, $repl, LAN_MEMBERS_3);
}
}
function sc_membersonly_returntohome()
{
+
$pref = e107::pref('core');
if($pref['membersonly_redirect'] == 'login')
{
- return "".LAN_MEMBERS_4."";
+ return "" . LAN_MEMBERS_4 . "";
}
}
function sc_membersonly_restricted_area()
{
+
return LAN_MEMBERS_1;
}
function sc_membersonly_login()
{
- $srch = array("[","]");
- $repl = array("","");
- return str_replace($srch,$repl, LAN_MEMBERS_2);
+
+ $srch = array("[", "]");
+ $repl = array("", "");
+
+ return str_replace($srch, $repl, LAN_MEMBERS_2);
}
}
- require_once(HEADERF);
- $mem = new membersonly;
+require_once(HEADERF);
- $BODY = e107::getParser()->parseTemplate( $MEMBERSONLY_TEMPLATE['default']['body'],true,$mem);
+$mem = new membersonly;
- echo $MEMBERSONLY_TEMPLATE['default']['header'];
- e107::getRender()->tablerender($MEMBERSONLY_TEMPLATE['default']['caption'], $BODY, 'membersonly');
- echo $MEMBERSONLY_TEMPLATE['default']['footer'];
+$BODY = e107::getParser()->parseTemplate($MEMBERSONLY_TEMPLATE['default']['body'], true, $mem);
- require_once(FOOTERF);
-?>
\ No newline at end of file
+echo $MEMBERSONLY_TEMPLATE['default']['header'];
+e107::getRender()->tablerender($MEMBERSONLY_TEMPLATE['default']['caption'], $BODY, 'membersonly');
+echo $MEMBERSONLY_TEMPLATE['default']['footer'];
+
+require_once(FOOTERF);
diff --git a/news.php b/news.php
index 434e3a8b7..c2fd2c735 100644
--- a/news.php
+++ b/news.php
@@ -21,8 +21,5 @@
require_once("class2.php");
require_once(e_PLUGIN."news/news.php");
-exit;
-
-?>
\ No newline at end of file
diff --git a/online.php b/online.php
index a6f998f15..a763d7fea 100644
--- a/online.php
+++ b/online.php
@@ -26,15 +26,15 @@
*/
require_once('class2.php');
- e107::includeLan(e_LANGUAGEDIR . e_LANGUAGE . '/lan_' . e_PAGE);
+ e107::coreLan('online');
require_once(HEADERF);
- if(!$pref['track_online'])
+ if(!isset($pref['track_online']))
{
$ns->tablerender(ONLINE_EL4, ONLINE_EL16);
require_once(FOOTERF);
- exit;
+ return;
}
$ONLINE_TABLE = '';
@@ -322,7 +322,7 @@
}
- $scArray['ONLINE_TABLE_MEMBERS_ONLINE'] = ONLINE_EL1 . GUESTS_ONLINE;
+ $scArray['ONLINE_TABLE_MEMBERS_ONLINE'] = defset('ONLINE_EL1') . GUESTS_ONLINE;
$scArray['ONLINE_TABLE_GUESTS_ONLINE'] = ONLINE_EL2 . MEMBERS_ONLINE;
if(!isset($gen) || !is_object($gen))
diff --git a/page.php b/page.php
index 65c2a05a5..2defafd7e 100644
--- a/page.php
+++ b/page.php
@@ -33,7 +33,7 @@ if(!e_QUERY)
}*/
require_once(FOOTERF);
- exit;
+
}
elseif(vartrue($_GET['bk'])) // List Chapters within a specific Book
{
@@ -44,7 +44,7 @@ elseif(vartrue($_GET['bk'])) // List Chapters within a specific Book
require_once(HEADERF);
e107::getRender()->tablerender($e107CorePage->pageOutput['caption'], $e107CorePage->pageOutput['text'], 'cpage-chapter-list');
require_once(FOOTERF);
- exit;
+
}
elseif(vartrue($_GET['ch'])) // List Pages within a specific Chapter
{
@@ -56,7 +56,7 @@ elseif(vartrue($_GET['ch'])) // List Pages within a specific Chapter
require_once(HEADERF);
e107::getRender()->tablerender($e107CorePage->pageOutput['caption'], $e107CorePage->pageOutput['text'], 'cpage-page-list');
require_once(FOOTERF);
- exit;
+
}
else
{
@@ -78,7 +78,7 @@ else
$ns->tablerender($e107CorePage->pageOutput['caption'], $e107CorePage->pageOutput['text'], $e107CorePage->pageOutput['mode']);
require_once(FOOTERF);
- exit;
+
}
/* EOF */
diff --git a/print.php b/print.php
index de8597e70..44d691726 100644
--- a/print.php
+++ b/print.php
@@ -16,9 +16,11 @@ require_once("class2.php");
e107::coreLan('print');
$qs = explode(".", e_QUERY,2);
-if ($qs[0] == "") {
+
+if ($qs[0] == "")
+{
e107::redirect();
- exit;
+ exit;
}
$CSS = <<".$print_text."
";
}
+
require_once(FOOTERF);
-?>
+
diff --git a/rate.php b/rate.php
index fed95645c..d8c7ec63a 100644
--- a/rate.php
+++ b/rate.php
@@ -64,7 +64,7 @@ else // Ajax Used.
echo e107::getRate()->submitVote($table,$itemid,$rate);
}
- exit;
+exit;
}
diff --git a/search.php b/search.php
index ffc1de4ac..cf00785f7 100644
--- a/search.php
+++ b/search.php
@@ -10,7 +10,7 @@
require_once('class2.php');
e107::coreLan('search');
-e107_require(e_HANDLER.'search_class.php');
+
if (!check_class($pref['search_restrict']))
{
@@ -75,9 +75,9 @@ class search extends e_shortcode
$SEARCH_TOP_TABLE = $tmp['start'];
$SEARCH_BOT_TABLE = $tmp['end'];
$SEARCH_CATS = $tmp['category'];
- $SEARCH_TYPE = $tmp['type'];
+ $SEARCH_TYPE = varset($tmp['type']);
$SEARCH_ADV = $tmp['advanced'];
- $SEARCH_ENHANCED = $tmp['enhanced'];
+ $SEARCH_ENHANCED = varset($tmp['enhanced']);
$SEARCH_ADV_COMBO = $tmp['advanced-combo'];
$this->template = $tmp;
@@ -265,7 +265,7 @@ class search extends e_shortcode
$search_count = count($this->search_info);
$google_id = $search_count + 1;
-
+ $checkboxes = '';
if ($this->search_prefs['selector'] == 2)
{
@@ -276,10 +276,7 @@ class search extends e_shortcode
$dropdown .= "";
}
}
- else
- {
- $checkboxes = '';
- }
+
foreach($this->search_info as $key => $value)
{
@@ -354,7 +351,7 @@ class search extends e_shortcode
{
$var['ENHANCED_TEXT'] = $ENHANCED_TEXT;
$var['ENHANCED_DISPLAY_ID'] = "en_".$en_id;
- $var['ENHANCED_FIELD'] = "";
+ $var['ENHANCED_FIELD'] = "";
$text .= $tp->simpleParse($this->template['enhanced'], $var);
}
@@ -383,7 +380,7 @@ class search extends e_shortcode
$tp = e107::getParser();
$sql = e107::getDb();
$sql2 = e107::getDb('search');
-
+ $advanced = array();
if(!$parm)
{
@@ -509,7 +506,7 @@ class search extends e_shortcode
{
$search_info = array();
require_once($plug_require);
- $ret = $search_info[0];
+ $ret = varset($search_info[0]);
}
else
{
@@ -605,7 +602,11 @@ class search extends e_shortcode
}
*/
$e_searchList = e107::getConfig('core')->get('e_search_list');
-
+
+ if(empty($this->search_prefs['plug_handlers']))
+ {
+ return array();
+ }
//plugin search routines // plugin folder is used as the search key. ie. $_GET['t'] = 'chatbox';
foreach ($this->search_prefs['plug_handlers'] as $plug_dir => $active)
@@ -619,7 +620,7 @@ class search extends e_shortcode
{
if ($search_info[$plug_dir] = $this->search_info($plug_dir, 'plug', e_PLUGIN.$plug_dir."/e_search.php"))
{
- $search_info[$plug_dir]['listorder'] = $active['order'];
+ $search_info[$plug_dir]['listorder'] = varset($active['order']);
// $search_id++;
}
else
@@ -763,13 +764,13 @@ class search extends e_shortcode
$con = e107::getDateConvert(); // BC Fix
- $sch = new e_search; // BC Fix
+ $sch = e107::getSearch(); // new e_search; // BC Fix
$query = $this->query;
- $_GET['q'] = rawurlencode($_GET['q']);
- $_GET['t'] = preg_replace('/[^\w\-]/i', '', $_GET['t']);
+ $_GET['q'] = rawurlencode(varset($_GET['q']));
+ $_GET['t'] = preg_replace('/[^\w\-]/i', '', varset($_GET['t']));
$search_prefs = $this->search_prefs;
$result_flag = $this->result_flag;
@@ -1049,7 +1050,7 @@ $enhanced_types['ex'] = LAN_SEARCH_25.':';
$enhanced_types['ep'] = LAN_SEARCH_26.':';
$enhanced_types['be'] = LAN_SEARCH_27.':';
-$SEARCH_VARS->ENHANCED_DISPLAY = $enhanced ? "" : "style='display: none'";
+$SEARCH_VARS->ENHANCED_DISPLAY = isset($enhanced) ? "" : "style='display: none'";
// advanced search config
if (!vartrue($_GET['adv']) || $_GET['t'] == 'all')
@@ -1093,7 +1094,7 @@ if ($perform_search)
{
$con = e107::getDate();
- $sch = new e_search;
+ $sch = e107::getSearch();
// omitted words message
$stop_count = count($sch -> stop_keys);
@@ -1132,7 +1133,7 @@ if(deftrue('BOOTSTRAP'))
$SEARCH_TOP_TABLE = $tmp['start'];
$SEARCH_BOT_TABLE = $tmp['end'];
$SEARCH_CATS = $tmp['category'];
- $SEARCH_TYPE = $tmp['type'];
+ $SEARCH_TYPE = varset($tmp['type']);
$SEARCH_ADV = $tmp['advanced'];
$SEARCH_ENHANCED = $tmp['enhanced'];
$SEARCH_ADV_COMBO = $tmp['advanced-combo'];
@@ -1217,14 +1218,13 @@ function parsesearch($text, $match)
}
-function headerjs() {
- global $search_count, $google_id, $search_prefs, $js_adv, $search_info;
- if ($search_prefs['selector'] == 1) {
+ $script= '';
+ if (varset($search_prefs['selector']) == 1) {
$types = array_keys($search_info);
$types = implode("', '", $types);
- $script = "";
+ ";
}
+ if(!empty($script))
+ {
+ e107::js('inline', $script);
+ }
- return $script;
-}
-
require_once(FOOTERF);
-?>
\ No newline at end of file
diff --git a/signup.php b/signup.php
index 2b9cdbc9e..967536ebd 100644
--- a/signup.php
+++ b/signup.php
@@ -12,7 +12,7 @@
require_once("class2.php");
-if(vartrue($_POST['email2'])) // spam-trap.
+if(!empty($_POST['email2'])) // spam-trap.
{
exit;
}
@@ -26,6 +26,21 @@ if($qs[0] != 'activate')
// include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_usersettings.php"); Shouldn't need this now
}
+e107::js('inline', "
+function addtext3(sc){
+ document.getElementById('signupform').image.value = sc;
+ }
+
+ function addsig(sc){
+ document.getElementById('signupform').signature.value += sc;
+ }
+ function help(help){
+ document.getElementById('signupform').helpb.value = help;
+ }
+");
+
+
+
e107::coreLan('user'); // Generic user-related language defines
$bcLans = array(
@@ -155,6 +170,7 @@ if(e_QUERY && e_QUERY != 'stage1')
$suObj = new e_signup;
$suObj->run(e_QUERY);
require_once(FOOTERF);
+ return;
exit;
}
@@ -643,7 +659,7 @@ function req($field)
return ($field == 2 ? "" : "");
}
//----------------------------------
-
+/*
function headerjs()
{
return "
@@ -660,4 +676,4 @@ function headerjs()
}
\n";
-}
+}*/
diff --git a/sitedown.php b/sitedown.php
index 0f45c3895..bf698b2d4 100644
--- a/sitedown.php
+++ b/sitedown.php
@@ -28,7 +28,7 @@ e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
$sitedown_shortcodes= e107::getScBatch('sitedown');
-if (!$SITEDOWN_TABLE)
+if (!isset($SITEDOWN_TABLE))
{
if (file_exists(THEME.'templates/sitedown_template.php')) //v2.x location.
{
diff --git a/submitnews.php b/submitnews.php
index a426e6e54..c827076ab 100644
--- a/submitnews.php
+++ b/submitnews.php
@@ -15,7 +15,8 @@ if(!empty($_POST) && !isset($_POST['e-token']))
$_POST['e-token'] = '';
}
require_once("class2.php");
-e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
+e107::coreLan('submitnews');
+// e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
require_once(HEADERF);
@@ -353,7 +354,7 @@ class submitNews
@@ -387,7 +388,7 @@ class submitNewsForm extends e_form
{
$help = (isset($placeholders[$i])) ? $placeholders[$i] : '';
$text .= "";
- $text .= $this->text('submitnews_media['.$i.']', $_POST['submitnews_media'][$i], 255, array('placeholder'=>$help) );
+ $text .= $this->text('submitnews_media['.$i.']', varset($_POST['submitnews_media'][$i]), 255, array('placeholder'=>$help) );
$text .= "
";
}
diff --git a/top.php b/top.php
index 9ee0a2e93..c84cb6550 100644
--- a/top.php
+++ b/top.php
@@ -137,10 +137,19 @@ if ($action == 'top')
{
//require_once (e_HANDLER.'level_handler.php');
$rank = e107::getRank();
+ if(!defined('IMAGE_rank_main_admin_image'))
+ {
+ define('IMAGE_rank_main_admin_image', (!empty($pref['rank_main_admin_image']) && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "" : ""));
+ }
- define('IMAGE_rank_main_admin_image', ($pref['rank_main_admin_image'] && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "" : ""));
- define('IMAGE_rank_admin_image', ($pref['rank_admin_image'] && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "" : ""));
- define('IMAGE_rank_moderator_image', ($pref['rank_moderator_image'] && file_exists(THEME."forum/".$pref['rank_moderator_image']) ? "" : ""));
+ if(!defined('IMAGE_rank_main_admin_image'))
+ {
+ define('IMAGE_rank_admin_image', (!empty($pref['rank_admin_image']) && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "" : ""));
+ }
+ if(!defined('IMAGE_rank_main_admin_image'))
+ {
+ define('IMAGE_rank_moderator_image', (!empty($pref['rank_moderator_image']) && file_exists(THEME."forum/".$pref['rank_moderator_image']) ? "" : ""));
+ }
if ($subaction == 'forum' || $subaction == 'all')
{
diff --git a/unsubscribe.php b/unsubscribe.php
index e59b206ea..c17128c6a 100644
--- a/unsubscribe.php
+++ b/unsubscribe.php
@@ -4,8 +4,10 @@ if (!defined('e107_INIT'))
{
require_once("class2.php");
}
-
-define('e_IFRAME', true);
+if(!defined('e_IFRAME'))
+{
+ define('e_IFRAME', true);
+}
require_once(HEADERF);
class e_unsubscribe
@@ -139,10 +141,7 @@ class e_unsubscribe
new e_unsubscribe;
-
-
-
require_once(FOOTERF);
-exit;
+
diff --git a/upload.php b/upload.php
index e32f784de..2b62036a3 100644
--- a/upload.php
+++ b/upload.php
@@ -9,12 +9,12 @@
*/
require_once("class2.php");
-e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
+e107::coreLan('upload');
-if (!$pref['upload_enabled'] || $pref['upload_class'] == 255)
+if (!isset($pref['upload_enabled']) ||( varset($pref['upload_class']) == 255))
{
e107::redirect();
- exit;
+ exit;
}
if (!defined("USER_WIDTH") && defset('BOOTSTRAP')==false){ define("USER_WIDTH","width:97%"); }
@@ -400,7 +400,7 @@ class userUpload
-
+
@@ -415,7 +415,7 @@ class userUpload
//TODO Shortcodes for the form elements above.
function sc_author()
{
-
+ $poster = '';
return "";
}
@@ -428,165 +428,7 @@ require_once(HEADERF);
$up->init();
-
-
-require_once(FOOTERF);
-exit;
-
-
-
-
-/*
-
-if (!check_class($pref['upload_class']))
-{
- $text = "".LAN_UL_002."
";
- $ns->tablerender(LAN_UL_020, $text);
- require_once(FOOTERF);
- exit;
-}
-*/
-
-
-
-
-
-
-/*
-
-
-
-
-
-
-
-
-
-$text = "";
- $ns->tablerender(LAN_417, $text);
- require_once(FOOTERF);
-}
-$max_upload_size = calc_max_upload_size(-1); // Find overriding maximum upload size
-$max_upload_size = set_max_size($a_filetypes, $max_upload_size);
-
-
-if (ADMIN)
-{
- $upper_limit = calc_max_upload_size();
- $allowed_filetypes = "".LAN_UL_023." | ".LAN_UL_024." |
";
- foreach ($a_filetypes as $type => $size)
- {
- $allowed_filetypes .= "{$type} | ".$e107->parseMemorySize($size,0)." |
";
- }
- $allowed_filetypes .= "
";
-}
-else
-{
- $a_filetypes = array_keys($a_filetypes);
- $allowed_filetypes = implode(' | ', $a_filetypes);
-}
-
-$text .= " ".$allowed_filetypes."
".LAN_407."
- ".LAN_418.$e107->parseMemorySize($max_upload_size,0)." (".LAN_UL_022.")
";
-
-$text .= "".LAN_408." ".LAN_420."
- ";
-
-if (!USER)
-{ // Prompt for name, email
- $text .= "
-
-
-
-
-
-
-
-
";
-}
-
-$text .= "
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ";
-
-$ns->tablerender(LAN_417, $text);
-
require_once(FOOTERF);
-*/
-
-?>
diff --git a/userposts.php b/userposts.php
index eef300792..d918b2b81 100644
--- a/userposts.php
+++ b/userposts.php
@@ -279,6 +279,9 @@ else
exit;
}
+
+
+
require_once(FOOTERF);
@@ -310,4 +313,4 @@ function parse_userposts_comments_table($row, $template)
return e107::getParser()->simpleParse($template, $vars);
}
-?>
+