xtaz
December 4, 2019, 11:55am
1
I know you’ll probably shout at me for being a hipster and running a bleeding edge .0 release of PHP. But I thought I would just report a couple of things so that you are aware and before other people come asking about it.
TTRSS works perfectly fine with 7.4.0 with two exceptions.
The favicon color script appears to be broken and none of the feeds have colors any longer. There is an error logged in the console on every feed update which is E_DEPRECATED. It looks like hexdec on line 208 of colors.php is getting some input that it doesn’t like. I’m assuming it’s the # character.
Invalid characters passed for attempted conversion, these have been ignored
include/colors.php(208): hexdec(#cc66cc )
classes/feeds.php(371): _color_unpack(#cc66cc )
classes/feeds.php(557): format_headlines_list(-3, ForceUpdate, adaptive, 30, , 0, , 1, , , default)
backend.php(123): view()
The other issue is this line is being logged in my PHP error log.
PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /www/ttrss/backend.php on line 7
fox
December 4, 2019, 12:34pm
2
hexdec() likely expects a hex triplet without #, which makes sense. i’ll make a note to take a look at this unless someone files a PR first.
we only call it to ensure it is disabled, i think. i’m not sure if this is really needed anymore tbh.
I was gonna take a look at this and re-registered on your Gogs; tried to fork but it said I had hit the limit (0); When you get a chance, can you do the needful? Gogs account is tsimmons ?
Thanks &
Cheers.
fox
December 5, 2019, 3:20am
4
tsimmons:
do the needful
the needful should be done now
Awesome, thanks! And of course today I’m slammed and cannot get to it.
My event log has been spammed with this E_DEPRECATED warning since I upgraded to php 7.4:
Array and string offset access syntax with curly braces is deprecated
1. include/autoload.php(24): ttrss_error_handler(8192, Array and string offset access syntax with curly braces is deprecated, classes/feeds.php, 1927, Array)
2. include/autoload.php(24): include()
3. classes/rssutils.php(1580): spl_autoload_call(Feeds)
4. classes/rssutils.php(543): load_filters(17, 2)
5. classes/rssutils.php(148): update_rss_feed(17, 1, )
6. update.php(250): update_daemon_common(50)
e: I noticed the mention of filters in the backtrace, some of my filters use “match any rule”, if that helps.
fox
December 6, 2019, 4:24am
7
i’m not even sure why is this using { }
this is ancient code though.
fox
December 6, 2019, 4:28am
8
xtaz:
hexdec
evildarkarchon:
curly braces
this should deal with both, i think:
https://git.tt-rss.org/fox/tt-rss/commit/565547f5a19ff8af7e882bdb23b2a916a05e5b00
tell me if i broke anything.
e: i’ve also removed that magic quote thing entirely. apparently it didn’t do anything since php 5.4 anyway so it was only there because nobody bothered to ask for its removal.
xtaz
December 6, 2019, 2:20pm
9
Updated. Warnings have gone away. Nothing seems broken. Thanks
skibbi
March 2, 2020, 1:44pm
10
Sorry for potential hijacking the thread, but I recenty upgraded to PHP 7.4 and I’m getting this:
Array and string offset access syntax with curly braces is deprecated1. plugins/af_comics/filters/af_comics_gocomics.php(34): ttrss_error_handler(8192, Array and string offset access syntax with curly braces is deprecated, lib/MiniTemplator.class.php, 888, Array)
2. plugins/af_comics/filters/af_comics_gocomics.php(34): require_once()
3. plugins/af_comics/init.php(89): on_fetch(https://www.gocomics.com/wumo)
4. classes/rssutils.php(345): hook_fetch_feed(, https://www.gocomics.com/wumo, 1, 68, 0, , )
5. classes/rssutils.php(148): update_rss_feed(68, 1, )
6. update.php(250): update_daemon_common(50)
fox
March 2, 2020, 2:22pm
11
minitemplator is unmaintained i think. i don’t care much for bleeding edge software, so if someone wants to fix it, be my guest. otherwise this will have to wait until i’m bored enough to take a look at this.
e: its very likely going to be a trivially easy fix tho
skibbi
March 3, 2020, 10:40am
12
I think this fixed the issue on my instance. However I’m not sure if you plan to drop MiniTemplator so here is the diff:
diff --git a/lib/MiniTemplator.class.php b/lib/MiniTemplator.class.php
index e70f0a470..1eb1c3bed 100644
--- a/lib/MiniTemplator.class.php
+++ b/lib/MiniTemplator.class.php
@@ -309,7 +309,7 @@ function processTemplateCommand ($cmdL, $cmdTPosBegin, $cmdTPosEnd, &$resumeFrom
$resumeFromStart = true;
break;
default:
- if ($cmd{0} == '$' && !(strlen($cmd) >= 2 && $cmd{1} == '{')) {
+ if ($cmd{0} == '$' && !(strlen($cmd) >= 2 && $cmd[1] == '{')) {
$this->triggerError ("Unknown command \"$cmd\" in template at offset $cmdTPosBegin.");
return false; }}
return true; }
@@ -856,10 +856,10 @@ function readFileIntoString ($fileName, &$s) {
*/
function parseWord ($s, &$p, &$w) {
$sLen = strlen($s);
- while ($p < $sLen && ord($s{$p}) <= 32) $p++;
+ while ($p < $sLen && ord($s[$p]) <= 32) $p++;
if ($p >= $sLen) return false;
$p0 = $p;
- while ($p < $sLen && ord($s{$p}) > 32) $p++;
+ while ($p < $sLen && ord($s[$p]) > 32) $p++;
$w = substr($s, $p0, $p - $p0);
return true; }
@@ -869,11 +869,11 @@ function parseWord ($s, &$p, &$w) {
*/
function parseQuotedString ($s, &$p, &$w) {
$sLen = strlen($s);
- while ($p < $sLen && ord($s{$p}) <= 32) $p++;
+ while ($p < $sLen && ord($s[$p]) <= 32) $p++;
if ($p >= $sLen) return false;
if (substr($s,$p,1) != '"') return false;
$p++; $p0 = $p;
- while ($p < $sLen && $s{$p} != '"') $p++;
+ while ($p < $sLen && $s[$p] != '"') $p++;
if ($p >= $sLen) return false;
$w = substr($s, $p0, $p - $p0);
$p++;
@@ -885,7 +885,7 @@ function parseQuotedString ($s, &$p, &$w) {
*/
function parseWordOrQuotedString ($s, &$p, &$w) {
$sLen = strlen($s);
- while ($p < $sLen && ord($s{$p}) <= 32) $p++;
+ while ($p < $sLen && ord($s[$p]) <= 32) $p++;
if ($p >= $sLen) return false;
if (substr($s,$p,1) == '"')
return $this->parseQuotedString($s,$p,$w);
e: I think there are few more places to fix
e2: I don’t see any more errors in my logs
fox
March 3, 2020, 11:33am
13
like i said, this is basically search and replace. can you file a PR?
skibbi
March 4, 2020, 9:12am
14
Can you grant me access to git? Username: skibbi
skibbi
March 13, 2020, 10:58pm
18
fox
March 14, 2020, 12:44pm
20
lol
thanks for the PR but since i did essentially same changes already it can’t be merged.