Check if the strings array is actually a valid array before attempting to use it.

develop
Sven Slootweg 12 years ago
parent 63bb67a108
commit 81fd2500ea

@ -76,6 +76,8 @@ class Templater
public function Localize($strings)
{
if(!is_null($this->tpl))
{
if(is_array($strings))
{
foreach($strings as $key => $str)
{
@ -84,6 +86,11 @@ class Templater
}
}
else
{
Throw new Exception("No valid array of localized strings specified.");
}
}
else
{
Throw new Exception("No template loaded.");
}

Loading…
Cancel
Save