From 016c9ceb1703938895448291b805398019354d54 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Tue, 31 Jan 2023 11:17:41 +0100 Subject: [PATCH] Generated ` @@ -47,7 +47,7 @@ spiders to lift email addresses off of a site. me@example.com {mailto address="me@example.com" encode="javascript_charcode"} - diff --git a/src/FunctionHandler/Mailto.php b/src/FunctionHandler/Mailto.php index 5e5337ea0..8f7b821a5 100644 --- a/src/FunctionHandler/Mailto.php +++ b/src/FunctionHandler/Mailto.php @@ -109,12 +109,12 @@ public function handle($params, Template $template) { for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { $js_encode .= '%' . bin2hex($string[$x]); } - return ''; + return ''; } elseif ($encode === 'javascript_charcode') { for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { $ord[] = ord($string[$x]); } - return ''; + return ''; } elseif ($encode === 'hex') { preg_match('!^(.*)(\?.*)$!', $address, $match); if (!empty($match[2])) { diff --git a/src/debug.tpl b/src/debug.tpl index 4f82a5820..64add8643 100644 --- a/src/debug.tpl +++ b/src/debug.tpl @@ -166,7 +166,7 @@ {/capture} -'; + $result = ''; $tpl = $this->smarty->createTemplate('eval:{mailto address="me@example.com" encode="javascript"}'); $this->assertEquals(str_replace("\r", '', $result), $this->smarty->fetch($tpl)); } public function testEncodeJavascriptCharcode() { - $result = ''; + $result = ''; $tpl = $this->smarty->createTemplate('eval:{mailto address="me@example.com" encode="javascript_charcode"}'); $this->assertEquals(str_replace("\r", '', $result), $this->smarty->fetch($tpl)); } @@ -85,7 +85,7 @@ public function testUmlauts() public function testJavascriptChars() { - $result = ''; + $result = ''; $this->smarty->assign('address', 'me@example.com">me@example.com\'); alert("injection"); //'); $tpl = $this->smarty->createTemplate('eval:{mailto address=$address encode=javascript}'); $this->assertEquals(str_replace("\r", '', $result), $this->smarty->fetch($tpl));