MyBB Community Forums

Full Version: strange url after login
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi.

I have just installed 1.4.13

It is on a domaine called: mc-nøglesvingerne.dk

When I login in I get the: "You have been succesfully loged in".
But when the site redirectes me "back" I get send to this URL:

http://mc-n&atilde/;¸glesvingerne.dk/index.php

I belive it has somethin to do with the fact that the domain contains a: Ø !?!

If i the clicks the "back" button in the browser and refreshes the index page - then Im loged in !

Logging out works fine!

Any solution (other than new domain) ?

board at: mc-nøglesvingerne.dk
user: test
pass: testme
That's a problem of PHP: http://dev.mybb.com/issues/407
Will the "solution" by editing code work for me ?


***EDIT***
tried it - but did not work...
If the problem is only with login, try removing htmlentities() from member.php

--- member.php	2010-05-20 15:00:22.737800838 +0200
+++ member.php	2010-05-20 15:00:18.947800850 +0200
@@ -1077,7 +1077,7 @@
 			$mybb->input['url'] = str_replace('&', '&', $mybb->input['url']);
 			
 			// Redirect to the URL if it is not member.php
-			redirect(htmlentities($mybb->input['url']), $lang->redirect_loggedin);
+			redirect($mybb->input['url'], $lang->redirect_loggedin);
 		}
 		else
 		{
@@ -1111,11 +1111,11 @@
 	// Redirect to the page where the user came from, but not if that was the login page.
 	if($mybb->input['url'] && !preg_match("/action=login/i", $mybb->input['url']))
 	{
-		$redirect_url = htmlentities($mybb->input['url']);
+		$redirect_url = $mybb->input['url'];
 	}
 	elseif($_SERVER['HTTP_REFERER'])
 	{
-		$redirect_url = htmlentities($_SERVER['HTTP_REFERER']);
+		$redirect_url = $_SERVER['HTTP_REFERER'];
 	}
 	
 	$captcha = "";

Please note that this does not fix domains with special characters - I just traced where those &atilde/; ¸ came from, and removed the culprit. Tested with löcälhöst and verified that the login redirect now works. Could cause other issues though (haven't tested for code injections and the like), so use at your own risk.

You could also try setting your bburl to the ascii representation http://xn--mc-nglesvingerne-oxb.dk - but that does not help either if MyBB uses $ SERVER / GET / POST instead of the bburl setting.
It is the quicklogin that is the problem.
Altered header_welcomeblock_guest template - so that it will skip quicklogin and take me to member.php?action=login
Seens to be an ok workaround for me!

Thanks for the replys - Ill get back if (read: when) I get in trouble again.
We really should be using a variant of url encoding, not html entity encoding, on redirect headers.