Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: Stirius - huhtikuu 07, 2020, 10:02:55 AP

Otsikko: Error search - missing text with highlight in URL
Kirjoitti: Stirius - huhtikuu 07, 2020, 10:02:55 AP
Hello,

we have some issues with our search. Using version 2.0.17. If you search for something, it shows up correctly. But when you then click and go to the URL itself, there is no text at all. See the attached files.

The URL stays as https://www.boiians.cz/index.php?topic=558.msg9265;highlight=new+world#msg9265 but if we use just simple https://www.boiians.cz/index.php?topic=558.msg9265 then it's working fine. But going to the topic via the search then it's simple empty.

Do you know where could be the problem?

Thank you.
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Kindred - huhtikuu 08, 2020, 03:07:38 IP
since your site is locked out for guests, I can't check....
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Stirius - huhtikuu 08, 2020, 03:42:17 IP
Lainaus käyttäjältä: Kindred - huhtikuu 08, 2020, 03:07:38 IP
since your site is locked out for guests, I can't check....

What do you mean locked, it is easily accessible for everyone. Just outside our countries you must prove that you are a human (we had a lot of bots). I just changed it to a javascript check which is easier to pass...
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Kindred - huhtikuu 08, 2020, 04:30:18 IP
Well, that was annoying but passable...  but no...  I tried to go to the page that you linked and was told that I had to be a member to see it...
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Shambles - huhtikuu 08, 2020, 04:31:12 IP
Lainaus käyttäjältä: Stirius - huhtikuu 08, 2020, 03:42:17 IP
What do you mean locked, it is easily accessible for everyone.

No it isn't

LainaaThe topic or discussion you are looking for is either missing or out of your range.


Please provide a test username & password.
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Stirius - huhtikuu 08, 2020, 04:37:07 IP
Could you please provide me a screenshot of what you see? Is it cloudflare or something else? Ok, I just switched it off. And, I am using a US proxy, I can easily go here https://www.boiians.cz/ and then you just write whatever to the search box at the top right corner. For example New World. You do not have to be signed in. Then it gets me to https://www.boiians.cz/index.php?action=search2 where I can see the topics. Then I click any of the topics and get inside just to see missing text in all posts...

Thanks a lot.
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Shambles - huhtikuu 08, 2020, 04:48:54 IP
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Stirius - huhtikuu 10, 2020, 06:04:31 AP
Where do you see this? If you follow my guidelines above then you should easily search for whatever you want. There you wanted to go to a topic which is not for guests... You can just go here to see the bug https://www.boiians.cz/index.php?topic=725.msg19033;highlight=new+world#msg19033

You can click on the search results like attached. Those are free for all.
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Kindred - huhtikuu 10, 2020, 09:34:52 AP
well that was the topic that you gave us a link to... :P

As for your problem...    you have bad code in there somewhere.
The search return is basically causing the contents of each post to not display.


Does this happen if you switch to the default theme?
If not, please attach your theme's post.template.php.
If so, then please attach Post.php from your sources directory
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Stirius - huhtikuu 10, 2020, 09:52:47 AP
Ah, okey, sorry then. Yes, even default template is buggy. Attaching the file.
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Stirius - huhtikuu 15, 2020, 07:29:46 AP
Lainaus käyttäjältä: Kindred - huhtikuu 10, 2020, 09:34:52 AP
well that was the topic that you gave us a link to... :P

As for your problem...    you have bad code in there somewhere.
The search return is basically causing the contents of each post to not display.


Does this happen if you switch to the default theme?
If not, please attach your theme's post.template.php.
If so, then please attach Post.php from your sources directory

Hello @kindred

Were you able to check the file?

Thank you!
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Kindred - huhtikuu 15, 2020, 01:51:19 IP
Sorry. work got crazy.
ok....  I don't see anything obvious in that file....
Although I do see a potential security issue in that you do not trim html from iframes, blockquotes and embeds...     That's a difference for the default, and not something that I'd recommend -- but not likely to be the issue here



........   and..... I just realized that I asked about the wrong file.

let's try Search.php

because, the search results actually do NOT return the correct data in the first place.


Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Stirius - huhtikuu 15, 2020, 03:39:15 IP
Lainaus käyttäjältä: Kindred - huhtikuu 15, 2020, 01:51:19 IP
Sorry. work got crazy.
ok....  I don't see anything obvious in that file....
Although I do see a potential security issue in that you do not trim html from iframes, blockquotes and embeds...     That's a difference for the default, and not something that I'd recommend -- but not likely to be the issue here



........   and..... I just realized that I asked about the wrong file.

let's try Search.php

because, the search results actually do NOT return the correct data in the first place.

I see.

Ok, here you go.
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Stirius - huhtikuu 20, 2020, 05:59:55 IP
Hi Kindred, have you got time yet to check the file please?

Thanks!
Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Kindred - huhtikuu 21, 2020, 12:28:42 IP
ok, looks like the problem is your "highlight Search keywords" mod (although the member color search may be the interference)

Not sure how to fix it, exactly... but that is almost definitely the code that is breaking the display.

remove those two mods... confirm that the functionality works and then try installing the mods one at a time, testing between....

Otsikko: Re: Error search - missing text with highlight in URL
Kirjoitti: Stirius - huhtikuu 21, 2020, 04:14:38 IP
Jesus christe, you are right, it was just because of that mod... Lol, thanks a lot. I don't know why I didn't try to disable them...  ???