Skip to Content Skip to Menu

[#5560] PERL REGEX for validation

9 years 6 days ago #272023 by edmundcheong
Replied by edmundcheong on topic PERL REGEX for validation

krileon wrote: It requires changes to the PHP side and our cbvalidate jQuery plugin so you'll need to wait for next nightly release. New nightly release will be today after the MR is reviewed, approved, and merged (we use peer review between us 3 to ensure code quality).

You can try the below quickfix, but it'll require your site to stay in debug mode unless you've a JS compression to minify the JS file.

IN: libraries/CBLib/CB/Legacy/cbValidator.php
ON: Lines 73 - 75
FROM:

Code:
} elseif ( $rule == 'pattern' ) { $params = addslashes( $params ); }
TO:
Code:
} elseif ( $rule == 'pattern' ) { $params = urlencode( $params ); }

IN: components/com_comprofiler/js/jquery/jquery.cbvalidate.js
ON: Lines 674 - 675
FROM:
Code:
if ( typeof params === 'string' ) { var delimiter = params.substr( 0, 1 );
TO:
Code:
if ( typeof params === 'string' ) { params = decodeURIComponent( params ); var delimiter = params.substr( 0, 1 );

Note the above will likely be wrong line numbers due to some changes further up in the validation file. You'll need to find the validation rule as follows.

Code:
$.validator.addMethod( 'pattern', function( value, element, params ) {

Again this won't work unless you compress the JS to update the minified version or keep your site in debug mode. Also note that some of your issue could be caused by out of date jQuery validate plugin, which has been updated for next nightly as well.


I'll wait for the nightly built.. :pinch:

Errr nightly built for the core CB 2.0.11 or some other plugins? I'll stay tune for it.. thanks again..

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
9 years 6 days ago #272033 by krileon
Replied by krileon on topic PERL REGEX for validation
It'll be a nightly build of CB 2.x.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

9 years 5 days ago #272067 by edmundcheong
Replied by edmundcheong on topic PERL REGEX for validation

krileon wrote: It'll be a nightly build of CB 2.x.


is this the nightly build which has rectified the problem (located in Category: CBSubs GPL Download Area)? Just to confirm.

pkg_communitybuilder_2.0.0.ci.2014.10.08.00.20+4903f48c9.zip

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
9 years 5 days ago - 9 years 5 days ago #272070 by nant
Replied by nant on topic PERL REGEX for validation

edmundcheong wrote:

krileon wrote: It'll be a nightly build of CB 2.x.


is this the nightly build which has rectified the problem (located in Category: CBSubs GPL Download Area)? Just to confirm.

pkg_communitybuilder_2.0.0.ci.2014.10.08.00.20+4903f48c9.zip


there is new nightly - always grab from here:

www.joomlapolis.com/cb-20-addon-status
Last edit: 9 years 5 days ago by nant.
The following user(s) said Thank You: edmundcheong

Please Log in or Create an account to join the conversation.

9 years 5 days ago - 9 years 5 days ago #272075 by edmundcheong
Replied by edmundcheong on topic PERL REGEX for validation
Remember I spoke about the fields with the same value? One was working and the other didn't, I think it did not solve that problem.

Could it be that the tab that the field is in is also conditioned? It is conditioned by a regex expression /abc|123|xyz/?
Last edit: 9 years 5 days ago by edmundcheong.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
9 years 3 days ago #272118 by krileon
Replied by krileon on topic PERL REGEX for validation
I'm unable to confirm an issue with multiple fields having custom regexp validation. You could have a conflict with CB Conditional (try disabling it).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum