• I’m using the Email Address Encoder plugin that obscures email address by converting them to Unicode (Decimal and Hex).

    When I export with Simply Static, this will break the links (i.e. /community/#109;a#105;l#116;o) as it doesn’t recognize mailto links that might look like:

    #x6d;#x61;#x69;#108;to
    #109;a#105;l#116;o

    If the links could be run through mb_convert_encoding($txt, 'UTF-8', 'HTML-ENTITIES');, that will convert them back to UTF-8 to check and ignore processing them, keeping the Unicode encoding and not appending a relative URL.

    I’m just not sure where to put this in the code. I’ve been playing around in class-ss-url-extractor.php without much luck. My PHP is pretty bad, maybe something with more familiarity of the plugin’s code could advise?

    Thank you. Love this plugin!

    • This topic was modified 8 years, 3 months ago by briannyc2009.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter briannyc2009

    (@briannyc2009)

    I was able to get it working by editing function add_to_extracted_urls in class-ss-url-extractor.php.

    
    private function add_to_extracted_urls( $extracted_url ) {
    
    	$test = mb_convert_encoding($extracted_url, 'UTF-8', 'HTML-ENTITIES');
    
    	if ( substr( $test, 0, 6 ) === "mailto" ) return $extracted_url;
    	else {
    
    		$url = Util::relative_to_absolute_url( $extracted_url, $this->static_page->url );
    
    		if ( $url && Util::is_local_url( $url ) ) {
    			// add to extracted urls queue
    			$this->extracted_urls[] = Util::remove_params_and_fragment( $url );
    
    			$url = $this->convert_url( $url );
    		}
    
    		return $url;
    	}
    }
    
    • This reply was modified 8 years, 3 months ago by briannyc2009.
    • This reply was modified 8 years, 3 months ago by briannyc2009.
Viewing 1 replies (of 1 total)

The topic ‘Mailto Links Broken with Unicode Email Encoder’ is closed to new replies.