mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
remove change
This commit is contained in:
parent
11db748cc1
commit
aed6e96954
@ -66,7 +66,14 @@ if (! function_exists('_list')) {
|
|||||||
foreach ($list as $key => $val) {
|
foreach ($list as $key => $val) {
|
||||||
$out .= str_repeat(' ', $depth + 2) . '<li>';
|
$out .= str_repeat(' ', $depth + 2) . '<li>';
|
||||||
|
|
||||||
$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 .= "</li>\n";
|
$out .= "</li>\n";
|
||||||
}
|
}
|
||||||
@ -102,7 +109,11 @@ if (! function_exists('img')) {
|
|||||||
|
|
||||||
// Check for a relative URI
|
// Check for a relative URI
|
||||||
if (! preg_match('#^([a-z]+:)?//#i', $src['src']) && strpos($src['src'], 'data:') !== 0) {
|
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']);
|
unset($src['src']);
|
||||||
}
|
}
|
||||||
@ -192,7 +203,11 @@ if (! function_exists('script_tag')) {
|
|||||||
|
|
||||||
foreach ($src as $k => $v) {
|
foreach ($src as $k => $v) {
|
||||||
if ($k === 'src' && ! preg_match('#^([a-z]+:)?//#i', $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 {
|
} else {
|
||||||
// for attributes without values, like async or defer, use NULL.
|
// for attributes without values, like async or defer, use NULL.
|
||||||
$script .= $k . (null === $v ? ' ' : '="' . $v . '" ');
|
$script .= $k . (null === $v ? ' ' : '="' . $v . '" ');
|
||||||
@ -280,7 +295,13 @@ if (! function_exists('video')) {
|
|||||||
|
|
||||||
$video = '<video';
|
$video = '<video';
|
||||||
|
|
||||||
$video .= _has_protocol($src) ? ' src="' . $src . '"' : ($indexPage === true ? ' src="' . site_url($src) . '"' : ' src="' . slash_item('baseURL') . $src . '"');
|
if (_has_protocol($src)) {
|
||||||
|
$video .= ' src="' . $src . '"';
|
||||||
|
} elseif ($indexPage === true) {
|
||||||
|
$video .= ' src="' . site_url($src) . '"';
|
||||||
|
} else {
|
||||||
|
$video .= ' src="' . slash_item('baseURL') . $src . '"';
|
||||||
|
}
|
||||||
|
|
||||||
if ($attributes !== '') {
|
if ($attributes !== '') {
|
||||||
$video .= ' ' . $attributes;
|
$video .= ' ' . $attributes;
|
||||||
@ -320,7 +341,13 @@ if (! function_exists('audio')) {
|
|||||||
|
|
||||||
$audio = '<audio';
|
$audio = '<audio';
|
||||||
|
|
||||||
$audio .= _has_protocol($src) ? ' src="' . $src . '"' : ($indexPage === true ? ' src="' . site_url($src) . '"' : ' src="' . slash_item('baseURL') . $src . '"');
|
if (_has_protocol($src)) {
|
||||||
|
$audio .= ' src="' . $src . '"';
|
||||||
|
} elseif ($indexPage === true) {
|
||||||
|
$audio .= ' src="' . site_url($src) . '"';
|
||||||
|
} else {
|
||||||
|
$audio .= ' src="' . slash_item('baseURL') . $src . '"';
|
||||||
|
}
|
||||||
|
|
||||||
if ($attributes !== '') {
|
if ($attributes !== '') {
|
||||||
$audio .= ' ' . $attributes;
|
$audio .= ' ' . $attributes;
|
||||||
|
@ -387,7 +387,11 @@ if (! function_exists('word_wrap')) {
|
|||||||
|
|
||||||
// If $temp contains data it means we had to split up an over-length
|
// If $temp contains data it means we had to split up an over-length
|
||||||
// word into smaller chunks so we'll add it back to our current line
|
// word into smaller chunks so we'll add it back to our current line
|
||||||
$output .= $temp !== '' ? $temp . "\n" . $line . "\n" : $line . "\n";
|
if ($temp !== '') {
|
||||||
|
$output .= $temp . "\n" . $line . "\n";
|
||||||
|
} else {
|
||||||
|
$output .= $line . "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put our markers back
|
// Put our markers back
|
||||||
@ -426,7 +430,11 @@ if (! function_exists('ellipsize')) {
|
|||||||
$beg = mb_substr($str, 0, (int) floor($maxLength * $position));
|
$beg = mb_substr($str, 0, (int) floor($maxLength * $position));
|
||||||
$position = ($position > 1) ? 1 : $position;
|
$position = ($position > 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;
|
return $beg . $ellipsis . $end;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user