Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2019.03] PHP Warnings #6337

Closed
5 tasks done
MrPetovan opened this issue Dec 28, 2018 · 32 comments · Fixed by #6797
Closed
5 tasks done

[2019.03] PHP Warnings #6337

MrPetovan opened this issue Dec 28, 2018 · 32 comments · Fixed by #6797
Labels
Milestone

Comments

@MrPetovan
Copy link
Collaborator

MrPetovan commented Dec 28, 2018

@MrPetovan
Copy link
Collaborator Author

MrPetovan commented Dec 28, 2018

Moved from #5911 (comment)

PHP Warning: Illegal string offset 'created' in /src/Worker/Notifier.php on line 148

Fixed in #6504

@ghost ghost mentioned this issue Dec 28, 2018
14 tasks
@MrPetovan MrPetovan added the Bug label Dec 29, 2018
@MrPetovan MrPetovan added this to the 2019.03 milestone Dec 29, 2018
@MrPetovan MrPetovan changed the title [2019.04] PHP Warnings [2019.03] PHP Warnings Jan 5, 2019
@MrPetovan MrPetovan pinned this issue Jan 19, 2019
@fabrixxm
Copy link
Collaborator

fabrixxm commented Jan 22, 2019

PHP Warning: A non-numeric value encountered in /home/kirgroup/htdocs/www/src/Core/Update.php on line 102

Fixed in #6728

@ghost
Copy link

ghost commented Jan 24, 2019

PHP Warning: proc_close() has been disabled for security reasons in /friendica/src/App.php on line 1179\n', referer: https://xoyon.net/network

@MrPetovan
Copy link
Collaborator Author

proc_close() is disabled but not proc_open?

@ghost
Copy link

ghost commented Jan 25, 2019

proc_close() is disabled but not proc_open?

Yes proc_close is disabled by default and I activated proc_open because it is supposed to be used by Friendica.

@MrPetovan
Copy link
Collaborator Author

Oh, please enable it as well then if you can.

@ghost
Copy link

ghost commented Jan 25, 2019

Just happened ...

@ghost
Copy link

ghost commented Jan 25, 2019

PHP Warning:  file_put_contents( /friendica/proxy/https://MELD.de/photo/64749034215ac74fd0ba0bd144670564-5.png?ts=1530922563:thumb): failed to open stream: No such file or directory in /friendica/src/Module/Proxy.php on line 137\n'
 PHP Warning:  require( /friendica/vendor/composer/../divineomega/password_exposed/src/PasswordExposedFunction.php): failed to open stream: No such file or directory in /friendica/vendor/composer/autoload_real.php on line 70\n', referer: https://meld.de/search?search=openstreetmap&save=Save
 PHP Warning:  require( /friendica/vendor/composer/../divineomega/password_exposed/src/PasswordExposedFunction.php): failed to open stream: No such file or directory in /friendica/vendor/composer/autoload_real.php on line 70\n', referer: https://meld.de/profile/chebourne

@MrPetovan
Copy link
Collaborator Author

Please run bin/composer.phar install --no-dev.

@ghost
Copy link

ghost commented Jan 26, 2019

PHP Warning:  Friendica\\Content\\Text\\HTML::toPlaintext(): unterminated entity reference A
"option to ask questions! \r \\*\xc2\xa0Learn by doing - Take advantage of Scrimba by frequently pausing the lesson and playing with the code. Then try to build things from your own computer using the stuff you just learned. And don\xca\xbct skip the practices! \r \\*\xc2\xa0Spaced learning and repetition is key - Give yourself time (days/weeks) to finish this course, and include lots of breaks. Don\xca\xbct try cramming it all in. "
in /friendica/src/Content/Text/HTML.php on line 584\n'`

@ghost
Copy link

ghost commented Jan 27, 2019

PHP Warning:  file_put_contents(/friendica/proxy/https://MELD.de/photo/1d8e353ef6b1cb6d8afacc69d93cfbea-5.png?ts=1531126166): failed to open stream: No such file or directory in /friendica/src/Module/Proxy.php on line 119\n
PHP Warning:  file_put_contents(/friendica/proxy/https://MELD.de/photo/1d8e353ef6b1cb6d8afacc69d93cfbea-5.png?ts=1531126166:thumb): failed to open stream: No such file or directory in /friendica/src/Module/Proxy.php on line 137\n'

@MrPetovan
Copy link
Collaborator Author

Have you switched storage backend on your node?

@ghost
Copy link

ghost commented Jan 27, 2019

Have you switched storage backend on your node?

No, just done a git pull today, but i deleted some users

@ghost
Copy link

ghost commented Jan 28, 2019

PHP Warning:  htmlspecialchars() expects parameter 1 to be string, array given in /friendica/view/smarty3/compiled/462ab9a1cdb3e7813101b547424e5eb5280f8d61_2.file.wall_thread.tpl.php on line 40
PHP Warning:  htmlspecialchars() expects parameter 1 to be string, array given in /friendica/view/smarty3/compiled/462ab9a1cdb3e7813101b547424e5eb5280f8d61_2.file.wall_thread.tpl.php on line 45

@ghost
Copy link

ghost commented Jan 28, 2019

PHP Warning: openssl_private_decrypt(): key parameter is not a valid private key in /friendica/src/Protocol/DFRN.php on line 1294 
PHP Warning: openssl_private_decrypt(): key parameter is not a valid private key in /friendica/src/Protocol/DFRN.php on line 1295 

@MrPetovan
Copy link
Collaborator Author

For #6337 (comment), can you please attach the relevant lines of the compiled Smarty file?

@fabrixxm
Copy link
Collaborator

first I would try to clear smarty3 compiled files. just to be sure they are up to date...

@MrPetovan
Copy link
Collaborator Author

I don't think it's a stale cache issue, from my experience files are recompiled immediately after source template files have been changed.

@ghost
Copy link

ghost commented Feb 6, 2019

PHP Warning: openssl_private_decrypt(): key parameter is not a valid private key in /friendica/src/Protocol/DFRN.php on line 1294
PHP Warning: openssl_private_decrypt(): key parameter is not a valid private key in /friendica/src/Protocol/DFRN.php on line 1295

If this message comes then the page is not accessible.

@MrPetovan
Copy link
Collaborator Author

Without a full trace this is impossible to debug, unless you have a specific page where this happens all the time.

@rabuzarus
Copy link
Collaborator

rabuzarus commented Feb 6, 2019

Since 3 years I want to report that my php.out is very often full with
[06-Feb-2019 15:13:32 Europe/Berlin] PHP Warning: Illegal string offset 'share' in /var/www/vhosts/hosting107240.a2f21.netcup.net/httpdocs/friendica/view/smarty3/compiled/2f2d2313a8a2fa1c6b3dce7e39b2642b6267c76f_2.file.wall_thread.tpl.php on line 156

@AlfredSK
Copy link

AlfredSK commented Feb 24, 2019

A brand new warning:

PHP Fatal error:  Uncaught Error: Class 'Friendica\Model\Logger' not found in ..../src/Model/Term.php:223

Fixed in #6751

@MrPetovan
Copy link
Collaborator Author

That's a fatal error, not a warning => #6386

@AlfredSK
Copy link

Oops.

@AlfredSK
Copy link

AlfredSK commented Feb 25, 2019

But this time it is a warning:

PHP Warning:  strlen() expects parameter 1 to be string, array given in .../mod/network.php on line 553

Fixed by #6792

@MrPetovan
Copy link
Collaborator Author

I'm pleasantly surprised by your newfound ability to stop trying to put a round peg in a square hole!

@MrPetovan
Copy link
Collaborator Author

PHP Warning:  htmlspecialchars() expects parameter 1 to be string, array given in /friendica/view/smarty3/compiled/462ab9a1cdb3e7813101b547424e5eb5280f8d61_2.file.wall_thread.tpl.php on line 40
PHP Warning:  htmlspecialchars() expects parameter 1 to be string, array given in /friendica/view/smarty3/compiled/462ab9a1cdb3e7813101b547424e5eb5280f8d61_2.file.wall_thread.tpl.php on line 45

@copiis I don't have the same compiled version of wall_thread.tpl as you do, you'll have to provide your own version for us to be able to fix this. the origin theme is also important.

@AlfredSK
Copy link

AlfredSK commented Mar 1, 2019

Look! A warning.

PHP Warning:  count(): Parameter must be an array or an object that implements Countable in .../include/api.php on line 956

Fixed by #6789

MrPetovan added a commit to MrPetovan/friendica that referenced this issue Mar 2, 2019
- Improve SQL query for network contacts
- Add missing query statement closure
- Addresses friendica#6337 (comment)
@AlfredSK
Copy link

AlfredSK commented Mar 7, 2019

Here's another one:

PHP Warning:  Creating default object from empty value in .../mod/match.php on line 83

Fixed in #6824

MrPetovan added a commit to MrPetovan/friendica that referenced this issue Mar 7, 2019
@AlfredSK
Copy link

AlfredSK commented Mar 16, 2019

I'm getting those 'unterminated entity reference' errors pretty often. What's really weird about those errors they are not producing a clean stack trace. Some lines are dropped from PHP error log and sometimes lines are magically overwritten when looking into the issue (it's like a quantum effect: when you look at it the result is changing). :-) But I'm wrong.

In fact a Friendica code block itself is making the trouble. The PHP log looks weird because we're dealing with an issue related to an issue someone reported by using a code block. I know that sounds complicated. :-)

Have a look at this line of my PHP error log (containing real PHP error data and parts of the post that triggered the warning:

[16-Mar-2019 14:07:26 UTC] PHP Warning:  Friendica\Content\Text\HTML::toPlaintext(): unterminated entity reference &
"uti...')^M#2 /home/friendica/friendica/src/Content/Text/BBCode.php(1321): text_highlight('git pull && uti...', 'sh')^M#3 [internal function]: Friendica\Content\Text\BBCode::textHighlightCallback(Array)^M#4 /home/friendica/friendica/src/Content/Text/BBCode.php(1423): preg_replace_callback('/\\[code=(.*?)\\]...', 'self::textHighl...', 'basically my up...')^M#5 /home/friendica/friendica/include/text.php(1430): Friendica\Content\Text\BBCode::convert('basically my up...')^M#6 /home/friendica/friendica/include/text.php(1213): prepare_text('basically my up...')^M#7 /home/friendica/friendica/src/Model/Item.php(686): put_ in /home/friendica/friendica/vendor/pear/text_highlighter/Text/Highlighter/Renderer/Array.php on line 154"
 in ........../src/Content/Text/HTML.php on line 584

Everything related to '/home/friendica/friendica/...' is part of the post/comment not related to the actual path of my node.

I have seached the forum node (yeah! full text search) and could pin it down to that comment:
https://forum.friendi.ca/display/fd59d1fe175a885155dcae5919334318

Has the issue something to do with that & in the first line?

Is this 'unterminated entity reference' bad? I mean 'unterminated' sounds like a serious issue when a HTML parser is involved. Could this be exploited in a bad way?

@AlfredSK
Copy link

[19-Mar-2019 18:49:35 UTC] PHP Warning:  hex2bin(): Hexadecimal input string must have an even length in ..../libranet/mod/parse_url.php on line 29

@MrPetovan MrPetovan mentioned this issue Mar 22, 2019
12 tasks
@MrPetovan MrPetovan unpinned this issue Mar 22, 2019
@MrPetovan
Copy link
Collaborator Author

Closed for release, open issues have been moved to #6917

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants