Edit File by line
/home/barbar84/www/extracte.../filemang...
File: function.php
<?php
[0] Fix | Delete
[1] Fix | Delete
[2] Fix | Delete
ob_start();
[3] Fix | Delete
[4] Fix | Delete
include 'pclzip.lib.php';
[5] Fix | Delete
{
[6] Fix | Delete
$require = [
[7] Fix | Delete
'curl_init',
[8] Fix | Delete
'filter_var',
[9] Fix | Delete
'json_encode',
[10] Fix | Delete
'json_decode',
[11] Fix | Delete
'getenv'
[12] Fix | Delete
];
[13] Fix | Delete
[14] Fix | Delete
foreach ($require as $function) {
[15] Fix | Delete
if (!function_exists($function)) {
[16] Fix | Delete
exit($function . ' not found');
[17] Fix | Delete
}
[18] Fix | Delete
}
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
[22] Fix | Delete
{
[23] Fix | Delete
$dir = getenv('SCRIPT_NAME');
[24] Fix | Delete
$dir = str_replace('\\', '/', $dir);
[25] Fix | Delete
$dir = strpos($dir, '/') !== false ? dirname($dir) : null;
[26] Fix | Delete
$dir = str_replace('\\', '/', $dir);
[27] Fix | Delete
$dir = $dir == '.' || $dir == '/' ? null : $dir;
[28] Fix | Delete
[29] Fix | Delete
$_SERVER['DOCUMENT_ROOT'] = realpath('.');
[30] Fix | Delete
$_SERVER['DOCUMENT_ROOT'] = $dir == null ? $_SERVER['DOCUMENT_ROOT'] : substr($_SERVER['DOCUMENT_ROOT'], 0, strlen($_SERVER['DOCUMENT_ROOT']) - strlen($dir));
[31] Fix | Delete
$_SERVER['DOCUMENT_ROOT'] = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
[32] Fix | Delete
[33] Fix | Delete
unset($dir);
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
define('REALPATH', realpath('./'));
[37] Fix | Delete
const PATH_CONFIG = __DIR__ . '/config.inc.php';
[38] Fix | Delete
const LOGIN_USERNAME_DEFAULT = 'Admin';
[39] Fix | Delete
const LOGIN_PASSWORD_DEFAULT = '12345';
[40] Fix | Delete
const PAGE_LIST_DEFAULT = 120;
[41] Fix | Delete
const PAGE_FILE_EDIT_DEFAULT = 120;
[42] Fix | Delete
const PAGE_FILE_EDIT_LINE_DEFAULT = 120;
[43] Fix | Delete
[44] Fix | Delete
const PAGE_NUMBER = 7;
[45] Fix | Delete
const PAGE_URL_DEFAULT = 'default';
[46] Fix | Delete
const PAGE_URL_START = 'start';
[47] Fix | Delete
const PAGE_URL_END = 'end';
[48] Fix | Delete
[49] Fix | Delete
const DEVELOPMENT = false;
[50] Fix | Delete
const NAME_SUBSTR = 8;
[51] Fix | Delete
const NAME_SUBSTR_ELLIPSIS = '...';
[52] Fix | Delete
[53] Fix | Delete
$configs = array();
[54] Fix | Delete
$jsons = null;
[55] Fix | Delete
[56] Fix | Delete
$pages = array(
[57] Fix | Delete
'current' => 1,
[58] Fix | Delete
'total' => 0,
[59] Fix | Delete
'paramater_0' => null,
[60] Fix | Delete
'paramater_1' => null
[61] Fix | Delete
);
[62] Fix | Delete
[63] Fix | Delete
$formats = array(
[64] Fix | Delete
'image' => array('png', 'ico', 'jpg', 'jpeg', 'gif', 'bmp'),
[65] Fix | Delete
'text' => array('cpp', 'css', 'csv', 'h', 'htaccess', 'html', 'java', 'js', 'lng', 'pas', 'php', 'pl', 'py', 'rb', 'rss', 'sh', 'svg', 'tpl', 'txt', 'xml', 'ini', 'cnf', 'config', 'conf', 'conv'),
[66] Fix | Delete
'archive' => array('7z', 'rar', 'tar', 'tarz', 'zip'),
[67] Fix | Delete
'audio' => array('acc', 'midi', 'mp3', 'mp4', 'swf', 'wav'),
[68] Fix | Delete
'font' => array('afm', 'bdf', 'otf', 'pcf', 'snf', 'ttf'),
[69] Fix | Delete
'binary' => array('pak', 'deb', 'dat'),
[70] Fix | Delete
'document' => array('pdf'),
[71] Fix | Delete
'source' => array('changelog', 'copyright', 'license', 'readme'),
[72] Fix | Delete
'zip' => array('zip', 'jar'),
[73] Fix | Delete
'other' => array('rpm', 'sql')
[74] Fix | Delete
);
[75] Fix | Delete
[76] Fix | Delete
[77] Fix | Delete
[78] Fix | Delete
function goURL($url)
[79] Fix | Delete
{
[80] Fix | Delete
header('Location:' . $url);
[81] Fix | Delete
exit(0);
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
function getPasswordEncode($pass): string
[85] Fix | Delete
{
[86] Fix | Delete
return md5(md5(trim($pass)));
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
function getFormat($name)
[90] Fix | Delete
{
[91] Fix | Delete
return strrchr($name, '.') !== false ? strtolower(str_replace('.', null, strrchr($name, '.'))) : null;
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
function isFormatText($name)
[95] Fix | Delete
{
[96] Fix | Delete
global $formats;
[97] Fix | Delete
[98] Fix | Delete
$format = getFormat($name);
[99] Fix | Delete
[100] Fix | Delete
if ($format == null)
[101] Fix | Delete
return false;
[102] Fix | Delete
[103] Fix | Delete
return in_array($format, $formats['text']) || in_array($format, $formats['other']) || in_array(strtolower(strpos($name, '.') !== false ? substr($name, 0, strpos($name, '.')) : $name), $formats['source']);
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
function isFormatUnknown($name)
[107] Fix | Delete
{
[108] Fix | Delete
global $formats;
[109] Fix | Delete
[110] Fix | Delete
$format = getFormat($name);
[111] Fix | Delete
[112] Fix | Delete
if ($format == null)
[113] Fix | Delete
return true;
[114] Fix | Delete
[115] Fix | Delete
foreach ($formats as $array)
[116] Fix | Delete
if (in_array($format, $array))
[117] Fix | Delete
return false;
[118] Fix | Delete
[119] Fix | Delete
return true;
[120] Fix | Delete
}
[121] Fix | Delete
[122] Fix | Delete
function isURL($url)
[123] Fix | Delete
{
[124] Fix | Delete
return filter_var($url, FILTER_VALIDATE_URL);
[125] Fix | Delete
}
[126] Fix | Delete
[127] Fix | Delete
function processDirectory($var)
[128] Fix | Delete
{
[129] Fix | Delete
$var = str_replace('\\', '/', $var);
[130] Fix | Delete
$var = preg_replace('#/\./#', '//', $var);
[131] Fix | Delete
$var = preg_replace('#/\.\./#', '//', $var);
[132] Fix | Delete
$var = preg_replace('#/\.{1,2}$#', '//', $var);
[133] Fix | Delete
$var = preg_replace('|/{2,}|', '/', $var);
[134] Fix | Delete
$var = preg_replace('|(.+?)/$|', '$1', $var);
[135] Fix | Delete
[136] Fix | Delete
return $var;
[137] Fix | Delete
}
[138] Fix | Delete
[139] Fix | Delete
function processImport($url)
[140] Fix | Delete
{
[141] Fix | Delete
if (!preg_match('|^http[s]?://(.+?)$|i', $url))
[142] Fix | Delete
$url = 'http://' . $url;
[143] Fix | Delete
[144] Fix | Delete
return $url;
[145] Fix | Delete
}
[146] Fix | Delete
[147] Fix | Delete
function processPathZip($var)
[148] Fix | Delete
{
[149] Fix | Delete
$var = str_replace('\\', '/', $var);
[150] Fix | Delete
$var = preg_replace('#/\./#', '//', $var);
[151] Fix | Delete
$var = preg_replace('#/\.\./#', '//', $var);
[152] Fix | Delete
$var = preg_replace('#/\.{1,2}$#', '//', $var);
[153] Fix | Delete
$var = preg_replace('|/{2,}|', '/', $var);
[154] Fix | Delete
$var = preg_replace('|/?(.+?)/?$|', '$1', $var);
[155] Fix | Delete
[156] Fix | Delete
return $var;
[157] Fix | Delete
}
[158] Fix | Delete
[159] Fix | Delete
function processName($var)
[160] Fix | Delete
{
[161] Fix | Delete
$var = str_replace('/', null, $var);
[162] Fix | Delete
$var = str_replace('\\', null, $var);
[163] Fix | Delete
[164] Fix | Delete
return $var;
[165] Fix | Delete
}
[166] Fix | Delete
[167] Fix | Delete
function isNameError($var): bool
[168] Fix | Delete
{
[169] Fix | Delete
return strpos($var, '\\') !== false || strpos($var, '/') !== false;
[170] Fix | Delete
}
[171] Fix | Delete
[172] Fix | Delete
function rrmdir($path)
[173] Fix | Delete
{
[174] Fix | Delete
$handler = @scandir($path);
[175] Fix | Delete
[176] Fix | Delete
if ($handler !== false) {
[177] Fix | Delete
foreach ($handler as $entry) {
[178] Fix | Delete
if ($entry != '.' && $entry != '..') {
[179] Fix | Delete
$pa = $path . '/' . $entry;
[180] Fix | Delete
[181] Fix | Delete
if (@is_file($pa)) {
[182] Fix | Delete
if (!@unlink($pa))
[183] Fix | Delete
return false;
[184] Fix | Delete
} elseif (@is_dir($pa)) {
[185] Fix | Delete
if (!rrmdir($pa))
[186] Fix | Delete
return false;
[187] Fix | Delete
} else {
[188] Fix | Delete
return false;
[189] Fix | Delete
}
[190] Fix | Delete
}
[191] Fix | Delete
}
[192] Fix | Delete
[193] Fix | Delete
return @rmdir($path);
[194] Fix | Delete
}
[195] Fix | Delete
[196] Fix | Delete
return false;
[197] Fix | Delete
}
[198] Fix | Delete
[199] Fix | Delete
function rrms($entrys, $dir)
[200] Fix | Delete
{
[201] Fix | Delete
foreach ($entrys as $e) {
[202] Fix | Delete
$pa = $dir . '/' . $e;
[203] Fix | Delete
[204] Fix | Delete
if (@is_file($pa)) {
[205] Fix | Delete
if (!@unlink($pa))
[206] Fix | Delete
return false;
[207] Fix | Delete
} elseif (@is_dir($pa)) {
[208] Fix | Delete
if (!rrmdir($pa))
[209] Fix | Delete
return false;
[210] Fix | Delete
} else {
[211] Fix | Delete
return false;
[212] Fix | Delete
}
[213] Fix | Delete
}
[214] Fix | Delete
[215] Fix | Delete
return true;
[216] Fix | Delete
}
[217] Fix | Delete
[218] Fix | Delete
function copydir($old, $new, $isParent = true)
[219] Fix | Delete
{
[220] Fix | Delete
$handler = @scandir($old);
[221] Fix | Delete
[222] Fix | Delete
if ($handler !== false) {
[223] Fix | Delete
if ($isParent && $old != '/') {
[224] Fix | Delete
$arr = explode('/', $old);
[225] Fix | Delete
$end = $new = $new . '/' . end($arr);
[226] Fix | Delete
[227] Fix | Delete
if (@is_file($end) || (!@is_dir($end) && !@mkdir($end)))
[228] Fix | Delete
return false;
[229] Fix | Delete
} elseif (!$isParent && !@is_dir($new) && !@mkdir($new)) {
[230] Fix | Delete
return false;
[231] Fix | Delete
}
[232] Fix | Delete
[233] Fix | Delete
foreach ($handler as $entry) {
[234] Fix | Delete
if ($entry != '.' && $entry != '..') {
[235] Fix | Delete
$paOld = $old . '/' . $entry;
[236] Fix | Delete
$paNew = $new . '/' . $entry;
[237] Fix | Delete
[238] Fix | Delete
if (@is_file($paOld)) {
[239] Fix | Delete
if (!@copy($paOld, $paNew))
[240] Fix | Delete
return false;
[241] Fix | Delete
} elseif (@is_dir($paOld)) {
[242] Fix | Delete
if (!copydir($paOld, $paNew, false))
[243] Fix | Delete
return false;
[244] Fix | Delete
} else {
[245] Fix | Delete
return false;
[246] Fix | Delete
}
[247] Fix | Delete
}
[248] Fix | Delete
}
[249] Fix | Delete
[250] Fix | Delete
return true;
[251] Fix | Delete
}
[252] Fix | Delete
[253] Fix | Delete
return false;
[254] Fix | Delete
}
[255] Fix | Delete
[256] Fix | Delete
function copys($entrys, $dir, $path)
[257] Fix | Delete
{
[258] Fix | Delete
foreach ($entrys as $e) {
[259] Fix | Delete
$pa = $dir . '/' . $e;
[260] Fix | Delete
[261] Fix | Delete
if (isPathNotPermission(processDirectory($path . '/' . $e))) {
[262] Fix | Delete
/* Entry not permission */
[263] Fix | Delete
} elseif (@is_file($pa)) {
[264] Fix | Delete
if (!@copy($pa, $path . '/' . $e))
[265] Fix | Delete
return false;
[266] Fix | Delete
} elseif (@is_dir($pa)) {
[267] Fix | Delete
if (!copydir($pa, $path))
[268] Fix | Delete
return false;
[269] Fix | Delete
} else {
[270] Fix | Delete
return false;
[271] Fix | Delete
}
[272] Fix | Delete
}
[273] Fix | Delete
[274] Fix | Delete
return true;
[275] Fix | Delete
}
[276] Fix | Delete
[277] Fix | Delete
function movedir($old, $new, $isParent = true)
[278] Fix | Delete
{
[279] Fix | Delete
$handler = @scandir($old);
[280] Fix | Delete
[281] Fix | Delete
if ($handler !== false) {
[282] Fix | Delete
if ($isParent && $old != '/') {
[283] Fix | Delete
$s = explode('/', $old);
[284] Fix | Delete
$end = $new = $new . '/' . end($s);
[285] Fix | Delete
[286] Fix | Delete
if (@is_file($end) || (!@is_dir($end) && !@mkdir($end)))
[287] Fix | Delete
return false;
[288] Fix | Delete
} elseif (!$isParent && !@is_dir($new) && !@mkdir($new)) {
[289] Fix | Delete
return false;
[290] Fix | Delete
}
[291] Fix | Delete
[292] Fix | Delete
foreach ($handler as $entry) {
[293] Fix | Delete
if ($entry != '.' && $entry != '..') {
[294] Fix | Delete
$paOld = $old . '/' . $entry;
[295] Fix | Delete
$paNew = $new . '/' . $entry;
[296] Fix | Delete
[297] Fix | Delete
if (@is_file($paOld)) {
[298] Fix | Delete
if (!@copy($paOld, $paNew))
[299] Fix | Delete
return false;
[300] Fix | Delete
[301] Fix | Delete
@unlink($paOld);
[302] Fix | Delete
} elseif (@is_dir($paOld)) {
[303] Fix | Delete
if (!movedir($paOld, $paNew, false))
[304] Fix | Delete
return false;
[305] Fix | Delete
} else {
[306] Fix | Delete
return false;
[307] Fix | Delete
}
[308] Fix | Delete
}
[309] Fix | Delete
}
[310] Fix | Delete
[311] Fix | Delete
return @rmdir($old);
[312] Fix | Delete
}
[313] Fix | Delete
[314] Fix | Delete
return false;
[315] Fix | Delete
}
[316] Fix | Delete
[317] Fix | Delete
function moves($entrys, $dir, $path)
[318] Fix | Delete
{
[319] Fix | Delete
foreach ($entrys as $e) {
[320] Fix | Delete
$pa = $dir . '/' . $e;
[321] Fix | Delete
[322] Fix | Delete
if (isPathNotPermission(processDirectory($path . '/' . $e))) {
[323] Fix | Delete
/* Entry not permission */
[324] Fix | Delete
} elseif (@is_file($pa)) {
[325] Fix | Delete
if (!@copy($pa, $path . '/' . $e))
[326] Fix | Delete
return false;
[327] Fix | Delete
[328] Fix | Delete
@unlink($pa);
[329] Fix | Delete
} elseif (@is_dir($pa)) {
[330] Fix | Delete
if (!movedir($pa, $path))
[331] Fix | Delete
return false;
[332] Fix | Delete
} else {
[333] Fix | Delete
return false;
[334] Fix | Delete
}
[335] Fix | Delete
}
[336] Fix | Delete
[337] Fix | Delete
return true;
[338] Fix | Delete
}
[339] Fix | Delete
[340] Fix | Delete
function zipdir($path, $file, $isDelete = false)
[341] Fix | Delete
{
[342] Fix | Delete
[343] Fix | Delete
[344] Fix | Delete
if (@is_file($file))
[345] Fix | Delete
@unlink($file);
[346] Fix | Delete
[347] Fix | Delete
$zip = new PclZip($file);
[348] Fix | Delete
[349] Fix | Delete
if ($zip->add($path, PCLZIP_OPT_REMOVE_PATH, $path)) {
[350] Fix | Delete
if ($isDelete)
[351] Fix | Delete
rrmdir($path);
[352] Fix | Delete
[353] Fix | Delete
return true;
[354] Fix | Delete
}
[355] Fix | Delete
[356] Fix | Delete
return false;
[357] Fix | Delete
}
[358] Fix | Delete
[359] Fix | Delete
function zips($dir, $entrys, $file, $isDelete = false)
[360] Fix | Delete
{
[361] Fix | Delete
[362] Fix | Delete
[363] Fix | Delete
if (@is_file($file))
[364] Fix | Delete
@unlink($file);
[365] Fix | Delete
[366] Fix | Delete
$zip = new PclZip($file);
[367] Fix | Delete
[368] Fix | Delete
foreach ($entrys as $e)
[369] Fix | Delete
if (!$zip->add($dir . '/' . $e, PCLZIP_OPT_REMOVE_PATH, $dir))
[370] Fix | Delete
return false;
[371] Fix | Delete
[372] Fix | Delete
if ($isDelete)
[373] Fix | Delete
rrms($entrys, $dir);
[374] Fix | Delete
[375] Fix | Delete
return true;
[376] Fix | Delete
}
[377] Fix | Delete
[378] Fix | Delete
function chmods($dir, $entrys, $folder, $file)
[379] Fix | Delete
{
[380] Fix | Delete
$folder = intval($folder, 8);
[381] Fix | Delete
$file = intval($file, 8);
[382] Fix | Delete
[383] Fix | Delete
foreach ($entrys as $e) {
[384] Fix | Delete
$path = $dir . '/' . $e;
[385] Fix | Delete
[386] Fix | Delete
if (@is_file($path)) {
[387] Fix | Delete
if (!@chmod($path, $file))
[388] Fix | Delete
return false;
[389] Fix | Delete
} elseif (@is_dir($path)) {
[390] Fix | Delete
if (!@chmod($path, $folder))
[391] Fix | Delete
return false;
[392] Fix | Delete
} else {
[393] Fix | Delete
return false;
[394] Fix | Delete
}
[395] Fix | Delete
}
[396] Fix | Delete
[397] Fix | Delete
return true;
[398] Fix | Delete
}
[399] Fix | Delete
[400] Fix | Delete
function size($size)
[401] Fix | Delete
{
[402] Fix | Delete
if ($size < 1024)
[403] Fix | Delete
$size = $size . 'B';
[404] Fix | Delete
elseif ($size < 1048576)
[405] Fix | Delete
$size = round($size / 1024, 2) . 'KB';
[406] Fix | Delete
elseif ($size < 1073741824)
[407] Fix | Delete
$size = round($size / 1048576, 2) . 'MB';
[408] Fix | Delete
else
[409] Fix | Delete
$size = round($size / 1073741824, 2) . 'GB';
[410] Fix | Delete
[411] Fix | Delete
return $size;
[412] Fix | Delete
}
[413] Fix | Delete
[414] Fix | Delete
function grab($url, $ref = '', $cookie = '', $user_agent = '', $header = '')
[415] Fix | Delete
{
[416] Fix | Delete
$ch = curl_init();
[417] Fix | Delete
[418] Fix | Delete
$headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
[419] Fix | Delete
$headers[] = 'Accept-Language: en-us,en;q=0.5';
[420] Fix | Delete
$headers[] = 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7';
[421] Fix | Delete
$headers[] = 'Keep-Alive: 300';
[422] Fix | Delete
$headers[] = 'Connection: Keep-Alive';
[423] Fix | Delete
$headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8';
[424] Fix | Delete
[425] Fix | Delete
curl_setopt($ch, CURLOPT_URL, $url);
[426] Fix | Delete
[427] Fix | Delete
if ($user_agent)
[428] Fix | Delete
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
[429] Fix | Delete
else
[430] Fix | Delete
curl_setopt($ch, CURLOPT_USERAGENT, 'Nokia3110c/2.0 (04.91) Profile/MIDP-2.0 Configuration/CLDC-1.1');
[431] Fix | Delete
[432] Fix | Delete
if ($header)
[433] Fix | Delete
curl_setopt($ch, CURLOPT_HEADER, 1);
[434] Fix | Delete
else
[435] Fix | Delete
curl_setopt($ch, CURLOPT_HEADER, 0);
[436] Fix | Delete
[437] Fix | Delete
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
[438] Fix | Delete
[439] Fix | Delete
if ($ref)
[440] Fix | Delete
curl_setopt($ch, CURLOPT_REFERER, $ref);
[441] Fix | Delete
else
[442] Fix | Delete
curl_setopt($ch, CURLOPT_REFERER, 'http://www.google.com.vn/search?hl=vi&client=firefox-a&rls=org.mozilla:en-US:official&hs=hKS&q=video+clip&start=20&sa=N');
[443] Fix | Delete
[444] Fix | Delete
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
[445] Fix | Delete
[446] Fix | Delete
if (strncmp($url, 'https', 6))
[447] Fix | Delete
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
[448] Fix | Delete
[449] Fix | Delete
if ($cookie)
[450] Fix | Delete
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
[451] Fix | Delete
[452] Fix | Delete
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
[453] Fix | Delete
[454] Fix | Delete
$html = curl_exec($ch);
[455] Fix | Delete
$mess_error = curl_error($ch);
[456] Fix | Delete
[457] Fix | Delete
curl_close($ch);
[458] Fix | Delete
[459] Fix | Delete
return $html;
[460] Fix | Delete
}
[461] Fix | Delete
[462] Fix | Delete
function import($url, $path)
[463] Fix | Delete
{
[464] Fix | Delete
$binarys = grab($url);
[465] Fix | Delete
[466] Fix | Delete
if (!file_put_contents($path, $binarys)) {
[467] Fix | Delete
@unlink($path);
[468] Fix | Delete
return false;
[469] Fix | Delete
}
[470] Fix | Delete
[471] Fix | Delete
return true;
[472] Fix | Delete
}
[473] Fix | Delete
[474] Fix | Delete
function page($current, $total, $url): string
[475] Fix | Delete
{
[476] Fix | Delete
$html = '<div class="page">';
[477] Fix | Delete
$center = PAGE_NUMBER - 2;
[478] Fix | Delete
$link = array();
[479] Fix | Delete
$link[PAGE_URL_DEFAULT] = $url[PAGE_URL_DEFAULT] ?? null;
[480] Fix | Delete
$link[PAGE_URL_START] = $url[PAGE_URL_START] ?? null;
[481] Fix | Delete
$link[PAGE_URL_END] = $url[PAGE_URL_END] ?? null;
[482] Fix | Delete
[483] Fix | Delete
if ($total <= PAGE_NUMBER) {
[484] Fix | Delete
for ($i = 1; $i <= $total; ++$i) {
[485] Fix | Delete
if ($current == $i) {
[486] Fix | Delete
$html .= '<strong class="current">' . $i . '</strong>';
[487] Fix | Delete
} else {
[488] Fix | Delete
if ($i == 1)
[489] Fix | Delete
$html .= '<a href="' . $link[PAGE_URL_DEFAULT] . '" class="other">' . $i . '</a>';
[490] Fix | Delete
else
[491] Fix | Delete
$html .= '<a href="' . $link[PAGE_URL_START] . $i . $link[PAGE_URL_END] . '" class="other">' . $i . '</a>';
[492] Fix | Delete
}
[493] Fix | Delete
}
[494] Fix | Delete
} else {
[495] Fix | Delete
if ($current == 1)
[496] Fix | Delete
$html .= '<strong class="current">1</strong>';
[497] Fix | Delete
else
[498] Fix | Delete
$html .= '<a href="' . $link[PAGE_URL_DEFAULT] . '" class="other">1</a>';
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function