From 67e0b4373492cedfffce64ba69823166463ce408 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 16 Dec 2016 12:13:52 -0800 Subject: [PATCH] Issue #6, Fix for duplicate LAN_IP, PHP 7.1 fixes. Fix for CLI failing when SSL is enabled, but command is using 'http'. Allow cURL to follow redirects, preventing broken feeds under certain circumstances. --- class2.php | 2 +- e107_handlers/admin_log_class.php | 2 +- e107_handlers/file_class.php | 4 ++-- e107_handlers/plugin_class.php | 6 ++++-- e107_handlers/xml_class.php | 8 +++++++- e107_languages/English/English.php | 3 ++- e107_languages/English/admin/lan_admin.php | 3 +-- 7 files changed, 18 insertions(+), 10 deletions(-) diff --git a/class2.php b/class2.php index 3bc8d65ac..fa6894a6c 100644 --- a/class2.php +++ b/class2.php @@ -518,7 +518,7 @@ $pref = e107::getPref(); $menu_pref = e107::getConfig('menu')->getPref(); //extract menu prefs // NEW - force ssl -if(e107::getPref('ssl_enabled') && !deftrue('e_SSL_DISABLE')) +if(e107::getPref('ssl_enabled') && !deftrue('e_SSL_DISABLE') && empty($_E107['cli'])) { // NOTE: e_SSL_DISABLE check is here to help webmasters fix 'ssl_enabled' // if set by accident on site with no SSL support - just define it in e107_config.php diff --git a/e107_handlers/admin_log_class.php b/e107_handlers/admin_log_class.php index b1b456936..7fe767ee5 100644 --- a/e107_handlers/admin_log_class.php +++ b/e107_handlers/admin_log_class.php @@ -768,7 +768,7 @@ class e_admin_log { $mes = e107::getMessage(); - $resultTypes = array(E_MESSAGE_SUCCESS - 'Success', E_MESSAGE_ERROR => 'Fail'); // Add LANS here. Could add other codes + $resultTypes = array(E_MESSAGE_SUCCESS => 'Success', E_MESSAGE_ERROR => 'Fail'); // Add LANS here. Could add other codes $separator = ''; $logString = ''; foreach ($this->_messages as $m) diff --git a/e107_handlers/file_class.php b/e107_handlers/file_class.php index fbb162de7..1c894dcf5 100644 --- a/e107_handlers/file_class.php +++ b/e107_handlers/file_class.php @@ -485,8 +485,8 @@ class e_file curl_setopt($cu, CURLOPT_RETURNTRANSFER, true); curl_setopt($cu, CURLOPT_HEADER, 0); curl_setopt($cu, CURLOPT_REFERER, $referer); - curl_setopt($cu, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($cu, CURLOPT_FOLLOWLOCATION, 0); + curl_setopt($cu, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($cu, CURLOPT_FOLLOWLOCATION, true); curl_setopt($cu, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($cu, CURLOPT_COOKIEFILE, e_SYSTEM.'cookies.txt'); curl_setopt($cu, CURLOPT_COOKIEJAR, e_SYSTEM.'cookies.txt'); diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 958f68ee5..00e716463 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -3311,6 +3311,7 @@ class e107plugin function parse_plugin_php($plugName) { $tp = e107::getParser(); + $sql = e107::getDb(); // in case it is used inside plugin.php $PLUGINS_FOLDER = '{e_PLUGIN}'; // Could be used in plugin.php file. @@ -3325,11 +3326,12 @@ class e107plugin $eplug_icon_small = null; + ob_start(); if (include(e_PLUGIN.$plugName.'/plugin.php')) { //$mes->add("Loading ".e_PLUGIN.$plugName.'/plugin.php', E_MESSAGE_DEBUG); - } - + } + ob_clean(); $ret = array(); // $ret['installRequired'] = ($eplug_conffile || is_array($eplug_table_names) || is_array($eplug_prefs) || is_array($eplug_sc) || is_array($eplug_bb) || $eplug_module || $eplug_userclass || $eplug_status || $eplug_latest); diff --git a/e107_handlers/xml_class.php b/e107_handlers/xml_class.php index 2d36fdbdc..667615046 100644 --- a/e107_handlers/xml_class.php +++ b/e107_handlers/xml_class.php @@ -1027,7 +1027,7 @@ class xmlClass /** * Import an e107 XML file into site preferences and DB tables * - * @param path $file - e107 XML file path + * @param string $file - e107 XML file path * @param string $mode[optional] - add|replace * @param boolean $noLogs [optional] tells pref handler to disable admin logs when true (install issues) * @param boolean $debug [optional] @@ -1114,6 +1114,12 @@ class xmlClass { $error = $sql->getLastErrorText(); $lastQry = $sql->getLastQuery(); + + if(is_array($lastQry)) + { + $lastQry = $lastQry['PREPARE']; + } + $ret['failed'][] = $table. "\n[".$error."]\n".$lastQry."\n\n"; } } diff --git a/e107_languages/English/English.php b/e107_languages/English/English.php index 124d98bb4..439d3ac9e 100644 --- a/e107_languages/English/English.php +++ b/e107_languages/English/English.php @@ -84,7 +84,8 @@ define("LAN_CANCEL","Cancel"); define("LAN_DATE","Date"); define("LAN_DATE_POSTED", "Date posted"); define("LAN_JSCONFIRM","Are you sure?"); -define("LAN_IP", "IP Address"); +define("LAN_IP","IP"); +define("LAN_IP_ADDRESS","IP Address"); define("LAN_AUTHOR","Author"); define("LAN_CATEGORY", "Category"); define("LAN_GUEST", "Guest"); diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index 02dc39fea..6a580085b 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -291,8 +291,7 @@ define("LAN_DISPLAYOPT", "Edit Display Options"); // define("LAN_GOPAGE", "Go to page:"); define("LAN_DATESTAMP","Date stamp"); define("LAN_TIMESTAMP","Timestamp"); -define("LAN_IP","IP"); -define("LAN_IP_ADDRESS","IP Address"); + define("LAN_PAGE","PAGE"); define("LAN_AGENT","AGENT"); define("LAN_LANG","Lang.");