in database.php
Code: Select all
function findLanguageInString($string)
{
// get a list of options
global $preferences;
global $link;
$columnnames = array("Code", "Name");
$data = mysqli_query($link, "SELECT ".implode(", ", $columnnames)." FROM Language")
or die(__FILE__.__LINE__.mysqli_error($link));
// check against all languages in the database
while($info = mysqli_fetch_array($data))
{
// check against all specified columns
foreach($columnnames as $columnname)
{
if (preg_match("/#".$info[$columnname]."(#|\s|$)/i", $string) === 1)
return $info;
}
}
// return it
return null;
}
I don't know any php and it isn't tested, so use with care. Only the body of the foreach loop was changed.