projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a48c71
)
CRM-10230 Custom fields text type with limited length not validated
author
sunil
<esunil.pawar@gmail.com>
Tue, 31 May 2016 06:27:14 +0000
(11:57 +0530)
committer
sunil
<esunil.pawar@gmail.com>
Tue, 31 May 2016 06:27:14 +0000
(11:57 +0530)
CRM/Core/BAO/CustomField.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Core/BAO/CustomField.php
b/CRM/Core/BAO/CustomField.php
index ec67256b03d887a9dd669e8725798e1c8d5e7c29..8d3297f2b569ac3742774745db947d2442c3f5ee 100644
(file)
--- a/
CRM/Core/BAO/CustomField.php
+++ b/
CRM/Core/BAO/CustomField.php
@@
-864,6
+864,12
@@
class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
$qf->add('text', $elementName . '_to', ts('To'), $field->attributes);
}
else {
+ if ($field->text_length) {
+ $field->attributes .= ' maxlength=' . $field->text_length;
+ if ($field->text_length < 20) {
+ $field->attributes .= ' size=' . $field->text_length;
+ }
+ }
$element = $qf->add('text', $elementName, $label,
$field->attributes,
$useRequired && !$search