Skip to content

Commit

Permalink
v1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
skinofthesoul committed Feb 12, 2021
1 parent 5537344 commit 7f9cf2a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v1.4.2
## 13-02-2021

1. [](#improved)
* added option in plugin settings to set target="\_blank" on mailto links

# v1.4.1
## 24-11-2020

Expand Down
8 changes: 7 additions & 1 deletion antispam.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ private function munge($array, $string = "link")
$string = "'".$array[4]."'";
}

// check plugin settings
$config = $this->config();
$target = "";
if ($config['target']) {
$target = " target='_blank'";
}
$txt .= "\ncoded = \"" . $coded . "\"\n" .
" key = \"".$cipher."\"\n".
" shift=coded.length\n".
Expand All @@ -140,7 +146,7 @@ private function munge($array, $string = "link")
" link += (key.charAt(ltr))\n".
" }\n".
" }\n".
"document.write(\"<a href='mailto:\"+link+\"'>\"+".$string."+\"</a>\")\n" .
"document.write(\"<a href='mailto:\"+link+\"'$target>\"+".$string."+\"</a>\")\n" .
"\n".
"<" . "/script><noscript>".$this->grav['language']->translate(['PLUGIN_ANTISPAM.NOSCRIPT'])."<"."/noscript>";
//dump($txt);
Expand Down
12 changes: 11 additions & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Antispam
version: 1.4.1
version: 1.4.2
description: Automatic obfuscation of plain text email addresses in Grav pages.
icon: at
author:
Expand All @@ -24,3 +24,13 @@ form:
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
target:
type: toggle
label: PLUGIN_ANTISPAM.TARGET_BLANK
highlight: 0
default: 0
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
2 changes: 2 additions & 0 deletions languages.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
en:
PLUGIN_ANTISPAM:
NOSCRIPT: '[email address is javascript encrypted]'
TARGET_BLANK: 'add target="_blank" to mailto links'

de:
PLUGIN_ANTISPAM:
NOSCRIPT: '[Mailadresse ist Javascript-verschlüsselt]'
TARGET_BLANK: 'als Ziel für erzeugte Mailto-Links target="_blank" setzen'

0 comments on commit 7f9cf2a

Please sign in to comment.