Skip to content

Commit ca4a6ba

Browse files
kenjismichalsn
andauthored
docs: fix incorrect sample code
The length of a UUID is 128 bits. That is 32 chars, but typically expressed with a structure of 8-4-4-4-12 separated by hyphens. Co-authored-by: Michal Sniatala <michal@sniatala.pl>
1 parent 9cefb0e commit ca4a6ba

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • user_guide_src/source/libraries/validation

user_guide_src/source/libraries/validation/038.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
// is_unique[table.field,ignore_field,ignore_value]
44

55
$validation->setRules([
6-
'name' => "max_length[30]|is_unique[supplier.name,uuid, {$uuid}]", // is not ok
7-
'name' => "max_length[30]|is_unique[supplier.name,uuid,{$uuid} ]", // is not ok
8-
'name' => "max_length[30]|is_unique[supplier.name,uuid,{$uuid}]", // is ok
9-
'name' => 'max_length[30]|is_unique[supplier.name,uuid,{uuid}]', // is ok - see "Validation Placeholders"
6+
'name' => "max_length[36]|is_unique[supplier.name,uuid, {$uuid}]", // is not ok
7+
'name' => "max_length[36]|is_unique[supplier.name,uuid,{$uuid} ]", // is not ok
8+
'name' => "max_length[36]|is_unique[supplier.name,uuid,{$uuid}]", // is ok
9+
'name' => 'max_length[36]|is_unique[supplier.name,uuid,{uuid}]', // is ok - see "Validation Placeholders"
1010
]);
1111
// Warning: If `$uuid` is a user input, be sure to validate the format of the value before using it.
1212
// Otherwise, it is vulnerable.

0 commit comments

Comments
 (0)