Skip to content

Commit

Permalink
Make it safer
Browse files Browse the repository at this point in the history
  • Loading branch information
ggppdk committed Oct 1, 2017
1 parent 3dd7345 commit af63062
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions administrator/components/com_fields/helpers/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ public static function prepareForm($context, JForm $form, $data)

// Account for case that a submitted form has a multi-value category id field (e.g. a filtering form), just use the first category
$assignedCatids = is_array($assignedCatids)
? reset($assignedCatids)
: $assignedCatids;
? (int) reset($assignedCatids)
: (int) $assignedCatids;

if (!$assignedCatids && $formField = $form->getField('catid'))
{
Expand Down

0 comments on commit af63062

Please sign in to comment.