Skip to content

Commit

Permalink
#45 Referrer check breaks with UTF-8 URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick committed Aug 16, 2013
1 parent 1ac3ed5 commit c0018c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions admin_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@
// Make sure base_url doesn't end with a slash
if (substr($form['base_url'], -1) == '/')
$form['base_url'] = substr($form['base_url'], 0, -1);

// Convert IDN to Punycode if needed
if (preg_match('/[^\x00-\x7F]/', $form['base_url']))
{
if (!function_exists('idn_to_ascii'))
message($lang_admin_options['Base URL problem']);
else
$form['base_url'] = idn_to_ascii($form['base_url']);
}

$languages = forum_list_langs();
if (!in_array($form['default_lang'], $languages))
Expand Down
1 change: 1 addition & 0 deletions lang/English/admin_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'Board desc help' => 'A short description of this bulletin board (shown at the top of every page). This field may contain HTML.',
'Base URL label' => 'Base URL',
'Base URL help' => 'The complete URL of the board without trailing slash (i.e. http://www.mydomain.com/forums). This <strong>must</strong> be correct in order for all admin and moderator features to work. If you get "Bad referer" errors, it\'s probably incorrect.',
'Base URL problem' => 'Your installation does not support automatic conversion of internationalized domain names. As your base URL contains special characters, you <strong>must</strong> use an online converter in order to avoid "Bad referer" errors.',
'Timezone label' => 'Default time zone',
'Timezone help' => 'The default time zone for guests and users attempting to register for the board.',
'DST label' => 'Adjust for DST',
Expand Down

0 comments on commit c0018c4

Please sign in to comment.