bbAntiSpam: Discuss how to stop web spam

The forum is retired.

bbAntiSpam Forum Index - Textual Confirmation - Warning Bug report on Textual Confirmation 1.0.5

Author Message
robmlee



Joined: 30 Mar 2007
Posts: 1

Posted: Fri Apr 06, 2007 2:30 pm    Post subject: Warning Bug report on Textual Confirmation 1.0.5  

There are some files with a extra line after "?>" will cause the warning
messages as follow:

Code:

Warning: Cannot modify header information - headers already sent by...


Those files are:
1. TextualConfirmation-1.0.5/admin/admin_tc.php
2. TextualConfirmation-1.0.5/includes/functions_tc.php
3. all lang_tc.php, except the one in lang_chinese_traditional_taiwan

For MS-Win notepad or wordpad, the extra line might not be seen.
But you can see it easily with Notepad++.
_________________
Rob
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Sat Apr 07, 2007 1:56 am    Post subject:  

Hi Rob,

thanks for pointing to the potential issue. Why I said "potential"? Because if you look at the hex dump of the distro files, you'll see they finish on '?', '>' and '\n' (the new line symbol). PHP interpreter ignores '\n'.

Therefore, if you got "Cannot modify header information", I'd blame you FTP tool, probably it adds something.

Anyway, I've added an issue to my TODO list. Thanks.
_________________
Oleg Parashchenko, bbAntiSpam
Do you love our tools? Please sponsor further development!
BryanG



Joined: 03 Apr 2007
Posts: 6
Location: Canada

Posted: Sat Apr 07, 2007 11:07 pm    Post subject:  

Hmmm. This seems somewat related to the error messages I'm getting then, although I'm getting a few more. I'm on a Mac G5 using OS 10.4.9. I accessed my server files via Cyberduck, and modifed the lines using TextWrangler (which will work within Cyberduck), then uploaded the other files.
Just to confound the picture I added Adrian Suter's MOD as the same time, so I could avoid having to deal with the SQL issue.
I don't see an extra line at the end of the admin file Rob mentions, it just ends with ?>

I get the following messages within the admin window; I'm using the Classic template, but get the same errors on the SubSilver template. Any thoughts on what I'm missing?

Warning: main(./admin_tc2.php): failed to open stream: Permission denied in /home/westwind/www/westwind.mb.ca/Forum/phpBB2/admin/index.php on line 63

Warning: main(): Failed opening './admin_tc2.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/westwind/www/westwind.mb.ca/Forum/phpBB2/admin/index.php on line 63

Warning: Cannot modify header information - headers already sent by (output started at /home/westwind/www/westwind.mb.ca/Forum/phpBB2/admin/index.php:63) in /home/westwind/www/westwind.mb.ca/Forum/phpBB2/admin/page_header_admin.php on line 143

Warning: Cannot modify header information - headers already sent by (output started at /home/westwind/www/westwind.mb.ca/Forum/phpBB2/admin/index.php:63) in /home/westwind/www/westwind.mb.ca/Forum/phpBB2/admin/page_header_admin.php on line 145

Warning: Cannot modify header information - headers already sent by (output started at /home/westwind/www/westwind.mb.ca/Forum/phpBB2/admin/index.php:63) in /home/westwind/www/westwind.mb.ca/Forum/phpBB2/admin/page_header_admin.php on line 146
BryanG



Joined: 03 Apr 2007
Posts: 6
Location: Canada

Posted: Sun Apr 08, 2007 1:43 am    Post subject:  

also (still working my way through other posts on the forum (just in case someone already had this problem and I missed it) I saw an inquiry about the header information error message. Your response was:

"Most likely, the text editor you used has corrupted the files a bit. Make sure that the file "includes/usercp_register.php"

* is not saved as unicode, and
* starts with "<?php", without any spaces before this string."

That led me to check that file, and it does start with "<?php", as you state it should.
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Sun Apr 08, 2007 3:50 am    Post subject:  

Hi BryanG, your actual problem is:
Quote:
Warning: main(./admin_tc2.php): failed to open stream: Permission denied in /home/westwind/www/westwind.mb.ca/Forum/phpBB2/admin/index.php on line 63

It means the web server can't read the content of file. I have no idea how to do it in your tool, but you need to allow reading of the Textual Confirmation files.

robmlee: starting with version 1.0.6, all the distro files now finish exactly on '?>'. Announce. Thanks for suggesting.
_________________
Oleg Parashchenko, bbAntiSpam
Do you love our tools? Please sponsor further development!
BryanG



Joined: 03 Apr 2007
Posts: 6
Location: Canada

Posted: Sun Apr 08, 2007 6:13 pm    Post subject:  

Thanks Oleg,

[quote="admin"]Hi BryanG, your actual problem is:
Quote:
Warning: main(./admin_tc2.php): failed to open stream: Permission denied in /home/westwind/www/westwind.mb.ca/Forum/phpBB2/admin/index.php on line 63

It means the web server can't read the content of file. I have no idea how to do it in your tool, but you need to allow reading of the Textual Confirmation files.


OK, that at least explains the nature of the problem, even if I have no idea just yet about what a solution might look like. I'm appending the lines (after adding line numbers) that this references (particularly line 63), which I assumed would be common to all users, but then I have no idea at all if that would be true. Disregarding the issue of which tool I'm using, any suggestions of how one might allow reading of the TC files in any other tool? I'm thinking if I get an idea of what the process might be (or look like) I'll have further ideas to pursue.


52 // Generate relevant output
53 //
54 if( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' )
55 {
56 $dir = @opendir(".");
57
58 $setmodules = 1;
59 while( $file = @readdir($dir) )
60 {
61 if( preg_match("/^admin_.*?\." . $phpEx . "$/", $file) )
62 {
63 include('./' . $file);
64 }
65 }
66
67 @closedir($dir);
68
69 unset($setmodules);
70
71 include('./page_header_admin.'.$phpEx);
72
73 $template->set_filenames(array(
74 "body" => "admin/index_navigate.tpl")
75 );
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Mon Apr 09, 2007 2:40 am    Post subject:  

Quote:
Disregarding the issue of which tool I'm using, any suggestions of how one might allow reading of the TC files in any other tool?

I've made a quick search, and it seems this page is the answer: How To: Change file permissions. See the section "Cyberduck 2.x". You need to set all the three "Read" permissions.
_________________
Oleg Parashchenko, bbAntiSpam
Do you love our tools? Please sponsor further development!
BryanG



Joined: 03 Apr 2007
Posts: 6
Location: Canada

Posted: Mon Apr 09, 2007 3:40 pm    Post subject:  

Yes, that was it Oleg, worked like a charm once I knew what to change. Thank you for your patient help. The TC is installed, and seemed to be working fine when I tried to register. I look forward to the satisfaction of seeing the messages when spammers get blocked. Once I get tired of getting those emails, I'll be upgrading to the business grade. Thanks again.
Ares



Joined: 28 Mar 2007
Posts: 24

Posted: Mon Apr 09, 2007 5:06 pm    Post subject:  

Quote:
Warning: Cannot modify header information - headers already sent by...

a side note, this is a WELL known PHP warning message. it happens when you try to send "headers" or cookies after PHP has already output content to the page.
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Tue Apr 10, 2007 1:47 am    Post subject:  

Quote:
Quote:
Warning: Cannot modify header information - headers already sent by...

a side note, this is a WELL known PHP warning message. it happens when you try to send "headers" or cookies after PHP has already output content to the page.

Yes, exactly. Unfortunately, unintentional whitespace before '<?php' and after '?>' is accounted as "PHP has already output content".

Quote:
worked like a charm once I knew what to change

I'm glad to hear it. Best luck to your forum!

Quote:
Once I get tired of getting those emails, I'll be upgrading to the business grade.

Thanks, It'd be nice.
_________________
Oleg Parashchenko, bbAntiSpam
Do you love our tools? Please sponsor further development!
BryanG



Joined: 03 Apr 2007
Posts: 6
Location: Canada

Posted: Tue May 01, 2007 10:48 pm    Post subject:  

It's been three weeks now Oleg, and not a single spammer has made it onto my forum. I have a nice collection of 300 emails notifying me about yet another one being rejected. The thrill of getting the notices is over now, and I have gone ahead and purchased the upgrade.

I have no doubt this has been one of the best software purchases I've made, and thanks again for your help in walking me through the solutions to the problems I encountered in getting it running.
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Wed May 02, 2007 4:21 am    Post subject:  

Hi Bryan,

thanks a lot for supporting, and especially for kind words! For me, it's really thrilling to know that people like what I'm doing. All the best to you and your forum.
_________________
Oleg Parashchenko, bbAntiSpam
Do you love our tools? Please sponsor further development!
Ares



Joined: 28 Mar 2007
Posts: 24

Posted: Wed May 02, 2007 10:57 pm    Post subject:  

"headers already sent..." errors, happen when you try to do some stuff with cookies, or sending header info (including some redirection techniques), after you've already had PHP output something to the page. It could be something as insignificant as a blank line.

the "permission denied..." thing is also a common problem. I get it all the time when I'm doing piss-simple PHP scripts in Linux. Linux is smart about file permissions, but sometimes it will piss you off like that, because the operating system doesn't think that the web server should be allowed to access a certain file.

Ok.