From 3d78256104ffb3623eff11d78086ea3edb184ccc Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 12 Jan 2014 05:34:48 -0800 Subject: [PATCH] BC fixes for admin-log detail rendering. --- class2.php | 2 ++ e107_admin/admin_log.php | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/class2.php b/class2.php index 4119392da..840b1dfe1 100644 --- a/class2.php +++ b/class2.php @@ -680,6 +680,8 @@ if (isset($pref['modules']) && $pref['modules']) { } */ +$sql->db_Mark_Time('Start: Load Plugin Modules'); + $js_body_onload = array(); // Initialise this array in case a module wants to add to it // Load e_modules after all the constants, but before the themes, so they can be put to use. diff --git a/e107_admin/admin_log.php b/e107_admin/admin_log.php index 9a5d3cf85..dbf45fc50 100644 --- a/e107_admin/admin_log.php +++ b/e107_admin/admin_log.php @@ -548,13 +548,24 @@ class admin_log_form_ui extends e_admin_form_ui $text = preg_replace_callback("#\[!(\w+?)(=.+?){0,1}!]#", 'log_process', $curVal); $text = $tp->toHtml($text); - if(strpos($text,'Array')!==false) + if(strpos($text,'Array')!==false || strlen($text)>300) { $id = $this->getController()->getListModel()->get('dblog_id'); $ret ="Details"; $ret .= "
"; $text = str_replace("
","\n",$text); $text = str_replace("\","/",$text); + + if(substr($text,0,2) == '\n') // cleanup (not sure of the cause) + { + $text = substr($text,2); + } + + if(substr($text,-2) == '\n') // cleanup (not sure of the cause) + { + $text = substr($text,0,-2); + } + $text = print_a($text,true); $ret .= $text; $ret .= "
";