/wp-content/plugins/copy-safe/copy-safe.php
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
- <?php
- /*
- Plugin Name: copy-safe
- Version: 0.1
- Plugin URI: http://securityresearch.in/srplugins/
- Description: Encodes all content retreived from database (including tags, links etc), hence prevents copying of content!!
- Author: StubHorn
- Author URI: http://radsinnovativesolutions.com
- */
-
- function copy_enc()
- {
- $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);}";
- $encoded='';
- $length=mb_strlen($js);
- for($i=0;$i<$length;$i++)
- {
- $encoded.='%'.wordwrap(bin2hex(mb_substr($js,$i,1)),2,'%',true);
- }
- echo "<SCRIPT LANGUAGE=\"Javascript\">
- <!--
- eval(unescape(unescape(\"".urlencode($encoded)."\")));
- //-->
- </SCRIPT>";
- }
-
- function copy_pro($content)
- {
- $content2="";
- for($i=0; $i<strlen($content); $i++)
- {
- if((ord($content[$i])!=10)&&(ord($content[$i])!=(13)))
- $content2 = $content2.chr(ord($content[$i])+3);
- }
- $content2 = "<SCRIPT LANGUAGE=\"Javascript\">
- <!--
- abcd(\"".$content2;
- $content2 = $content2."\");
- //-->
- </SCRIPT>";
- return $content2;
- }
- add_action('init', 'copy_enc');
- add_filter('the_content', 'copy_pro',10,1);
- ?>