Skip to content

Commit

Permalink
Fix: [ bug #1471 ] Several PHP warnings when intercepting USER_CREATE
Browse files Browse the repository at this point in the history
trigger (Add a protection to avoid multiple errors).
  • Loading branch information
eldy committed Jun 20, 2014
1 parent a272482 commit 2dc3e5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion htdocs/core/class/translate.class.php
Expand Up @@ -345,6 +345,8 @@ private function getTradFromKey($key)
{
global $db;

if (! is_string($key)) return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly.

//print 'xx'.$key;
$newstr=$key;
if (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg))
Expand Down Expand Up @@ -659,7 +661,7 @@ function getLabelFromKey($db,$key,$tablename,$fieldkey,$fieldlabel,$keyforselect

//print 'param: '.$key.'-'.$keydatabase.'-'.$this->trans($key); exit;

// Check if in language array (this can call getTradFromKey)
// Check if a translation is available (this can call getTradFromKey)
if ($this->transnoentitiesnoconv($key) != $key)
{
return $this->transnoentitiesnoconv($key); // Found in language array
Expand Down

0 comments on commit 2dc3e5b

Please sign in to comment.