Rodolfo Pilas wrote:

> I have Wordpress served by Cherokee.  When I post and wish to delete
> it, the Wordpress said:
>
> Sorry, you need http://codex.wordpress.org/Enable_Sending_Referrers
> for this feature to work.
>
> because wordpress checks the previous form to execute delete (and
> other admin) actions. I by pass this check commenting the php code,
> but it is not a solution.  Can you take a look about it?

  Eh, eh.. more PHP fun!

  I have tracked back the problem. Let me explain what was failing:

  Wordpress was complaining because it wanted to check the referer
  header, and it was not there. Only to be sure, I checked the browser
  was sending the header:

====
GET /wordpress/wp-admin/post.php?action=delete&post=2 HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 
Firefox/1.0.7 (Debian package 1.0.7-1)
Accept: 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://localhost/wordpress/wp-admin/edit.php
Cookie: links_show_cat_id_bbfa5b726c6b7a9cf3cda9370be3ee91=All; ..
If-Modified-Since: Tue, 25 Oct 2005 15:18:37 GMT
====

  Ok, the header is there, so the problem had to be between Cherokee
  and PHP.  This is the code in WP which checks the referer:

  wp-admin/admin-functions.php

=====
function check_admin_referer() {
        $adminurl = strtolower( get_settings('siteurl') ) . '/wp-admin';
        $referer = strtolower( $_SERVER['HTTP_REFERER'] );
        if ( !strstr($referer, $adminurl) )
                die(__('Sorry, you need to <a 
href="http://codex.wordpress.org/Enable_Sending_Referrers";>enable sending 
referrers</a> for this feature to work.'));
        do_action('check_admin_referer');
}
=====

  So, it was expecting to receive the referer in the variable called
  HTTP_REFERER and, oopsss... the server wasn't adding it.  Here was
  the damn bug!

  It is now fixed on the SVN version (revision 70):
  http://svn.0x50.org/change/70

  Thanks for the report Rodolfo! :-)

--
Greetings, alo.
_______________________________________________
Cherokee mailing list
[email protected]
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee

Reply via email to