Notifications
Clear all

wpForo 1.x.x [Closed] URLs with query parameters break pagination

9 Posts
2 Users
0 Reactions
2,171 Views
SimSync2
Posts: 7
Topic starter
(@simsync2)
Active Member
Joined: 7 years ago

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: 10587
Admin
(@robert)
Support Team
Joined: 9 years 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
(@simsync2)
Active Member
Joined: 7 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: 10587
Admin
(@robert)
Support Team
Joined: 9 years 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
(@simsync2)
Active Member
Joined: 7 years ago

Issue is still present in v1.4

Page 1 / 2