• Hello,

    my blog url has a “~” and this seems to be confusing wp, I think. I know you might be aware of this but I could not find a topic regarding it, except for this report for 1.5.1.

    Whenever I do an update on the “Options” panel I’m redirected to “/wp-admin/options-writing.php?updated=true” in which there is a “7E” where “~” should be. Resulting page returns 404. If I correct back to “~” page loads successfully. Changes are applied independent of this manual url correction.

    If I do a view source while at cp options page you can read the following:

    <form method="post" action="options.php">
    <input type="hidden" name="_wpnonce" value="e34f253d5f" /><input type="hidden" name="_wp_http_referer" value="/%7Enelas/mestrado/wp-admin/options-general.php" /><p class="submit"><input type="submit" name="Submit" value="Update Options &raquo;" /></p>

    Plugins also might have been affected by this, like Automattic Stats.

    LanguageSwitcher was not working for me but the developer suggested to replace a line of the plugin code:

    <form name="form1" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">

    for

    <form name="form1" method="post" action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?>">

    and now the plugin is working! Something like this may solve cp-options page issue…

    any ideas?!

    cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • Do you mean here (options.php, lines 91-95):

    if ( !$_POST['page_options'] ) {
    		foreach ( (array) $_POST as $key => $value) {
    			if ( !in_array($key, array('_wpnonce', '_wp_http_referer')) )
    				$options[] = $key;
    		}

    Something to do with how wp_http_referer is being set.

    I have the same problem and I’m trying to figure out how to fix this.

    I think I got it. The wp_referer_field is defined in the wp-includes/functions.php at line 930.

    Add this line:

    $_SERVER['REQUEST_URI'] = preg_replace( "/%7[Ee]/", "~", $_SERVER['REQUEST_URI'] );

    at the beginning of the function definition as:

    function wp_referer_field() {
    $_SERVER['REQUEST_URI'] = preg_replace( "/%7[Ee]/", "~", $_SERVER['REQUEST_URI'] );
    $ref = attribute_escape($_SERVER['REQUEST_URI']);

    It’s an ugly hack, but it gets to the root of the problem.

    I think I got it. The wp_referer_field is defined in the wp-includes/functions.php at line 930.

    Add this line:

    $_SERVER['REQUEST_URI'] = preg_replace( "/%7[Ee]/", "~", $_SERVER['REQUEST_URI'] );

    at the beginning of the function definition as:

    function wp_referer_field() {
    $_SERVER['REQUEST_URI'] = preg_replace( "/%7[Ee]/", "~", $_SERVER['REQUEST_URI'] );
    $ref = attribute_escape($_SERVER['REQUEST_URI']);

    It’s an ugly hack, but it gets to the root of the problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘url with tilde (~) may be causing 404’ is closed to new replies.