| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
class CRM_Mailing_BAO_TrackableURL extends CRM_Mailing_DAO_TrackableURL {
/**
- * Class constructor
+ * Class constructor.
*/
public function __construct() {
parent::__construct();
* Given a url, mailing id and queue event id, find or construct a
* trackable url and redirect url.
*
- * @param string $url The target url to track
- * @param int $mailing_id The id of the mailing
- * @param int $queue_id The queue event id (contact clicking through)
+ * @param string $url
+ * The target url to track.
+ * @param int $mailing_id
+ * The id of the mailing.
+ * @param int $queue_id
+ * The queue event id (contact clicking through).
*
- * @return string $redirect The redirect/tracking url
- * @static
+ * @return string
+ * The redirect/tracking url
*/
public static function getTrackerURL($url, $mailing_id, $queue_id) {
$tracker->url = $url;
$tracker->mailing_id = $mailing_id;
- if(strlen($tracker->url) > 254) {
+ if (strlen($tracker->url) > 254) {
return $url;
}
if (!$tracker->find(TRUE)) {
* @param $url
* @param $mailing_id
*
- * return int Url id of the given url and mail
+ * @return int
+ * Url id of the given url and mail
*/
public static function getTrackerURLId($url, $mailing_id) {
$tracker = new CRM_Mailing_BAO_TrackableURL();
return;
}
- $protos = '(https?|ftp)';
+ $protos = '(https?|ftp)';
$letters = '\w';
- $gunk = '/#~:.?+=&%@!\-';
- $punc = '.:?\-';
- $any = "{$letters}{$gunk}{$punc}";
+ $gunk = '/#~:.?+=&%@!\-';
+ $punc = '.:?\-';
+ $any = "{$letters}{$gunk}{$punc}";
if ($onlyHrefs) {
$pattern = "{\\b(href=([\"'])?($protos:[$any]+?(?=[$punc]*[^$any]|$))([\"'])?)}im";
}
$msg = preg_replace($pattern, $replacement, $msg);
}
+
}