php 7.4 deprecation-related fixes
This commit is contained in:
parent
e1ef122355
commit
565547f5a1
|
@ -1924,7 +1924,7 @@ class Feeds extends Handler_Protected {
|
||||||
$sum = 0;
|
$sum = 0;
|
||||||
|
|
||||||
for ($i = 0; $i < strlen($name); $i++) {
|
for ($i = 0; $i < strlen($name); $i++) {
|
||||||
$sum += ord($name{$i});
|
$sum += ord($name[$i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sum %= count($colormap);
|
$sum %= count($colormap);
|
||||||
|
|
|
@ -202,10 +202,13 @@ function _color_unpack($hex, $normalize = false) {
|
||||||
|
|
||||||
if (strpos($hex, '#') !== 0)
|
if (strpos($hex, '#') !== 0)
|
||||||
$hex = _resolve_htmlcolor($hex);
|
$hex = _resolve_htmlcolor($hex);
|
||||||
|
else
|
||||||
|
$hex = substr($hex, 1);
|
||||||
|
|
||||||
if (strlen($hex) == 4) {
|
if (strlen($hex) == 4) {
|
||||||
$hex = $hex[1] . $hex[1] . $hex[2] . $hex[2] . $hex[3] . $hex[3];
|
$hex = $hex[1] . $hex[1] . $hex[2] . $hex[2] . $hex[3] . $hex[3];
|
||||||
} $c = hexdec($hex);
|
}
|
||||||
|
$c = hexdec($hex);
|
||||||
for ($i = 16; $i >= 0; $i -= 8) {
|
for ($i = 16; $i >= 0; $i -= 8) {
|
||||||
$out[] = (($c >> $i) & 0xFF) / ($normalize ? 255 : 1);
|
$out[] = (($c >> $i) & 0xFF) / ($normalize ? 255 : 1);
|
||||||
} return $out;
|
} return $out;
|
||||||
|
|
Loading…
Reference in New Issue