Commit 9ab4c52c authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fixes #7860. Shown Text is only splitted if it is a email address.

parent 50bd3312
Pipeline #2337 passed with stages
in 2 minutes and 48 seconds
......@@ -24,7 +24,6 @@
namespace IMATHUZH\Qfq\Core\Report;
use IMATHUZH\Qfq\Core\Database\Database;
use IMATHUZH\Qfq\Core\Evaluate;
use IMATHUZH\Qfq\Core\Helper\HelperFile;
use IMATHUZH\Qfq\Core\Helper\KeyValueStringParser;
......@@ -1037,19 +1036,31 @@ class Report {
break;
}
$t1 = explode("@", $mailConfig[0], 2);
$content .= "<script language=javascript><!--" . chr(10);
if (empty($mailConfig[1])) {
$mailConfig[1] = $mailConfig[0];
$mailConfig[1] = $mailConfig[0]; // Copy to text shown
}
$content .= "<script language=javascript><!--" . chr(10);
$toEmail = explode("@", $mailConfig[0], 2);
// Broken data - do not stop, might come from a single database record.
if (count($toEmail) < 2) {
$toEmail[1] = 'broken.email.address';
}
$content .= 'var email = "' . $toEmail[0] . '"' . chr(10);
$content .= 'var emailHost = "' . $toEmail[1] . '"' . chr(10);
$content .= 'var contact = "' . substr($mailConfig[1], 0, 2) . '"' . chr(10);
$content .= 'var contact1 = "' . substr($mailConfig[1], 2) . '"' . chr(10);
$content .= 'var email = "' . $t1[0] . '"' . chr(10);
$content .= 'var emailHost = "' . $t1[1] . '"' . chr(10);
$toName = explode("@", $mailConfig[1], 2);
$secondPart = '';
if (count($toName) > 1) {
$toName[0] .= "@";
$content .= 'var contactHost = "' . $toName[1] . '"' . chr(10);
$secondPart = "<span>\" + contactHost + \"</span>";
}
$content .= 'var contact = "' . $toName[0] . '"' . chr(10);
$content .= 'document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+ "><span>" + contact
+ "</span><span>" + contact1 + "</span></a>")' . chr(10);
+ "</span>' . $secondPart . '</a>")' . chr(10);
$content .= '//--></script>';
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment