Kompatibilität mit Contao 3.5.0 hergestellt
This commit is contained in:
parent
bd310110b0
commit
5602f44935
@ -52,12 +52,12 @@ class PageRoot_Aeo extends \PageRoot {
|
|||||||
* @param boolean
|
* @param boolean
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function generate($pageId, $blnReturn=false) {
|
public function generate($pageId, $blnReturn=false, $blnPreferAlias=false) {
|
||||||
$id = $this->AeoRedirectUtil->redirectFromRootPage();
|
$id = $this->AeoRedirectUtil->redirectFromRootPage();
|
||||||
if ($id !== FALSE) {
|
if ($id !== FALSE) {
|
||||||
return $id;
|
return $id;
|
||||||
} else {
|
} else {
|
||||||
return parent::generate($pageId, $blnReturn);
|
return parent::generate($pageId, $blnReturn, $blnPreferAlias);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,8 @@ namespace cgoIT\aeo;
|
|||||||
* Class AeoFrontendUtil
|
* Class AeoFrontendUtil
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('REGEXP_EMAIL_PREFIX', '(\w[-._\w]*\w)\@');
|
//define('REGEXP_EMAIL_PREFIX', '(\w[-._\w]*\w)\@');
|
||||||
define('REGEXP_EMAIL', '\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,18}');
|
define('REGEXP_EMAIL', '\w[-._\w]*\w@[\d\w][-._\w]*\w\.\w{2,18}');
|
||||||
define('REGEXP_MAILTO_LINK', '/(?P<all>\<a(?P<before>[^>]+)href\=["\']mailto\:(?P<email>\w[-._\w]*\w)\@(?P<domain>\w[-._\w]*\w)\.(?P<suffix>\w{2,18})(?P<params>\?{0,1}[\w=&; ]*)["\'](?P<after>[^>]*)\>).*?\<\/a\>/ism');
|
define('REGEXP_MAILTO_LINK', '/(?P<all>\<a(?P<before>[^>]+)href\=["\']mailto\:(?P<email>\w[-._\w]*\w)\@(?P<domain>\w[-._\w]*\w)\.(?P<suffix>\w{2,18})(?P<params>\?{0,1}[\w=&; ]*)["\'](?P<after>[^>]*)\>).*?\<\/a\>/ism');
|
||||||
|
|
||||||
class AeoFrontendUtil extends \Frontend {
|
class AeoFrontendUtil extends \Frontend {
|
||||||
@ -356,7 +356,7 @@ class Aeo extends \System {
|
|||||||
// jetzt alle nicht verlinkten eMail-Adressen verschleiern.
|
// jetzt alle nicht verlinkten eMail-Adressen verschleiern.
|
||||||
$arrNoAeoAreas = $this->getNoAeoAreas($output);
|
$arrNoAeoAreas = $this->getNoAeoAreas($output);
|
||||||
$intOffset = 0;
|
$intOffset = 0;
|
||||||
while(preg_match('/'.REGEXP_EMAIL_PREFIX.'/esm', $output, $arrNonLinkedeMail, PREG_OFFSET_CAPTURE, $intOffset)) {
|
while(preg_match('/'.REGEXP_EMAIL.'/esm', $output, $arrNonLinkedeMail, PREG_OFFSET_CAPTURE, $intOffset)) {
|
||||||
if ($this->isEnabled($arrNonLinkedeMail[0][1], $arrNoAeoAreas)) {
|
if ($this->isEnabled($arrNonLinkedeMail[0][1], $arrNoAeoAreas)) {
|
||||||
$output = $this->str_replace($arrNonLinkedeMail[0][0], $this->obfuscateWithMethod($arrNonLinkedeMail[0][0], $this->method, false, $arrNonLinkedeMail[0][1], $intOffset), $output, $arrNonLinkedeMail[0][1]);
|
$output = $this->str_replace($arrNonLinkedeMail[0][0], $this->obfuscateWithMethod($arrNonLinkedeMail[0][0], $this->method, false, $arrNonLinkedeMail[0][1], $intOffset), $output, $arrNonLinkedeMail[0][1]);
|
||||||
|
|
||||||
@ -504,6 +504,8 @@ class Aeo extends \System {
|
|||||||
switch ($this->method) {
|
switch ($this->method) {
|
||||||
case 'rtl':
|
case 'rtl':
|
||||||
$css .= '.obfuscated { unicode-bidi: bidi-override; direction: rtl; }';
|
$css .= '.obfuscated { unicode-bidi: bidi-override; direction: rtl; }';
|
||||||
|
// Hack für FireFox
|
||||||
|
//$css .= '*>.obfuscated { unicode-bidi: -moz-isolate-override !important; }';
|
||||||
break;
|
break;
|
||||||
case 'nullspan':
|
case 'nullspan':
|
||||||
$css .= 'span.obfuscated { display: none; }';
|
$css .= 'span.obfuscated { display: none; }';
|
||||||
@ -551,14 +553,15 @@ class Aeo extends \System {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function shorten ($email, $includeCss) {
|
function shorten ($email, $includeCss) {
|
||||||
if (strlen ($email) <= 4) {
|
$arrEmail = explode('@', $email);
|
||||||
$email = substr ($email, 0, 1);
|
if (strlen ($arrEmail[0]) <= 4) {
|
||||||
} else if (strlen ($email) <= 6) {
|
$email = substr ($arrEmail[0], 0, 1);
|
||||||
$email = substr ($email, 0, 3);
|
} else if (strlen ($arrEmail[0]) <= 6) {
|
||||||
|
$email = substr ($arrEmail[0], 0, 3);
|
||||||
} else {
|
} else {
|
||||||
$email = substr ($email, 0, 4);
|
$email = substr ($arrEmail[0], 0, 4);
|
||||||
}
|
}
|
||||||
return $email.'...'.($includeCss ? '' : '@');
|
return $email.'...'.($includeCss ? '' : '@').$arrEmail[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
function rtl ($email, $includeCss) {
|
function rtl ($email, $includeCss) {
|
||||||
@ -566,25 +569,26 @@ class Aeo extends \System {
|
|||||||
if ($includeCss) {
|
if ($includeCss) {
|
||||||
return '<span style="unicode-bidi: bidi-override; direction: rtl;">'.$strEmail.'</span>';
|
return '<span style="unicode-bidi: bidi-override; direction: rtl;">'.$strEmail.'</span>';
|
||||||
}
|
}
|
||||||
return '<span class="obfuscated">'.strrev($email).'</span>';
|
return '<span class="obfuscated">'.$strEmail.'</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function nullspan ($email, $includeCss) {
|
function nullspan ($email, $includeCss) {
|
||||||
if (strlen ($email) <= 4) {
|
$arrEmail = explode('@', $email);
|
||||||
$email1 = substr ($email, 0, 1);
|
if (strlen ($arrEmail[0]) <= 4) {
|
||||||
$email2 = substr ($email, 1);
|
$email1 = substr ($arrEmail[0], 0, 1);
|
||||||
} else if (strlen ($email) <= 6) {
|
$email2 = substr ($arrEmail[0], 1);
|
||||||
$email1 = substr ($email, 0, 3);
|
} else if (strlen ($arrEmail[0]) <= 6) {
|
||||||
$email2 = substr ($email, 3);
|
$email1 = substr ($arrEmail[0], 0, 3);
|
||||||
|
$email2 = substr ($arrEmail[0], 3);
|
||||||
} else {
|
} else {
|
||||||
$email1 = substr ($email, 0, 4);
|
$email1 = substr ($arrEmail[0], 0, 4);
|
||||||
$email2 = substr ($email, 4);
|
$email2 = substr ($arrEmail[0], 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($includeCss) {
|
if ($includeCss) {
|
||||||
return $email1.'<span style="display: none;">null</span>'.$email2;
|
return $email1.'<span style="display: none;">null</span>'.$email2.'@'.$arrEmail[1];
|
||||||
}
|
}
|
||||||
return $email1.'<span class="obfuscated">null</span>'.$email2;
|
return $email1.'<span class="obfuscated">null</span>'.$email2.'@'.$arrEmail[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNoAeoAreas($output) {
|
function getNoAeoAreas($output) {
|
||||||
|
Loading…
Reference in New Issue
Block a user