Forum Moderators: coopster

Message Too Old, No Replies

Error on form submit

         

AlienWebguy

2:45 pm on Dec 15, 2009 (gmt 0)

10+ Year Member



Hey guys -

I recently performed a server migration and now one of the forms on one of my sites (that I know of, could be more on others I suppose) is having issues.

I've been troubleshooting for hours and I've managed to isolate the issue to: if the form has 2 html tags in a row (ex '<br /><br />' or '<br /><img ...') it'll fail and the browser spits this at me "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." If there is only one tag at any given point (there can be many in the form as long as they are not back-to-back, it'll post just fine.

I've played with my mod_security settings and even just did a ctrl+a ctrl+x ->save settings to see if SOMETHING in the file was conflicting, and the line break issue remained. ctrl+v and saved.

This seems to only be happening on one form on the site. My forum (self-scripted) shares the same Form class and posts just fine. The textarea uses tinymce, but does my forum and its not broken there so I don't think it's an issue.

The form posts to the same page. I've tried posting to a direct url and the issue remains.

Any and all help is appreciated. Let me know if you need any code provided.

Thanks!
--S--

AlienWebguy

2:55 pm on Dec 15, 2009 (gmt 0)

10+ Year Member



Also, from reviewing my error logs, I'm seeing this:

[Tue Dec 15 06:52:03 2009] [error] [client 68.XX.XX.227] File does not exist: /home/example/public_html/error, referer: http://www.example.com/account/edit-profile
[Tue Dec 15 06:52:03 2009] [error] [client 68.XX.XX.227] File does not exist: /home/example/public_html/error, referer: http://www.example.com/account/edit-profile
[Tue Dec 15 06:52:03 2009] [error] [client 68.XX.XX.227] File does not exist: /home/example/public_html/error, referer: http://www.example.com/account/edit-profile
[Tue Dec 15 06:52:03 2009] [error] [client 68.XX.XX.227] File does not exist: /home/example/public_html/error, referer: http://www.example.com/account/edit-profile

etc....

[edited by: dreamcatcher at 12:33 am (utc) on Dec. 16, 2009]
[edit reason] Exemplified. [/edit]

rocknbil

6:57 pm on Dec 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

This is bad, a recursive loop somewhere, pretty sure . . .

[Tue Dec 15 06:52:03 2009] [error] [client 68.XX.XX.227] File does not exist: /home/example/public_html/error,...

Presuming "index.php" is in this directory, it's not indexing properly (I think?) Fix that at the server level or change your links to /error/index.php.

[edited by: dreamcatcher at 12:34 am (utc) on Dec. 16, 2009]
[edit reason] Exemplified. [/edit]

gacba

8:56 pm on Dec 15, 2009 (gmt 0)

10+ Year Member



You should also confirm that you properly migrated all of your Apache settings and PHP properties. Looks like (if the code WAS working before) something's hosed on the new side.

AlienWebguy

5:29 am on Dec 16, 2009 (gmt 0)

10+ Year Member



@rocknbil - that's actually a really good idea to create an error directory and stick an index.php file in there. I'll also try mod_rewrite and just catch it in the .htaccess. Why do you think it's just this one form (specifically in the textarea when I insert two tags back to back)? All the other forms with tinymce textareas post fine regardless of what content is provided in the field. I can't find anything in that file (user.edit-profile.php) that suggests some missing or incorrectly-pathed include file or anything.

@gacba - The migration was a complete upgrade from hardware to software. Apache went from 1.x to 2.2, PHP went from 5.2.x to 5.3.1, etc. I hired ConfigServer to setup the firewall and mailscanner and mod_security for me but I hired them on my last box too. The thing that's making me not jump on apache or php settings is that it's only this one form and only when 2 html tags are inserted into the textarea back to back. I even tried inserting like "test />< test" and it posted fine, but when I inserted "test <br /><br /> test" it'd fail.

AlienWebguy

1:19 pm on Dec 16, 2009 (gmt 0)

10+ Year Member



Created directory 'error' and added an index.html file in there. Issue remains.

AlienWebguy

6:38 pm on Dec 16, 2009 (gmt 0)

10+ Year Member



Ok Update: The same exact issue is affecting another site on my server. Same class file, same tinyMCE plugin on the textarea.

AlienWebguy

4:21 pm on Dec 17, 2009 (gmt 0)

10+ Year Member



Well, with no help from WebmasterWorld I did manage to fix it. I feel inclined to post the solution in case anybody else shares the issue.

It turns out mod_security was updated and had a recursion signature rule and cross-site scripting (XSS) rule that were making hell across my server. Commented those out and everything works fine now.

For security I will not be posting which rules were removed.

Thanks anyway.

--S--

whoisgregg

11:46 pm on Dec 17, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for posting the solution, AlienWebguy!

I think mod_security is an under-utilized module (so doesn't have a lot of depth with folks who are otherwise quite experienced). I hope you'll stick around and share your experience with it when other folks run into problems with mod_security. :)