PageRenderTime 48ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/copy-safe/copy-safe.php

https://bitbucket.org/crypticrod/sr_wp_code
PHP | 45 lines | 33 code | 2 blank | 10 comment | 3 complexity | 1e754e2a47aa8eca32d70934926f676d MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.1, GPL-3.0, LGPL-2.0, AGPL-3.0
  1. <?php
  2. /*
  3. Plugin Name: copy-safe
  4. Version: 0.1
  5. Plugin URI: http://securityresearch.in/srplugins/
  6. Description: Encodes all content retreived from database (including tags, links etc), hence prevents copying of content!!
  7. Author: StubHorn
  8. Author URI: http://radsinnovativesolutions.com
  9. */
  10. function copy_enc()
  11. {
  12. $js ="function abcd(lol){var oo='';var i=0;for(i=0;i<lol.length;i++){oo+=String.fromCharCode(lol.charCodeAt(i)-3);}oo=''+oo+'';document.write(oo);}";
  13. $encoded='';
  14. $length=mb_strlen($js);
  15. for($i=0;$i<$length;$i++)
  16. {
  17. $encoded.='%'.wordwrap(bin2hex(mb_substr($js,$i,1)),2,'%',true);
  18. }
  19. echo "<SCRIPT LANGUAGE=\"Javascript\">
  20. <!--
  21. eval(unescape(unescape(\"".urlencode($encoded)."\")));
  22. //-->
  23. </SCRIPT>";
  24. }
  25. function copy_pro($content)
  26. {
  27. $content2="";
  28. for($i=0; $i<strlen($content); $i++)
  29. {
  30. if((ord($content[$i])!=10)&&(ord($content[$i])!=(13)))
  31. $content2 = $content2.chr(ord($content[$i])+3);
  32. }
  33. $content2 = "<SCRIPT LANGUAGE=\"Javascript\">
  34. <!--
  35. abcd(\"".$content2;
  36. $content2 = $content2."\");
  37. //-->
  38. </SCRIPT>";
  39. return $content2;
  40. }
  41. add_action('init', 'copy_enc');
  42. add_filter('the_content', 'copy_pro',10,1);
  43. ?>