From 26c2aa3e4a39ecbf132a1e32086036b846f04bb3 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 16 Feb 2016 15:14:56 -0800 Subject: [PATCH] Issue #1356 - PHP 7 auto-detection in mysql class. PHPInfo formatting. --- e107_admin/phpinfo.php | 6 ++++-- e107_handlers/mysql_class.php | 2 +- install.php | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/e107_admin/phpinfo.php b/e107_admin/phpinfo.php index dd7829e71..97685cf9d 100644 --- a/e107_admin/phpinfo.php +++ b/e107_admin/phpinfo.php @@ -25,7 +25,8 @@ require_once("auth.php"); ob_start(); phpinfo(); -$phpinfo .= ob_get_contents(); +$phpinfo = ob_get_contents(); + $phpinfo = preg_replace("#^.*#is", "", $phpinfo); $phpinfo = str_replace("font","span",$phpinfo); $phpinfo = str_replace("","",$phpinfo); @@ -36,7 +37,8 @@ $phpinfo = str_replace('class="e"','class="forumheader2 text-left"',$phpinfo); $phpinfo = str_replace('class="v"','class="forumheader3 text-left"',$phpinfo); $phpinfo = str_replace('class="v"','class="forumheader3 text-left"',$phpinfo); $phpinfo = str_replace('class="h"','class="fcaption"',$phpinfo); -$phpinfo = str_replace('', '
', $phpinfo); +$phpinfo = preg_replace('/]*>/i', '
', $phpinfo); + $mes = e107::getMessage(); diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index d6acaf95a..b807467cf 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -109,7 +109,7 @@ class e_db_mysql global $pref, $db_defaultPrefix; - if(defined('e_PDO') && e_PDO === true) + if((PHP_MAJOR_VERSION > 6) || (defined('e_PDO') && e_PDO === true)) { $this->pdo = true; } diff --git a/install.php b/install.php index 4556828a3..283da9231 100644 --- a/install.php +++ b/install.php @@ -1256,12 +1256,12 @@ class e_install \$SYSTEM_DIRECTORY = '{$this->e107->e107_dirs['SYSTEM_DIRECTORY']}'; "; - +/* if($this->pdo == true) { $config_file .= 'define("e_PDO", true);'; $config_file .= "\n\n"; -} +}*/ $config_result = $this->write_config($config_file);