[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [BP][FIX] Validatorslib: failing validation due to the input captured incorrectly

"Merci Jacob \(@mercihabam\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68c001bd97cc4_2cdda7c2141f@gitlab-sidekiq-low-urgency-cpu-bound-v2-c47cfc97d-pqdqd.mail>

Merci Jacob pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
b5f2585d by Olivier Kango at 2025-09-09T10:23:55+00:00
[BP][FIX] Validatorslib: failing validation due to the input captured incorrectly
---
* [FIX] Validatorslib: failing validation due to the input captured incorrectly
---
* [FIX] Validatorlib: failing validation due to the input captured incorrectly

See merge request tikiwiki/tiki!5456

(cherry picked from commit 613dbb74ef9fcc45d7af4ce2094bb75881641abf)

See merge request tikiwiki/tiki!7368

- - - - -


1 changed file:

- lib/validatorslib.php


Changes:

=====================================
lib/validatorslib.php
=====================================
@@ -132,22 +132,9 @@ class Validators
                         $validationjs .= 'parameter: "' . addslashes($field_value['validationParam']) . '", ';
                     }
                     $validationjs .= 'message: "' . tra($field_value['validationMessage']) . '", ';
-                    $validationjs .= 'input: function() { ';
-                    if ($prefix == 'ins_' && $field_value['type'] == 'a') {
-                        $validationjs .= 'return $("textarea[name=\'' . $prefix . $field_value['fieldId'] . '\']").val(); ';
-                    } elseif ($prefix == 'ins_' && $field_value['type'] == 'k') {
-                        $validationjs .= 'return $("#page_selector_' . $field_value['fieldId'] . '").val(); ';
-                    } elseif ($prefix == 'ins_' && $field_value['type'] == 'u') {
-                        $validationjs .= 'return $("#user_selector_' . $field_value['fieldId'] . '").val(); ';
-                    } else {
-                        if ($field_value['type'] == 'g' or $field_value['type'] == 'e' or $field_value['type'] == 'y' or $field_value['type'] == 'd' or $field_value['type'] == 'D') {
-                            // Let's handle drop-down style fields
-                            $validationjs .= 'return $(\'select[name="' . $prefix . $field_value['fieldId'] . '"] option:selected\').text(); ';
-                        } else {    // Let's handle text style fields
-                            $validationjs .= 'return $("#' . $prefix . $field_value['fieldId'] . '").val(); ';
-                        }
-                    }
-                    $validationjs .= '} } } ';
+                    $validationjs .= 'input: function() { return $("[name=' . $prefix . $field_value['fieldId'] . ']").val(); }';
+                    $validationjs .= '';
+                    $validationjs .= '} } ';
                 } else {
                     // remove last comma (not supported in IE7)
                     $validationjs = rtrim($validationjs, ' ,');



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b5f2585da5db2608abbb3a76b63a5b5d17c10619

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b5f2585da5db2608abbb3a76b63a5b5d17c10619
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.