Skip to Content Skip to Menu

[#5560] PERL REGEX for validation

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
9 years 1 week ago #271916 by krileon
Replied by krileon on topic PERL REGEX for validation
Seams to be an escaping issue with backslashes. For JS based RegExp object construction the backslashes need to be escaped. I'm not sure why it's not working properly all of a sudden. The below will remove the addslashes and allow it to work, but I'm unsure what it'll break at this time.

IN: libraries/CBLib/CB/Legacy/cbValidator.php
ON: Lines 73 - 75
FROM:
Code:
} elseif ( $rule == 'pattern' ) { $params = addslashes( $params ); }
TO:
Code:
}

I've created a bug ticket to investigate further.

forge.joomlapolis.com/issues/5560


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.
The following user(s) said Thank You: edmundcheong

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

9 years 1 week ago #271918 by edmundcheong
Replied by edmundcheong on topic PERL REGEX for validation
Okay. I will make the corrections and give you my feedback. It is night time here and I should give a feedback to help improve CB.

Will do more testing and post my findings here so that you are able isolate the problem.

So far tested another one for cash amount for 99999.99 is also starting to misbehave.

Thanks for the temporary fix Kyle.

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

9 years 1 week ago #271919 by edmundcheong
Replied by edmundcheong on topic PERL REGEX for validation
Btw, were you able to simulate it on your side?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
9 years 1 week ago - 9 years 1 week ago #271920 by krileon
Replied by krileon on topic PERL REGEX for validation
Yes, I'm able to confirm the issue. Removing the addslashes resolves it, but I'm unsure as to what browsers will support this. The MDN documentation still states to escape them, but that doesn't appear to work anymore and they're being treated like characters. So will have to dig further into JS usage in browsers to see what's going on.


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.
Last edit: 9 years 1 week ago by krileon.

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

9 years 1 week ago #271921 by edmundcheong
Replied by edmundcheong on topic PERL REGEX for validation
Okay Kyle, i'll do a browser check and get back you on this.

The funny thing is that it some fields are okay and some not. I've checked the configurations and it is identical.

Thanks again.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
9 years 1 week ago #271930 by krileon
Replied by krileon on topic PERL REGEX for validation
Ok, tested IE/FF/Chrome working with the above fix. Will be implementing for next nightly.


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.
The following user(s) said Thank You: edmundcheong

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

Moderators: beatnantkrileon
Powered by Kunena Forum