Skip to content

Commit c6a54c1

Browse files
authored
[5.2] EmailRule unique should look at submitted input data instead of stored form data. (joomla#43822)
1 parent b864b19 commit c6a54c1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/src/Form/Rule/EmailRule.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ public function test(\SimpleXMLElement $element, $value, $group = null, ?Registr
164164
$query = $db->getQuery(true);
165165

166166
// Get the extra field check attribute.
167-
$userId = ($form instanceof Form) ? (int) $form->getValue('id') : 0;
167+
$userId = ($form instanceof Form) && $form->getValue('id')
168+
? (int) $form->getValue('id')
169+
: (($input instanceof Registry) ? (int) $input->get('id') : 0);
168170

169171
// Build the query.
170172
$query->select('COUNT(*)')

0 commit comments

Comments
 (0)