public $allowsAnimation = true;
+ protected static $_encryptedTypes = [14, 15, 35, 39];
+ protected static $_encryptedAttributes = ['image_rollover'];
+
/**
*
* @var CompilerInterface
* @throws \SodiumException
*/
public static function decryptLink($link) {
+ if (!in_array($link['type'], self::$_encryptedTypes)) {
+ return $link;
+ }
foreach ($link as $attr => $item) {
if (!str_starts_with($item, '///')) {
continue;
public static function decryptLinks($links) {
$res = [];
foreach ($links as $key => $link) {
+
$res[$key] = self::decryptLink($link);
}
return $res;
* @throws SodiumException
*/
public static function encryptLinkAttrs($link) {
- $crypted = [13, 14, 35];
-
- if (!isset($link['type']) || !in_array($link['type'], $crypted)) {
+ if (!isset($link['type']) || !in_array($link['type'], self::$_encryptedTypes)) {
return $link;
}
- $attrs = ['image_rollover'];
- foreach ($attrs as $attr) {
+ foreach (self::$_encryptedAttributes as $attr) {
if (!isset($link[$attr])) {
continue;
}