/**
 *
 *
 * @file modifier.encryptUrl.php
 * @package plugins
 * @author fengfei02@baidu.com
 * @date 2012-08-30 01:40
 */
function smarty_modifier_encryptUrl($url, $maxRandomStrLen = '', $encKeyStr = '')
{
    $URLEncryption = CSmarty::getURLEncryption();
    if (0 === intval($URLEncryption)) {
        return $url;
    }
    $result = encryptUrl($url, $maxRandomStrLen, $encKeyStr);
    if (false == $result) {
        $result = '';
    }
    return $result;
}
Beispiel #2
0
function backend_encrypt_url(&$data, $platform, $language, $type, $templateName)
{
    /**
     * encrypt page's url
     */
    $URLEncryption = CSmarty::getURLEncryption();
    if (1 === intval($URLEncryption)) {
        $time_encrypt_start = Volatile::microtime(true) * 1000;
        /**
         * encrypt page url
         */
        $conf = load_tpl_conf($platform, $language, $type, $templateName);
        /**
         * url encrypt or not
         */
        if (1 === intval($conf['is_urlencrypt'])) {
            foreach ($conf['enc'] as $key => $value) {
                process_aladdin_data($data, $value);
            }
        }
        $log_key = 'time_urlencrypt_' . $templateName;
        $GLOBALS['logArr'][$log_key] = round(Volatile::microtime(true) * 1000 - $time_encrypt_start, 2);
        $GLOBALS['time_count_temp']['time_urlencrypt_total'] += $GLOBALS['logArr'][$log_key];
    }
}