AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Closed] URLs with query parameters break pagination

9 Posts
2 Users
0 Reactions
3,590 Views
SimSync2
Posts: 7
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@simsync2)
Active Member
Joined: 9 years ago
[#4613]

I came across an issue with url query parameters on my side.
Due to another plugin, my urls always look like: https://www.example.com/community/welcome/?v=bb246f82a8c8
Unfortunaly, this breaks the functionality of the pagination buttons and they do not work as expected.

I looked around in the sourcecode to find the function responsible to generate the links for the pagination buttons and changed it quick and dirty to make the buttons work.
The code i've changed can be found in the function "wpforo_get_request_uri", file: "wpf-includes/functions.php", line 244 (version 1.3.1):

old: 
return $protocol . "://" . $_SERVER['HTTP_HOST'] . ($with_port ? $port : '') . $_SERVER['REQUEST_URI'];

new:
return $protocol . "://" . $_SERVER['SERVER_NAME'] . ($with_port ? $port : '') . (strpos($_SERVER['REQUEST_URI'], "?") ? substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], "?")) : $_SERVER['REQUEST_URI']);

That did the trick at least for me. Would be great to have an official solution for this issue in one of the next releases.

Thanks Achim


8 Replies
Robert
Posts: 10716
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 2 months ago

Thank you for sharing this. We'll take this under consideration. But one think I can say, we'll not change $_SERVER['HTTP_HOST']  to  $_SERVER['SERVER_NAME'] .


SimSync2
Posts: 7
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@simsync2)
Active Member
Joined: 9 years ago

No, no ... i saw this also after i've posted it and changed it to HTTP_HOST in my source.
I've created and implemented that solution already in the version 1.1 of wpForo. It just took some time to come over here to share it... 😉


Robert
Posts: 10716
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 2 months ago

I didn't follow you. But in any case, this will not be changed for sure. The rest maybe.


SimSync2
Posts: 7
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@simsync2)
Active Member
Joined: 9 years ago

Issue is still present in v1.4


Page 1 / 2
Share: