• Hello,

    I am wondering if anyone has encountered something similar to my issue. It seems that recently anytime a search is conducted on my wordpress website with the variable “s” in the URL, the head of the page gets interrupted and prematurely closed. There are also two broken forms that get inserted into the top of the body. I am having trouble tracing where this comes from and have disabled a multitude of plugins to try to find the issue to no avail. It could be a conflict in the theme, but I am also having trouble figuring out where it could be occuring. It seems to have started happening with the last update to wordpress, but it also could have been a plugin update that caused it. I run a completely custom theme and many custom plugins however, disabling my custom plugins did not remove the problem.

    Does anyone have any ideas of where to look for a conflict?

    Again to put it simply. When I access and frontend page or a backend page where I have “?s=test” the error appears. It seems specifically related to the “s” variable, as the problem does not occur with any other variable.

    Screenshots can be seen here…
    error_backend error_frontend

    • This topic was modified 6 years, 9 months ago by SAAhmed. Reason: Screenshots added
Viewing 5 replies - 1 through 5 (of 5 total)
  • If you right-click on the form and inspect it in your browser’s Web Inspector, are you able to see anything that seems unique about the form… then you could perhaps look for that (like a form id) in the code to see what might be generating it?

    Scott

    Thread Starter SAAhmed

    (@saahmed)

    Thanks for your reply Scott,

    Great suggestion, if only it was that easy. Here is a screenshot of the forms as seen through the web inspector. There are no obvious signs of identification on them however, it does almost appear as if parts of some url or GET variables are jumbled into it. We see a “?1=1” which I have no clue where that might be from.

    inspector

    I can also add that it does not seem to be related to Javascript in any way, as when I view the site with JS disabled, I still get the same identical error.

    • This reply was modified 6 years, 9 months ago by SAAhmed. Reason: Tested error without Javascript

    Hmmmm… the 1=1 can be seen in WordPress’s WP Query class. Take a look at line 2809 in class-wp-query.php. Since this is happening when conducting a search, is there anything in the search.php template file that looks out of place? I would try renaming search.php to something else to try to rule out a problem with the file.

    Have your tried a different theme to see if the problem persists?

    Scott

    Thread Starter SAAhmed

    (@saahmed)

    Hello again Scott,

    I did a search for 1=1 in the wp-includes folder, and changed all references to it using 2=2, including the class-wp-query.php that you mentioned, just to see if that affected the broken forms. Unfortunately it did not. Even with 2=2 references, it still said 1=1. Which means maybe it is from somewhere else in wordpress, or perhaps it is a reflection of some kind of evaulation like A=B, A is true, B is true so 1=1.

    I did try different themes, and it occurs in all of them, including the admin panel. Which seems to suggest it could likely be a plugin problem and not with a theme. The site it is on is busy enough that it is hard for me to take it all down. Perhaps I can try disabling every plugin, but I would need to do this in some kind of middle of night kind of downtime.

    Your suggestions are much appreciated. I wish they would have yielded something. But unfortunately I feel as if I am not much closer to finding the culprit.

    Darn… sorry that I don’t have another idea. Can you check your server’s PHP error log? That might give an idea of what plug-in is the problem if that is, indeed, the case. Otherwise, I would recommend looking into standing up a local install of your website so that you have a place to test and troubleshoot without affecting your live site.

    Sorry I couldn’t be of more help. Good luck!

    Scott

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Using Search GET variable in URL breaks the document head’ is closed to new replies.