Update for humanReadableByteFormat, update edit.jq.js

edit.jq.js: remove deprecated function decodeHtmlEntities, use utils.js instead

update for humanReadableByteFormat to return non numeric first and then proceed with
the convert
This commit is contained in:
2026-05-27 09:00:48 +09:00
parent c467ed326c
commit 6c67ab6259
2 changed files with 62 additions and 62 deletions
+1
View File
@@ -1602,6 +1602,7 @@ function createNavMenu(nav_menu, header_id = 'mainHeader') // eslint-disable-lin
* HTML decode &something; entrie
* @param {string} str
* @returns string
* @deprecated use utils.js
*/
function decodeHtmlEntities(str) // eslint-disable-line no-unused-vars
{
+4 -5
View File
@@ -43,7 +43,10 @@ class Byte
public static function humanReadableByteFormat(string|int|float $bytes, int $flags = 0): string
{
// if not numeric, return as is
if (is_numeric($bytes)) {
if (!is_numeric($bytes)) {
// if anything other return as string
return (string)$bytes;
}
// flags bit wise check
// remove space between number and suffix
if ($flags & self::BYTE_FORMAT_NOSPACE) {
@@ -104,10 +107,6 @@ class Byte
} else {
return round($bytes_calc, 2) . $pre;
}
} else {
// if anything other return as string
return (string)$bytes;
}
}
/**