diff options
author | Andrew Dolgov <[email protected]> | 2019-12-06 07:27:22 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-12-06 07:27:22 +0300 |
commit | 565547f5a19ff8af7e882bdb23b2a916a05e5b00 (patch) | |
tree | 07260f9ff88e7ca06e4053265dab3c18913f23fe | |
parent | e1ef122355228cbab272b2e386a6370084e66b10 (diff) |
php 7.4 deprecation-related fixes
-rwxr-xr-x | classes/feeds.php | 2 | ||||
-rw-r--r-- | include/colors.php | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/classes/feeds.php b/classes/feeds.php index bae571a3f..642e1dec3 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -1924,7 +1924,7 @@ class Feeds extends Handler_Protected { $sum = 0; for ($i = 0; $i < strlen($name); $i++) { - $sum += ord($name{$i}); + $sum += ord($name[$i]); } $sum %= count($colormap); diff --git a/include/colors.php b/include/colors.php index c441f7cb1..2ad958e94 100644 --- a/include/colors.php +++ b/include/colors.php @@ -202,10 +202,13 @@ function _color_unpack($hex, $normalize = false) { if (strpos($hex, '#') !== 0) $hex = _resolve_htmlcolor($hex); + else + $hex = substr($hex, 1); if (strlen($hex) == 4) { $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) { $out[] = (($c >> $i) & 0xFF) / ($normalize ? 255 : 1); } return $out; |