Ledger Nano X - The secure hardware wallet

XSS prevention, attempt 1

ulfben Sep 20th, 2013 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function wpdt_escape_js($unsafe){
  2.         if(function_exists('json_encode')){ //php 4.
  3.                 return json_encode($unsafe);
  4.         }      
  5.         return str_replace('/', '&#x2F;', htmlspecialchars($unsafe, ENT_QUOTES, 'UTF-8')); //escape &<>"' and /
  6. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand