Jump to content

Search the Community

Showing results for tags 'encrypt'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I have a wordpress site. I found this plugin which searches the page once wordpress has spit it out and obfuscates all emails it can find. I'm a noob, so bear with me here. This is the code: <?php /* Plugin Name: Make Safe Plugin URI: http://wordpress.org/extend/plugins/makesafe Description: Obfuscates email addresses. Version: 1.0 Author: Loud Dog Author URI: http://www.louddog.com */ if (!class_exists("LoudDog_MakeSafe")) { class LoudDog_MakeSafe { function __construct() { if (is_admin()) return; add_action('init', array($this, 'start'), 10); } function start() { ob_start(array($this, 'filter')); } function filter($content) { preg_match_all('/<a.*href="(mailto:.*?)".*?>(.*?)<\/a>/', $content, $matches); for ($ndx = 0; $ndx < count($matches[0]); $ndx++) { $email = ''; foreach(str_split($matches[1][$ndx]) as $chr) { $email .= rand(0,1) ? $chr : "".ord($chr).";"; } $text = ''; foreach(str_split($matches[2][$ndx]) as $chr) { $text .= rand(0,1) ? $chr : "".ord($chr).";"; } $code = str_split("<a href='$email'>$text</a>", 7); $code = "document.write(\"".implode('"+"', $code)."\");"; $code = str_split($code); $code = array_map('ord', $code); $code = array_map('dechex', $code); $code = "\x".implode("\x", $code); $code = "<script type='text/javascript'>"."eval(unescape('$code'));"."</script>"; $content = str_replace($matches[0][$ndx], $code, $content); } return $content; } } new LoudDog_MakeSafe(); } What I'm hoping is able to be done is have this search for a specific text instead. I have another plugin that spits out the url to mp3 files. I'd like to obfuscate any url ending with a ".mp3" in it. Mind you, the plugin doesn't actually post links, as in "<a href>" tags. I'm trying to prevent folks from finding the location to the mp3 file by viewing the source code. I'd just like to have those urls obfuscated. If that's too difficult, I'd settle for obfuscating anything that contains "http://www.mydomain.com/folder" in it. Is this something that PHP is able to do? Can the above code be modified simply to achieve this? If not, any suggestions are welcome! Thank you. ~Quest~
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.