Jump to content

Errors in convertLegacyParameters for forums app


TSP

Recommended Posts

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 );
                }

 

Link to comment
Share on other sites

  • 2 months later...

Archived

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

  • Recently Browsing   0 members

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