From c4e76569eeccdbb791e3d8431f773d573cfbc2e1 Mon Sep 17 00:00:00 2001
From: Tim Otten <totten@civicrm.org>
Date: Fri, 29 Mar 2013 20:49:30 -0400
Subject: [PATCH] Add more URL tokens

---
 CRM/Utils/System.php | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php
index dda43997ba..13d7322425 100644
--- a/CRM/Utils/System.php
+++ b/CRM/Utils/System.php
@@ -1513,13 +1513,12 @@ class CRM_Utils_System {
   }
 
   /**
-   * Determine the URL which provides a feed of available extensions
+   * Evaluate any tokens in a URL
    *
    * @param string|FALSE $url
    * @return string|FALSE
    */
   public static function evalUrl($url) {
-    // boolean false means don't try to check extensions
     if ($url === FALSE) {
       return FALSE;
     }
@@ -1529,7 +1528,14 @@ class CRM_Utils_System {
         '{ver}' => CRM_Utils_System::version(),
         '{uf}' => $config->userFramework,
         '{php}' => phpversion(),
+        '{sid}' => md5('sid_' . (defined('CIVICRM_SITE_KEY') ? CIVICRM_SITE_KEY : '') . '_' . $config->userFrameworkBaseURL),
+        '{baseUrl}' => $config->userFrameworkBaseURL,
+        '{lang}' => $config->lcMessages,
+        '{co}' => $config->defaultContactCountry,
       );
+      foreach (array_keys($vars) as $k) {
+        $vars[$k] = urlencode($vars[$k]);
+      }
       return strtr($url, $vars);
     }
   }
-- 
GitLab