This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

backslash being stripped from my code in text view

9 years ago · Last reply by josephrajewski 9 years ago

We’re using SiteOrigin Visual Composer on our website, but we copy/paste Oracle generated form code into our pages.
In doing so, the following “regex” is included inline of that code for javascript validation.

When we paste this:
([^@s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})$

Visual editor actually changes it to this:
([^@s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})$

Notice the backslashes (2 of them) are missing before the 1st ‘s’ & again between the ‘+’ & the ‘.’ on the version “saved” by visual composer. Seems like NONE of this should be stripping characters off.

Any ideas as to how or why this is being stripped off upon saving out “text mode” code in visual composer??

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

10
  1. Alex S Staff 9 years, 5 months ago

    Hi Joe,

    It was also stripped here. :(

    Basically, it’s being filtered on the frontend and on the backend. To get past the backend filter, you’ll need to escape the backslash (two backslashes with no spaces \\). Just don’t save the page again or it’ll remove it.

    To get past both, which depending on context might not be possible, you could also use the HTML entity for backslash \

  2. josephrajewski 9 years, 5 months ago

    >> . Just don't save the page again or it'll remove it.

    Just to verify, can I save it one time with the \\ <smb://'> to get it to work correctly? then if we re-enter/update the page… we just need to be aware that it requires a \\ again?

  3. Alex S Staff 9 years, 5 months ago

    Hi Joe,

    Yes. Saving it once will lead to one of the slashes being stripped. Saving it again will lead to the remaining slash being stripped. To avoid this add another backslash to prevent both from being stripped.

  4. josephrajewski 9 years, 5 months ago

    Thank you for the clarification/confirmation.

    Do you foresee a fix to this in the future (a refinement to the code)? Or is this just an implication of SQL storage & the code?

    – Joe

  5. Alex S Staff 9 years, 5 months ago

    Hi Joe,

    A fix. It’s an issue with how we preparing the data for storage. This means that you won’t have to go make and update your old posts when the fix is made.

  6. josephrajewski 9 years, 5 months ago

    That’s great to hear, how do I keep in the loop on when a fix is released?

    – Joe

  7. Alex S Staff 9 years, 5 months ago

    Hi Joe,

    If you have a GitHub account you can ask to be notified about through the issue created for this.

  8. josephrajewski 9 years, 5 months ago

    Done, subscribed for that notification.

    Thanks for all the guidance/help.

    – Joe

  9. Alex S Staff 9 years, 5 months ago

    Hi Joe,

    Happy to help! :)

    Marking this as closed from a support standpoint.

  10. josephrajewski 9 years, 5 months ago

    I concur.

    – Joe

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread