Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: wynnyelle on December 22, 2011, 12:51:53 PM

Title: Bad error on subs.php
Post by: wynnyelle on December 22, 2011, 12:51:53 PM
I was told I have a bad error here:

Quote
/home/warrior/public_html/Sources/Subs.php on line 3065

I don't know what the error is, would anyone know what might go wrong on there?
Title: Re: Bad error on subs.php
Post by: Illori on December 22, 2011, 12:59:39 PM
what is the whole error message? it should tell you what the error is on that line, and without your file we cant tell you what the fix may be.
Title: Re: Bad error on subs.php
Post by: wynnyelle on December 22, 2011, 01:29:29 PM
This is what I got:

Quote
[Wed Dec 21 19:20:42 2011] [error] [client 72.9.153.236] PHP Notice: Undefined index: HTTP_USER_AGENT in /home/warrior/public_html/Sources/Subs.php on line 3065
Title: Re: Bad error on subs.php
Post by: Illori on December 22, 2011, 01:31:05 PM
and your subs.php file?
Title: Re: Bad error on subs.php
Post by: wynnyelle on December 22, 2011, 01:36:55 PM
Here I have attached it.

Title: Re: Bad error on subs.php
Post by: Illori on December 22, 2011, 01:57:54 PM
http://www.simplemachines.org/community/index.php?topic=380927.0 seems to be the only thing related to this, in trunk that line has been changed to what is in the last post in that thread
Title: Re: Bad error on subs.php
Post by: Joker™ on December 22, 2011, 02:28:06 PM
Can you give us more details regarding this, as who produced the error "guest" or "member".

Also is this error generated frequently?
Title: Re: Bad error on subs.php
Post by: wynnyelle on December 22, 2011, 03:19:17 PM
I'm sorry...you guys totally lost me. I don't understand, and right now I have no further information. I have attached the file. I don't know what to do to fix it.

Yes, it is a frequent error.
Title: Re: Bad error on subs.php
Post by: Joker™ on December 22, 2011, 03:23:05 PM
Quote from: Groovystar on December 22, 2011, 03:19:17 PM
I'm sorry...you guys totally lost me. I don't understand, and right now I have no further information. I have attached the file. I don't know what to do to fix it.

Yes, it is a frequent error.
As illori suggested, have you tried the code change provided in this (http://www.simplemachines.org/community/index.php?topic=380927.msg3105155#msg3105155) reply?
Title: Re: Bad error on subs.php
Post by: wynnyelle on December 22, 2011, 04:02:20 PM
That error is on a different line, so I didn't want to do anything yet until I spoke to Flamer, who is the one who found the error.
Title: Re: Bad error on subs.php
Post by: Illori on December 22, 2011, 04:04:06 PM
that is because you have mods installed, it is still the same code that needs to be replaced.
Title: Re: Bad error on subs.php
Post by: wynnyelle on December 22, 2011, 04:16:21 PM
Oh it is? I'm sorry! I didn't know.

I will try the fix and get back to you.
Title: Re: Bad error on subs.php
Post by: Joker™ on December 22, 2011, 04:18:18 PM
Quote from: Groovystar on December 22, 2011, 04:02:20 PM
That error is on a different line, so I didn't want to do anything yet until I spoke to Flamer, who is the one who found the error.
Please do give us the feedback about how the fix went for you.
Title: Re: Bad error on subs.php
Post by: wynnyelle on December 22, 2011, 05:28:21 PM
I totally don';t know what I am supposed to put into that line. Where does it actually tell you what to change it to?
Title: Re: Bad error on subs.php
Post by: Joker™ on December 22, 2011, 05:34:26 PM
Quote from: Groovystar on December 22, 2011, 01:29:29 PM
This is what I got:

Quote
[Wed Dec 21 19:20:42 2011] [error] [client 72.9.153.236] PHP Notice: Undefined index: HTTP_USER_AGENT in /home/warrior/public_html/Sources/Subs.php on line 3065

Make backup of file before editing it

Sources/Subs.php

Line: 3065
Code (Find:) Select
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

Code (Replace it with:) Select
$_SESSION['USER_AGENT'] = empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT'];
Title: Re: Bad error on subs.php
Post by: wynnyelle on December 22, 2011, 06:01:08 PM
I tried it and the entire site wouldn't work. I re-uploaded the old file.
Title: Re: Bad error on subs.php
Post by: wynnyelle on December 22, 2011, 06:04:00 PM
The code editor won't input the edits without wiping the file. That's why, I discovered. I'm helpless here. I can't fix the file and when I try to open it in notepad on my own computer, the entire thing's a mess.
Title: Re: Bad error on subs.php
Post by: live627 on December 22, 2011, 06:37:38 PM
You need something that recognises Unix line endings, ssuch as Notepad++,  not the one that comes with Windows.
Title: Re: Bad error on subs.php
Post by: live627 on December 22, 2011, 06:43:13 PM
I edited the file accordingly.
Title: Re: Bad error on subs.php
Post by: wynnyelle on December 22, 2011, 07:05:25 PM
Thank you. Would I be able to get Notepad++ for free, or does it cost something?
Title: Re: Bad error on subs.php
Post by: Illori on December 22, 2011, 07:06:49 PM
it is free
Title: Re: Bad error on subs.php
Post by: wynnyelle on December 22, 2011, 07:38:21 PM
Thanks, I'll look it up.

So this edit--it should fix the error I've been getting? Is this a common error?
Title: Re: Bad error on subs.php
Post by: Illori on December 22, 2011, 08:04:28 PM
it does not seem to be common, only other thread i found on the issue is the one i linked to above.
Title: Re: Bad error on subs.php
Post by: wynnyelle on December 25, 2011, 11:25:35 PM
Thank you to everyone for your help here. The fix seems to have solved this problem!
Title: Re: Bad error on subs.php
Post by: zinyaw on January 20, 2012, 04:23:06 PM
QuoteStrict Standards: require_once() [function.require-once]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead in /home/myanmar9/public_html/Sources/Subs.php on line 936

Parse error: syntax error, unexpected '*' in /home/myanmar9/public_html/Sources/Subs.php on line 936


what this error? Please explain . Thank
Title: Re: Bad error on subs.php
Post by: Illori on January 20, 2012, 04:24:02 PM
please open a separate thread for your issue, this thread belongs to someone else and is marked solved. also please dont bump old threads.