Jump to content


Photo

Can't save page 0


  • Please log in to reply
3 replies to this topic

#1 Pete

Pete

    Administrator

  • Administrators
  • 1,756 posts
  • 658

  • LocationChester, England

Posted 01 June 2012 - 01:52 PM

I've been noticing this message come up recently at random - sometimes several at a time and sometimes spread out a lot.

I updated the wire directory and it still happens, however I was wondering if anyone could shed some light on what it actually means, or suggest a way to determine where the problem is?

2012-05-31 03:36:51 guest http://www.mysite.co.uk/?/ Error Exception: Can't save page 0: : Pages of type NullPage are not saveable (in /home/strategy/public_html/wire/core/Pages.php line 463)

It's almost certainly an issue with something I've coded, but for the life of me I can't think where to look and I can't reproduce it myself whether I'm logged in or not.

#2 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1769

  • LocationSH, Switzerland

Posted 01 June 2012 - 07:08 PM

That's a IHNI error. (I Have No Idea)

Just guessing. You'r doing some ajax on the page? Comments saving for guests, Poll, ... ? :) I always wondered where the questionmark comes from "?".

@somartist | modules created | support me, flattr my work flattr.com


#3 Pete

Pete

    Administrator

  • Administrators
  • 1,756 posts
  • 658

  • LocationChester, England

Posted 02 June 2012 - 07:44 AM

I found it. Well, the troublesome script at least.

I changed this line in wire/core/ProcessWire.php:

$logMessage = "Page: $path\nUser: $userName\n\n" . str_replace("	", "\n", $message);

to this:

$logMessage = "Request: " . $_SERVER['REQUEST_URI'] . "\nPage: $path\nUser: $userName\n\n" . str_replace("	", "\n", $message);



@ ryan, looking again at the error code in that file, wouldn't it be better if this:

$path = ($config ? $config->httpHost : '') . ($page ? $page->url : '/?/');

was actually this:

$path = ($config ? $config->httpHost : '') . ($page ? $page->url : $_SERVER['REQUEST_URI']);

to potentially give a bit more info, or is there a reason why the fallback is set to /?/?

#4 ryan

ryan

    Hero Member

  • Administrators
  • 5,812 posts
  • 3143

  • LocationAtlanta, GA

Posted 04 June 2012 - 09:39 AM

to potentially give a bit more info, or is there a reason why the fallback is set to /?/?


$_SERVER['REQUEST_URI'] isn't filtered, at least I don't think it is. Just trying to protect against any possible request injection into the logs.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users