-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create EEL Helpers to provide MailObfuscator functions in Fusion
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Networkteam\Neos\MailObfuscator\Eel; | ||
|
||
use Neos\Eel\ProtectedContextAwareInterface; | ||
use Networkteam\Neos\MailObfuscator\Converter\Mailto2HrefObfuscatingConverter; | ||
use Networkteam\Neos\MailObfuscator\Converter\RewriteAtCharConverter; | ||
|
||
/** | ||
* Eel helpers to provide MailObfuscator functions | ||
*/ | ||
class MailObfuscator extends RewriteAtCharConverter implements ProtectedContextAwareInterface { | ||
|
||
/** | ||
* Convert at Character | ||
* | ||
* @param $email string | ||
* @return string | ||
*/ | ||
public function convertAtChar($email = false) { | ||
return $this->convert($email); | ||
} | ||
|
||
/** | ||
* Convert Mailto to Href | ||
* | ||
* @param $email string | ||
* @return string | ||
*/ | ||
public function convertMailto2Href($email = false) { | ||
return (new Mailto2HrefObfuscatingConverter())->convert($email); | ||
} | ||
|
||
/** | ||
* All methods are considered safe | ||
* | ||
* @param string $methodName | ||
* @return boolean | ||
*/ | ||
public function allowsCallOfMethod($methodName) { | ||
return true; | ||
} | ||
} |