phpBBSEO / usu

Ultimate SEO URL
32 stars 25 forks source link

Error "The forum you selected does not exist" after login redirect to post reply #78

Closed hbcafe closed 9 years ago

hbcafe commented 9 years ago

To recreate, logout and click "Post Reply" to an existing thread:

http://www.example.com/posting.php?mode=reply&f=3&t=32933

This leads to the login. Log in and submit. This redirects incorrectly:

http://www.example.com/forums/posting.php?amp%3Bf=3&amp%3Bt=32933&mode=reply&sid=341ab22e62bdec354ae9dcc5526b8743

Notice the "amp%3B" above. Below are the settings:

$settings = array ( 'url_rewrite' => true, 'modrtype' => 3, 'sql_rewrite' => true, 'profile_inj' => false, 'profile_vfolder' => true, 'profile_noids' => true, 'rewrite_usermsg' => false, 'rem_sid' => true, 'rem_hilit' => true, 'rem_small_words' => false, 'virtual_folder' => true, 'virtual_root' => true, 'cache_layer' => true, 'rem_ids' => true, 'redirect_404_forum' => false, 'redirect_404_topic' => false, 'copyrights' => array ( 'img' => true, 'txt' => '', 'title' => '', ), 'zero_dupe' => array ( 'on' => true, 'strict' => true, 'post_redir' => 'all', ), ); $forum_urls = array ( ... );

dcz commented 9 years ago

This works for me with code from master. I wonder if you're up to date on this because posting.php should now always link to it's real location, even with virtual root. Can you confirm?

hbcafe commented 9 years ago

I cloned usu and nodupe, but the result is the same. You are correct that this fixed the posting.php URL:

http://www.example.com/forums/posting.php?mode=post&f=6

So while the posting.php URL is correct, the mode=reply URL is the same:

http://www.example.com/forums/posting.php?amp%3Bf=6&amp%3Bt=32928&mode=reply&sid=714207013a95c9dd221d13414d5222ce

Is it possible Symphony is mangling the URL? I searched on '%3B' and found a match in its code.

PS: I noticed the generated .htaccess was missing 'search.\php'.

     RewriteRule ^.+/(style\.php|ucp\.php|mcp\.php|faq\.php|posting\.php|download/file\.php|report\.php|adm/index\.php|cron\.php)$ /forums/$1 [QSA,L,NC]
hbcafe commented 9 years ago

This isn't really a fix, but a hack to workaround the problem:

function build_url($strip_vars = false) { global $config, $user, $phpbb_path_helper;

$php_ext = $phpbb_path_helper->get_php_ext();
$page = $user->page['page'];

// HBCAFE workaround for https://github.com/phpBBSEO/usu/issues/78
$page = str_replace('amp%3B', '', $page);
dcz commented 9 years ago

I still cannot reproduce ...

I fixed issue with urlencoding and pagination : https://github.com/phpBBSEO/usu/pull/79

It's rather unreleated, but since I fail to reproduce.

hbcafe commented 9 years ago

Sounds reasonable.

dcz commented 9 years ago

what do you mean, do you still have the issue ?

hbcafe commented 9 years ago

I meant that I believe your assertion that this was caused by the bug in urlencoding that was presumably fixed by https://github.com/phpBBSEO/usu/pull/79 ...however, I haven't verified. I will do so the next time I update.