In a month a I got about 170 pages of errors in my Error Log.
Guest
Type of error: Not specified
8: Undefined offset: 1
http://www.skodaclub.it/index.php?type=rss;action=.xml
File: /.../sources/QueryString.php
Row: 225
How could I solve this? Thank you.
I am using Elkarte 1.0.4 and PHP 5.6.
Would you mind do some test? O:-)
In QueryString.php, find:
// Looks like this is an IPv4 address
if (strpos($part[1][1], '.') !== false)
{
and replace it with:
if (!isset($part[1][1]))
log_error('Original address: ' . $addr);
// Looks like this is an IPv4 address
if (!isset($part[1][1]) || strpos($part[1][1], '.') !== false)
{
Then cleanup the error log and keep a eye on it to see if any error that looks like:
Original address: 123.123.123
appears. :D
Thanks for your help. I did, but here is what I get now:
Ops, wrong logic... O:-)
Sorry! :-[
Now, let's revert to something that should work, so:
if (!isset($part[1][1]))
log_error('Original address: ' . $addr);
// Looks like this is an IPv4 address
if (!isset($part[1][1]) || strpos($part[1][1], '.') !== false)
{
becomes:
// Looks like this is an IPv4 address
if (isset($part[1][1]) && strpos($part[1][1], '.') !== false)
{
It seems to work for now, no errors in the last 40 minutes. Thank you Emanuele!
YAY! :D
Note: yes, it is a bug, in particular IPv6 addresses may not have anything after the "::" like in:
2001:41d0:2:e494::
present in the log posted by radu.
In this case,
$part[1]
is an empty array, and so it should not do anything about IPv4, but go straight to the "expand missing pieces" just after that.
/me moves the topic
After a few hours my error log is still empty ;) Thanks again!
Did this get tracked for 1.0.5 ?
I guess not... O:-)
Tracked ... https://github.com/elkarte/Elkarte/issues/2125
And fixed in 1.0.5