• If there are certain keywords for field names in the $_POST array, WP obviously interprets them in some way. The issue was reported long ago, e.g. here in the support forum. That post saved me from going nuts.

    What I found was this. When the page containing the query is retrieved without any $_POST fields set, the following query is sent to the database:
    SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND (wp_posts.ID = '236') AND wp_posts.post_type = 'page' ORDER BY wp_posts.post_date DESC

    But when $_POST[‘name’] is set to “Otto Normal” the following query is sent instead:
    SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'otto-normal' AND wp_posts.post_type = 'post' ORDER BY wp_posts.post_date DESC

    $REQUEST_URI and $SCRIPT_FILENAME are identical, but eventually the latter request generates a 404.

    Is this behaviour a bug or a feature? And if this is a feature, what would be its purpose?

    BTW: If you are harassed by this behaviour, just rename the field.

    Regards,
    – laotse.

  • The topic ‘Strange $_POST processing – Bug or Feature’ is closed to new replies.