$i = 0; foreach ($value as $val) { $uri = set_url_var($uri, $key . '[' . $i++ . ']', $val, $sanitize); } } else { $uri = set_url_var($uri, $key, $value, $sanitize); } } return $uri; } } // // taken from 1.5.2-svn functions/global.php on 2008/11/26 // since 1.5.2 and 1.4.17 // if ((!compatibility_check_sm_version(1, 4, 17) || compatibility_check_sm_version(1, 5, 0) && !compatibility_check_sm_version(1, 5, 2)) && !function_exists('is_ssl_secured_connection')) { function is_ssl_secured_connection() { global $sq_ignore_http_x_forwarded_headers, $sq_https_port; $https_env_var = getenv('HTTPS'); if ($sq_ignore_http_x_forwarded_headers || !sqgetGlobalVar('HTTP_X_FORWARDED_PROTO', $forwarded_proto, SQ_SERVER)) { $forwarded_proto = ''; } if (empty($sq_https_port)) { // won't work with port 0 (zero) $sq_https_port = 443; } if (isset($https_env_var) && strcasecmp($https_env_var, 'on') === 0 || sqgetGlobalVar('HTTPS', $https, SQ_SERVER) && !empty($https) && strcasecmp($https, 'off') !== 0 || strcasecmp($forwarded_proto, 'https') === 0 || sqgetGlobalVar('SERVER_PORT', $server_port, SQ_SERVER) && $server_port == $sq_https_port) { return TRUE; } return FALSE;
return $key; } } // // taken from 1.4.10-svn functions/i18n.php on 2007/04/01 // since 1.5.1 and 1.4.10 // // This code was taken from 1.4.10, because it will work with // all 1.4.x and 1.5.x code, but does not support ngettext // compatibility that was added to this function in 1.5.x... // lowest common denominator... if you want and need ngettext // support, just upgrade to 1.5.1+ or settle for the crude // ngettext replacement herein (which won't provide correct // translations in some languages) // if ((!compatibility_check_sm_version(1, 4, 10) || compatibility_check_sm_version(1, 5, 0) && !compatibility_check_sm_version(1, 5, 1)) && !function_exists('sq_bindtextdomain')) { function sq_bindtextdomain($domain, $dir = '') { global $languages, $sm_notAlias; if (empty($dir)) { $dir = SM_PATH . 'locale/'; } $dir = bindtextdomain($domain, $dir); // set codeset in order to avoid gettext charset conversions // if (function_exists('bind_textdomain_codeset') && isset($languages[$sm_notAlias]['CHARSET'])) { // Japanese translation uses different internal charset // if ($sm_notAlias == 'ja_JP') { bind_textdomain_codeset($domain, 'EUC-JP'); } else {
<?php // // $base_uri is not globally available in some // places in 1.4.x, but it is in 1.5.x... although // plugin authors are encouraged to use sqm_baseuri() // which is known to work in both environments // // need to run php_self() before we call sqm_baseuri() // // sqm_baseuri was moved from display_messages.php // as of version 1.4.6... HOWEVER, we cannot include // display_messages.php here because of some chicken- // egg problems that are then introduced and all // plugins will stop working. The only solution is to // copy the sqm_baseuri() code directly here to calculate // $base_uri... which is overall, a rather inefficient // (albiet in a small way in the scheme of things) way // to provide this compatibility of $base_uri to plugin // authors in 1.4.5 and below. // global $PHP_SELF, $base_uri; $PHP_SELF = php_self(); if (!compatibility_check_sm_version(1, 4, 6)) { $dirs = array('|src/.*|', '|plugins/.*|', '|functions/.*|'); $repl = array('', '', ''); $base_uri = preg_replace($dirs, $repl, $PHP_SELF); } else { $base_uri = sqm_baseuri(); }