Skip to content

Commit

Permalink
refs #6028 make sure there is always a value defined as the field is …
Browse files Browse the repository at this point in the history
…marked as NOT NULL
  • Loading branch information
tsteur committed Aug 20, 2014
1 parent 1954142 commit c01a9b8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/UserSettings/Columns/Language.php
Expand Up @@ -32,6 +32,12 @@ public function getName()
*/
public function onNewVisit(Request $request, Visitor $visitor, $action)
{
return substr($request->getBrowserLanguage(), 0, 20);
$language = $request->getBrowserLanguage();

if (empty($language)) {
return '';
}

return substr($language, 0, 20);
}
}

0 comments on commit c01a9b8

Please sign in to comment.