Jump to content

Errors in convertLegacyParameters for forums app


TSP

Recommended Posts

Posted

Hi, 

applications/forums/Application.php, method convertLegacyParameters. 

1) Page-parameter is not converted properly, incorrect function-call. 

2) This is a bit more involved. Before the upgrade, a link to a specific post could look like this: 

https://example.com/index.php?showtopic=1706933&page=607#entry25148242

However, after it's been through the post conversion (3.4 -> 4.4), the link in the post looks like this instead: 

https://example.com/index.php?showtopic=1706933&page=607&do=findComment&comment=25148242

And that link only takes you to the topic (and the page given, if the first bug is fixed).

So my suggested fixes is: 

@@ -202,9 +202,13 @@ class _Application extends \IPS\Application
                        {
                                $url = $url->setQueryString( array( 'do' => 'findComment', 'comment' => \IPS\Request::i()->p ?: \IPS\Request::i()->findpost ) );
                        }
+                       elseif ( isset( \IPS\Request::i()->do ) and \IPS\Request::i()->do === 'findComment' and isset( \IPS\Request::i()->comment ) )
+                       {
+                               $url = $url->setQueryString( array( 'do' => 'findComment', 'comment' => \IPS\Request::i()->comment ) );
+                       }
                        elseif ( isset( \IPS\Request::i()->page ) )
                        {
-                               $url = $url->setPage( array( 'page' => \IPS\Request::i()->page ) );
+                               $url = $url->setPage( 'page', \IPS\Request::i()->page );
                        }
                        \IPS\Output::i()->redirect( $url );
                }

 

  • 2 months later...
Posted
On 12/3/2019 at 3:45 PM, bfarber said:

I'll take a look at this, thanks.

Any news on the state of this? Doesn't seem to have been resolved in the latest updates. 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...