ulfben

XSS prevention, attempt 1

Sep 20th, 2013
394
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.22 KB | None | 0 0
  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. }
Advertisement
Comments
  • Rteuixl
    53 days
    # text 0.21 KB | 0 0
    1. Best t33n active cpx link daily updates!
    2.  
    3. Copy and paste the link in a new browser tab and then hit enter!
    4.  
    5. https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
    6.  
    7. Remove the @
  • Aukizux
    12 hours
    # text 0.19 KB | 0 0
    1. Best t33n active cpx link daily updates!
    2.  
    3. Copy and paste the link in a new browser tab and then hit enter!
    4.  
    5. https://crazyporn.xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
Add Comment
Please, Sign In to add comment