1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-21 16:22:22 +02:00

[ticket/9970] Rename validate_language() to validate_language_iso_name().

PHPBB3-9970
This commit is contained in:
Andreas Fischer 2011-03-07 00:23:49 +01:00
parent 0f16fd3519
commit ac90190682
3 changed files with 9 additions and 9 deletions

View File

@ -1426,19 +1426,19 @@ function validate_match($string, $optional = false, $match = '')
*
* Tests whether a language name is valid and installed
*
* @param string $lang The language string to test
* @param string $lang_iso The language string to test
*
* @return bool|string Either false if validation succeeded or
* a string which will be used as the error message
* (with the variable name appended)
* @return bool|string Either false if validation succeeded or
* a string which will be used as the error message
* (with the variable name appended)
*/
function validate_language($lang)
function validate_language_iso_name($lang_iso)
{
global $db;
$sql = 'SELECT lang_id
FROM ' . LANG_TABLE . "
WHERE lang_iso = '" . $db->sql_escape($lang) . "'";
WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'";
$result = $db->sql_query($sql);
$lang_id = (int) $db->sql_fetchfield('lang_id');
$db->sql_freeresult($result);

View File

@ -65,7 +65,7 @@ class ucp_prefs
$error = validate_data($data, array(
'dateformat' => array('string', false, 1, 30),
'lang' => array('language'),
'lang' => array('language_iso_name'),
'tz' => array('num', false, -14, 14),
));

View File

@ -56,7 +56,7 @@ class ucp_register
{
$use_lang = ($change_lang) ? basename($change_lang) : basename($user_lang);
if (!validate_language($use_lang))
if (!validate_language_iso_name($use_lang))
{
if ($change_lang)
{
@ -210,7 +210,7 @@ class ucp_register
array('email')),
'email_confirm' => array('string', false, 6, 60),
'tz' => array('num', false, -14, 14),
'lang' => array('language'),
'lang' => array('language_iso_name'),
));
if (!check_form_key('ucp_register'))