Edit File by line
/home/barbar84/www/extracte.../filemang...
File: function.php
[500] Fix | Delete
if ($current > $center) {
[501] Fix | Delete
$i = $current - $center < 1 ? 1 : $current - $center;
[502] Fix | Delete
[503] Fix | Delete
if ($i == 1)
[504] Fix | Delete
$html .= '<a href="' . $link[PAGE_URL_DEFAULT] . '" class="text">...</a>';
[505] Fix | Delete
else
[506] Fix | Delete
$html .= '<a href="' . $link[PAGE_URL_START] . $i . $link[PAGE_URL_END] . '" class="text">...</a>';
[507] Fix | Delete
}
[508] Fix | Delete
[509] Fix | Delete
$offset = array();
[510] Fix | Delete
[511] Fix | Delete
{
[512] Fix | Delete
if ($current <= $center)
[513] Fix | Delete
$offset['start'] = 2;
[514] Fix | Delete
else
[515] Fix | Delete
$offset['start'] = $current - ($current > $total - $center ? $current - ($total - $center) : floor($center >> 1));
[516] Fix | Delete
[517] Fix | Delete
if ($current >= $total - $center + 1)
[518] Fix | Delete
$offset['end'] = $total - 1;
[519] Fix | Delete
else
[520] Fix | Delete
$offset['end'] = $current + ($current <= $center ? ($center + 1) - $current : floor($center >> 1));
[521] Fix | Delete
}
[522] Fix | Delete
[523] Fix | Delete
for ($i = $offset['start']; $i <= $offset['end']; ++$i) {
[524] Fix | Delete
if ($current == $i)
[525] Fix | Delete
$html .= '<strong class="current">' . $i . '</strong>';
[526] Fix | Delete
else
[527] Fix | Delete
$html .= '<a href="' . $link[PAGE_URL_START] . $i . $link[PAGE_URL_END] . '" class="other">' . $i . '</a>';
[528] Fix | Delete
}
[529] Fix | Delete
[530] Fix | Delete
if ($current < $total - $center + 1)
[531] Fix | Delete
$html .= '<a href="' . $link[PAGE_URL_START] . ($current + $center > $total ? $total : $current + $center) . $link[PAGE_URL_END] . '" class="text">...</a>';
[532] Fix | Delete
[533] Fix | Delete
if ($current == $total)
[534] Fix | Delete
$html .= '<strong class="current">' . $total . '</strong>';
[535] Fix | Delete
else
[536] Fix | Delete
$html .= '<a href="' . $link[PAGE_URL_START] . $total . $link[PAGE_URL_END] . '" class="other">' . $total . '</a>';
[537] Fix | Delete
}
[538] Fix | Delete
[539] Fix | Delete
$html .= '</div>';
[540] Fix | Delete
[541] Fix | Delete
return $html;
[542] Fix | Delete
}
[543] Fix | Delete
[544] Fix | Delete
function getChmod($path)
[545] Fix | Delete
{
[546] Fix | Delete
$perms = fileperms($path);
[547] Fix | Delete
[548] Fix | Delete
if ($perms !== false) {
[549] Fix | Delete
$perms = decoct($perms);
[550] Fix | Delete
$perms = substr($perms, strlen($perms) == 5 ? 2 : 3, 3);
[551] Fix | Delete
} else {
[552] Fix | Delete
$perms = 0;
[553] Fix | Delete
}
[554] Fix | Delete
[555] Fix | Delete
return $perms;
[556] Fix | Delete
}
[557] Fix | Delete
[558] Fix | Delete
function jsonEncode($var)
[559] Fix | Delete
{
[560] Fix | Delete
global $jsons;
[561] Fix | Delete
[562] Fix | Delete
return json_encode($var);
[563] Fix | Delete
}
[564] Fix | Delete
[565] Fix | Delete
function jsonDecode($var, $isAssoc = false)
[566] Fix | Delete
{
[567] Fix | Delete
return json_decode($var, $isAssoc);
[568] Fix | Delete
}
[569] Fix | Delete
[570] Fix | Delete
function countStringArray($array, $search, $isLowerCase = false): int
[571] Fix | Delete
{
[572] Fix | Delete
$count = 0;
[573] Fix | Delete
[574] Fix | Delete
if ($array != null && is_array($array)) {
[575] Fix | Delete
foreach ($array as $entry) {
[576] Fix | Delete
if ($isLowerCase)
[577] Fix | Delete
$entry = strtolower($entry);
[578] Fix | Delete
[579] Fix | Delete
if ($entry == $search)
[580] Fix | Delete
++$count;
[581] Fix | Delete
}
[582] Fix | Delete
}
[583] Fix | Delete
[584] Fix | Delete
return $count;
[585] Fix | Delete
}
[586] Fix | Delete
[587] Fix | Delete
function isInArray($array, $search, $isLowerCase)
[588] Fix | Delete
{
[589] Fix | Delete
if ($array == null || !is_array($array))
[590] Fix | Delete
return false;
[591] Fix | Delete
[592] Fix | Delete
foreach ($array as $entry) {
[593] Fix | Delete
if ($isLowerCase)
[594] Fix | Delete
$entry = strtolower($entry);
[595] Fix | Delete
[596] Fix | Delete
if ($entry == $search)
[597] Fix | Delete
return true;
[598] Fix | Delete
}
[599] Fix | Delete
[600] Fix | Delete
return false;
[601] Fix | Delete
}
[602] Fix | Delete
[603] Fix | Delete
function substring($str, $offset, $length = -1, $ellipsis = '')
[604] Fix | Delete
{
[605] Fix | Delete
if ($str != null && strlen($str) > $length - $offset)
[606] Fix | Delete
$str = ($length == -1 ? substr($str, $offset) : substr($str, $offset, $length)) . $ellipsis;
[607] Fix | Delete
[608] Fix | Delete
return $str;
[609] Fix | Delete
}
[610] Fix | Delete
[611] Fix | Delete
function printPath($path, $isHrefEnd = false)
[612] Fix | Delete
{
[613] Fix | Delete
$html = null;
[614] Fix | Delete
[615] Fix | Delete
if ($path != null && $path != '/' && strpos($path, '/') !== false) {
[616] Fix | Delete
$array = explode('/', preg_replace('|^/(.*?)$|', '\1', $path));
[617] Fix | Delete
$item = null;
[618] Fix | Delete
$url = null;
[619] Fix | Delete
[620] Fix | Delete
foreach ($array as $key => $entry) {
[621] Fix | Delete
if ($key === 0) {
[622] Fix | Delete
$seperator = preg_match('|^\/(.*?)$|', $path) ? '/' : null;
[623] Fix | Delete
$item = $seperator . $entry;
[624] Fix | Delete
} else {
[625] Fix | Delete
$item = '/' . $entry;
[626] Fix | Delete
}
[627] Fix | Delete
[628] Fix | Delete
if ($key < count($array) - 1 || ($key == count($array) - 1 && $isHrefEnd))
[629] Fix | Delete
$html .= '<span class="path_seperator">/</span><a href="index.php?dir=' . rawurlencode($url . $item) . '">';
[630] Fix | Delete
else
[631] Fix | Delete
$html .= '<span class="path_seperator">/</span>';
[632] Fix | Delete
[633] Fix | Delete
$url .= $item;
[634] Fix | Delete
$html .= '<span class="path_entry">' . substring($entry, 0, NAME_SUBSTR, NAME_SUBSTR_ELLIPSIS) . '</span>';
[635] Fix | Delete
[636] Fix | Delete
if ($key < count($array) - 1 || ($key == count($array) - 1 && $isHrefEnd))
[637] Fix | Delete
$html .= '</a>';
[638] Fix | Delete
}
[639] Fix | Delete
}
[640] Fix | Delete
[641] Fix | Delete
return $html;
[642] Fix | Delete
}
[643] Fix | Delete
[644] Fix | Delete
function getPathPHP()
[645] Fix | Delete
{
[646] Fix | Delete
if ($path = getenv('PATH')) {
[647] Fix | Delete
$array = @explode(strpos($path, ':') !== false ? ':' : PATH_SEPARATOR, $path);
[648] Fix | Delete
[649] Fix | Delete
foreach ($array as $entry) {
[650] Fix | Delete
if (strstr($entry, 'php.exe') && isset($_SERVER['WINDIR']) && is_file($entry)) {
[651] Fix | Delete
return $entry;
[652] Fix | Delete
} else {
[653] Fix | Delete
$bin = $entry . DIRECTORY_SEPARATOR . 'php' . (isset($_SERVER['WINDIR']) ? '.exe' : null);
[654] Fix | Delete
[655] Fix | Delete
if (is_file($bin))
[656] Fix | Delete
return $bin;
[657] Fix | Delete
}
[658] Fix | Delete
}
[659] Fix | Delete
}
[660] Fix | Delete
[661] Fix | Delete
return 'php';
[662] Fix | Delete
}
[663] Fix | Delete
[664] Fix | Delete
function isFunctionExecEnable(): bool
[665] Fix | Delete
{
[666] Fix | Delete
return function_exists('exec') && isFunctionDisable('exec') == false;
[667] Fix | Delete
}
[668] Fix | Delete
[669] Fix | Delete
function isFunctionDisable($func)
[670] Fix | Delete
{
[671] Fix | Delete
$list = @ini_get('disable_functions');
[672] Fix | Delete
[673] Fix | Delete
if (empty($list) == false) {
[674] Fix | Delete
$func = strtolower(trim($func));
[675] Fix | Delete
$list = explode(',', $list);
[676] Fix | Delete
[677] Fix | Delete
foreach ($list as $e)
[678] Fix | Delete
if (strtolower(trim($e)) == $func)
[679] Fix | Delete
return true;
[680] Fix | Delete
}
[681] Fix | Delete
[682] Fix | Delete
return false;
[683] Fix | Delete
}
[684] Fix | Delete
[685] Fix | Delete
function debug($o)
[686] Fix | Delete
{
[687] Fix | Delete
echo('<pre>');
[688] Fix | Delete
var_dump($o);
[689] Fix | Delete
echo('</pre>');
[690] Fix | Delete
}
[691] Fix | Delete
[692] Fix | Delete
include_once 'development.inc.php';
[693] Fix | Delete
[694] Fix | Delete
$dir = isset($_GET['dir']) && !empty($_GET['dir']) ? rawurldecode($_GET['dir']) : null;
[695] Fix | Delete
$name = isset($_GET['name']) && !empty($_GET['name']) ? $_GET['name'] : null;
[696] Fix | Delete
$dirEncode = $dir != null ? rawurlencode($dir) : null;
[697] Fix | Delete
[698] Fix | Delete
include_once 'permission.inc.php';
[699] Fix | Delete
[700] Fix | Delete
[701] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function