add some string operations on url creation

This commit is contained in:
Marc Michalsky forumZFD 2021-02-11 18:44:33 +01:00
parent eb07c5cf73
commit e5efd76e66
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9

View file

@ -194,6 +194,13 @@ class CRM_TwingleCampaign_BAO_TwingleCampaign {
*/ */
private private
function createUrl() { function createUrl() {
// Trim parent_project_url
$this->values['parent_project_url'] = trim($this->values['parent_project_url']);
// If url ends with a '/', remove it
if (substr($this->values['parent_project_url'], -1) == '/') {
$this->values['parent_project_url'] =
substr_replace($this->values['parent_project_url'], '', -1);
}
$this->values['url'] = $this->values['url'] =
$this->values['parent_project_url'] . '?tw_cid=' . $this->values['cid']; $this->values['parent_project_url'] . '?tw_cid=' . $this->values['cid'];
} }