Home>Support>backslash being stripped from my code in text view

backslash being stripped from my code in text view

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. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 8 years, 28 days ago Alex S
    Hi, I Work Here

    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. 8 years, 28 days ago josephrajewski

    >> . 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. 8 years, 28 days ago Alex S
    Hi, I Work Here

    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. 8 years, 28 days ago josephrajewski

    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. 8 years, 28 days ago Alex S
    Hi, I Work Here

    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. 8 years, 28 days ago josephrajewski

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

    – Joe

  7. 8 years, 28 days ago Alex S
    Hi, I Work Here

    Hi Joe,

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

  8. 8 years, 28 days ago josephrajewski

    Done, subscribed for that notification.

    Thanks for all the guidance/help.

    – Joe

  9. 8 years, 28 days ago Alex S
    Hi, I Work Here

    Hi Joe,

    Happy to help! :)

    Marking this as closed from a support standpoint.

  10. 8 years, 28 days ago josephrajewski

    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.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More