Fix: Added a bool parameter to Lang::line() to bypass error logging #1832

Closed
wants to merge 3 commits into
from
View
@@ -149,14 +149,15 @@ public function load($langfile, $idiom = '', $return = FALSE, $add_suffix = TRUE
* Fetch a single line of text from the language array
*
* @param string $line the language line
+ * @param bool $log bypass error logging (default: TRUE)
* @return string
*/
- public function line($line = '')
+ public function line($line = '', $log = TRUE)
{
$value = ($line === '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line];
// Because killer robots like unicorns!
- if ($value === FALSE)
+ if ($value === FALSE && $log)
{
log_message('error', 'Could not find the language line "'.$line.'"');
}
@@ -240,7 +240,7 @@ public function result($results = array())
{
foreach ($val as $k => $v)
{
- if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$v))))
+ if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$v), FALSE)))
{
$v = $line;
}
@@ -249,7 +249,7 @@ public function result($results = array())
}
else
{
- if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val))))
+ if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val), FALSE)))
{
$val = $line;
}