Recent Topics

1 Feb 01, 2007 20:37    

Hi. Maybe someone knows why this is happening. When a comment is posted and I log in to moderate comments that are posted and I hit the "publish" button, it takes me to an error page with the following error message "Illegal value received for parameter «c»!"
However, the comment does get published just fine. Just wondering if this is a setting problem or perhaps something else. Thanks for the help!

2 Feb 01, 2007 23:50

b2evo version, please?

3 Feb 02, 2007 00:20

Sorry. Using the most recent. 1.9.2
It appears that if i try to delete, publish or deprecate I get the following:

Bad Request!
The parameters of your request are invalid.

If you have obtained this error by clicking on a link INSIDE of this site, please report the bad link to the administrator.

Go back to home page

Additional information about this error:
Illegal value received for parameter «c»!

Note that it works ok because if go back to admin or the blog, it worked. It just takes me to that pink page and gives me that error.

After turnin debug on, I'm getting:

bad_request_die( "Illegal value received for parameter «c»!" )
File: C:\Inetpub\wwwroot\blogs\inc\_misc\_misc.funcs.php:1245
param( "c", "integer", 0, false, false, true, "allow_empty" )
File: C:\Inetpub\wwwroot\blogs\inc\_misc\_request.class.php:116
Request->param( "c", "integer", 0 )
File: C:\Inetpub\wwwroot\blogs\inc\CONTROL\items\b2browse.php:173
require( "C:\Inetpub\wwwroot\blogs\inc\CONTROL\items\b2browse.php" )
File: C:\Inetpub\wwwroot\blogs\admin.php:122

4 Feb 02, 2007 20:51

Anybody know how to fix this?

5 Feb 02, 2007 21:10

Your error message tells you
tp wrote:

If you have obtained this error by clicking on a link INSIDE of this site, please report the bad link to the administrator.

Have you done that? That doesn't look like a b2evolution message, so I'm guessing your admin has customized some stuff.

6 Feb 02, 2007 22:16

actually... I am the admin. It's definetely a b2evo error. I haven't really done any customizations, just some plugins. Weird thing is I didn't get that error but the publish link said "Publish NOW" rather than just "Publish". This is happening in the admin area and the blog if i try to remove comments. Really strange.

edit: So actually this is only happening with "Comments". If I tried to Deprecate, Delete or Publish a comment, it takes me to that error page.

edit 2: I think I see the problem. It seems like it is adding a "#comments" in the URL which is killing it. Is "#comments" important?

/blogs/admin.php?ctrl=browse&tab=posts&blog=2&p=26&c=1#comments

edit 3: man..now im really not sure what is happening. It seems like the url of the action (say depecreate points to one thing) but it is directing the page to /blogs/admin.php?ctrl=browse&tab=posts&blog=2&p=26&c=1#comments
afterwards. Any ideas why?

7 Feb 02, 2007 22:58

Ok. I figured out the problem. You might want to update your code for this.

Line 447, 479 and 502 of edit_actions.php

Originally, it had : "&c=1#comments"
It needs to be : "&c=1&#comments"

Or else when the redirect happens, it is looking at the variable "c" as "1#comments". You need the & so c=1 then #comments can move you to the anchor.

8 Feb 02, 2007 23:18

I'll be darned! It just didn't look like the way b2evo makes error messages, but for a fact it is. Good catch!

9 Feb 02, 2007 23:41

I found another place with the same thing.

Line 1705 in _item_class.php

&c=1&tb=1&pb=1#comments

Should probably be

&c=1&tb=1&pb=1&#comments

Haven't gotten an error with the original version yet but I imagine it will yeild one when its used.

:)

10 Feb 03, 2007 23:17

LOL ... keep finding and fixing and soon you'll be a b2evo developer for sure! :D

11 Feb 04, 2007 17:48

tp, what browser are you using?

It seems like either your browser or webserver does something stupid, when requesting the URL with the anchor "#comments" at the end.
I could not reproduce it with Konqueror or Firefox, so it must be either an IE problem or some other obscure bug somewhere.

Instead of changing the redirects like you've did I would suggest adding a workaround to header_redirect() itself, which checks if there's an anchor in the URL and "protects" any previous GET params (like "c" in this case).

However, it would be helpful to know whate causes this error.

12 Feb 04, 2007 21:07

Hey. It must be some kind of server setting I suppose because it does it in IE6 and the lastest version of Firefox. I'll try what you suggested and report back. I was using IIS but I've switched over to Apache and same results. I'll see if maybe there is some kind of setting in apache.

13 Feb 05, 2007 17:31

Hmm.. can you reproduce it on the demo site (http://demo.b2evolution.net/) for the v-1-9 variant?

The problem seems to be that "..&c=1#comments" gets sent as new location for the redirect, but the "#comments" anchor part gets added to the "c" value.

14 Feb 05, 2007 18:21

Well.... I am unable to replicate the error on your version. When I edit comments on your version, it does redirect to the same url on mine..
admin.php?ctrl=browse&tab=posts&blog=3&p=23&c=1#comments

However, on my version for some reason it is thinking "1#comment" is the value for "c". Is there some kind of setting maybe? It has to be some kind of server setting.

15 Feb 05, 2007 18:50

Can I access your blog/site to try reproducing this error (you might want to PM me the details)?

You've said that you tried both IIS and Apache. Which PHP version are you using?

It would be interesting what gets written into the server's access log.. Is there the "#comments" or "%23comments" in the requested URI of a GET request? "comments" should not appear there, because it's an anchor and only the browser uses this but should not send it to the server.
Maybe there's something going on which replaces "#" in the "Location:" header value to "%23" (url-encoded) and then it's no anchor for the browser anymore.

16 Feb 05, 2007 19:11

Ok. So...you're onto something. I was running IIS and I was running into that problem. I changed the code and added the "&" and it worked fine. I then switched over to Apache but I left the "&" in so it was working. I have gone through and removed the "&" so it is like how it was and it seem to be working just fine now. It must be an IIS thing. I looked at the log files and the log files show it was not converting the # like you suggested. It must be some other setting.

I have it locked down right not but plan on getting user access setup to the directory and will create an account for you if you still wanna check it out. Running Apache 2.0, PHP5.1, MySQL 5.0.

17 Feb 05, 2007 19:17

Oh...and here are the entries just in case. This was when I was running on IIS:

GET /blogs/admin.php ctrl=editactions&action=publish_comment&comment_ID=6
GET /blogs/admin.php ctrl=browse&tab=posts&blog=2&p=26&c=1#comments 80

This is running on Apache currently:

"GET /blogs/admin.php?ctrl=editactions&action=deletecomment&comment_ID=9 HTTP/1.1" 303 -
"GET /blogs/admin.php?ctrl=browse&tab=posts&blog=2&p=27&c=1#comments HTTP/1.1" 200 22921

18 Feb 05, 2007 22:16

In my Apache access log it looks like the following instead:

"GET /blogs/admin.php?ctrl=editactions&action=publish_comment&comment_ID=3 HTTP/1.1" 302 - "http://b2cvs18.local/blogs/admin.php?ctrl=browse&show_past=1&show_future=1&tab=comments" "[user-agent]"
"GET /blogs/admin.php?ctrl=browse&tab=posts&blog=2&p=1&c=1 HTTP/1.1" 200 270006 "http://b2cvs18.local/blogs/admin.php?ctrl=browse&show_past=1&show_future=1&tab=comments" "[user-agent]"

There's no "#comments" there anywhere.

19 Feb 06, 2007 00:04

Hmmmm.....must be a setting I suppose. I'll look at the apache config file. I see what you're saying. Now it's even more weird that its working and the log still has #comments.


Form is loading...