Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-6445

Password protected posts redirect to root domain after entering correct password

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Should have Should have
    • 2.65.2
    • 3
    • Admin Panel

      Because WordPress by default relies on the HTTP_REFERER header to redirect to the post again after entering the correct password, this sometimes fails, because the referer header is unreliable.

      In case of Chrome, it currently only includes the root domain. In our case this is not even the root URL of the site, but a global redirection page.

      We can solve this by including a

      _wp_http_referer 

      query parameter in the search form with the post URL. This should work as it's being preferred by WordPress. See https://github.com/WordPress/WordPress/blob/master/wp-includes/functions.php#L1940-L1948 

            pvincent Pieter Vincent
            pvincent Pieter Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: