From aed6e969546534c4730bd86be3234f02deac0bdb Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean Date: Sat, 10 Feb 2024 20:37:50 +0700 Subject: [PATCH] remove change --- system/Helpers/html_helper.php | 37 +++++++++++++++++++++++++++++----- system/Helpers/text_helper.php | 12 +++++++++-- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/system/Helpers/html_helper.php b/system/Helpers/html_helper.php index 8fd4231dc9..0f7e154a02 100755 --- a/system/Helpers/html_helper.php +++ b/system/Helpers/html_helper.php @@ -66,7 +66,14 @@ if (! function_exists('_list')) { foreach ($list as $key => $val) { $out .= str_repeat(' ', $depth + 2) . '
  • '; - $out .= ! is_array($val) ? $val : $key . "\n" . _list($type, $val, '', $depth + 4) . str_repeat(' ', $depth + 2); + if (! is_array($val)) { + $out .= $val; + } else { + $out .= $key + . "\n" + . _list($type, $val, '', $depth + 4) + . str_repeat(' ', $depth + 2); + } $out .= "
  • \n"; } @@ -102,7 +109,11 @@ if (! function_exists('img')) { // Check for a relative URI if (! preg_match('#^([a-z]+:)?//#i', $src['src']) && strpos($src['src'], 'data:') !== 0) { - $img .= $indexPage === true ? ' src="' . site_url($src['src']) . '"' : ' src="' . slash_item('baseURL') . $src['src'] . '"'; + if ($indexPage === true) { + $img .= ' src="' . site_url($src['src']) . '"'; + } else { + $img .= ' src="' . slash_item('baseURL') . $src['src'] . '"'; + } unset($src['src']); } @@ -192,7 +203,11 @@ if (! function_exists('script_tag')) { foreach ($src as $k => $v) { if ($k === 'src' && ! preg_match('#^([a-z]+:)?//#i', $v)) { - $script .= $indexPage === true ? 'src="' . site_url($v) . '" ' : 'src="' . slash_item('baseURL') . $v . '" '; + if ($indexPage === true) { + $script .= 'src="' . site_url($v) . '" '; + } else { + $script .= 'src="' . slash_item('baseURL') . $v . '" '; + } } else { // for attributes without values, like async or defer, use NULL. $script .= $k . (null === $v ? ' ' : '="' . $v . '" '); @@ -280,7 +295,13 @@ if (! function_exists('video')) { $video = ' 1) ? 1 : $position; - $end = $position === 1 ? mb_substr($str, 0, -($maxLength - mb_strlen($beg))) : mb_substr($str, -($maxLength - mb_strlen($beg))); + if ($position === 1) { + $end = mb_substr($str, 0, -($maxLength - mb_strlen($beg))); + } else { + $end = mb_substr($str, -($maxLength - mb_strlen($beg))); + } return $beg . $ellipsis . $end; }