Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix #414
  • Loading branch information
maxsite committed Oct 21, 2020
1 parent 7f9ef53 commit 6b0ab1d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion application/maxsite/common/core/format.php
Expand Up @@ -80,7 +80,8 @@ function mso_menu_build($menu = '', $select_css = 'selected', $add_link_admin =
}

// определим текущий url
$current_url = getinfo('site_protocol') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$current_url = mso_current_url(true);
// $current_url = getinfo('site_protocol') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

$out = '';

Expand Down
8 changes: 5 additions & 3 deletions application/maxsite/common/core/url.php
Expand Up @@ -44,7 +44,7 @@ function mso_segment_array()
if (isset($_SERVER['REQUEST_URI']) and $_SERVER['REQUEST_URI']) {
// http://localhost/page/privet?get=hello
$url = getinfo('site_protocol');
$url .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$url .= $_SERVER['HTTP_HOST'] . mso_clean_str($_SERVER['REQUEST_URI']);
$url = str_replace($CI->config->config['base_url'], '', $url); // page/privet?get=hello

if (strpos($url, '?') !== FALSE) {
Expand Down Expand Up @@ -78,7 +78,7 @@ function mso_url_get()
{
$CI = &get_instance();
if (isset($_SERVER['REQUEST_URI']) and $_SERVER['REQUEST_URI'] and (strpos($_SERVER['REQUEST_URI'], '?') !== FALSE)) {
$url = getinfo('site_protocol') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$url = getinfo('site_protocol') . $_SERVER['HTTP_HOST'] . mso_clean_str($_SERVER['REQUEST_URI']);
$url = str_replace($CI->config->config['base_url'], "", $url);
$url = explode('?', $url);

Expand Down Expand Up @@ -221,7 +221,9 @@ function mso_get_permalink_page($id = 0, $prefix = 'page/')
// если $absolute = true, то возвращается текущий урл как есть
function mso_current_url($absolute = false, $explode = false, $delete_request = false)
{
$url = getinfo('site_protocol') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$url = getinfo('site_protocol') . $_SERVER['HTTP_HOST'] . mso_clean_str($_SERVER['REQUEST_URI']);

//pr($url);

if ($delete_request) {
// отделим по «?»
Expand Down
2 changes: 1 addition & 1 deletion application/maxsite/plugins/global_cache/index.php
Expand Up @@ -65,7 +65,7 @@ function global_cache_uninstall($args = array())
# если $dir = true, то добавляем каталог html
function global_cache_key($dir = true)
{
$cache_key = $_SERVER['REQUEST_URI'];
$cache_key = mso_clean_str($_SERVER['REQUEST_URI']); //$_SERVER['REQUEST_URI'];
$cache_key = str_replace('/', '-', $cache_key);
$cache_key = mso_slug(' ' . $cache_key);

Expand Down
2 changes: 1 addition & 1 deletion application/maxsite/plugins/sape/index.php
Expand Up @@ -78,7 +78,7 @@ function sape_init($args = array())
// таким образом обнаружить продажную ссылку будет невозможно
if (isset($_SERVER['argv']) and $_SERVER['argv']) // есть какие-то параметры - делаем редирект
{
$url = $_SERVER['REQUEST_URI']; // /?nono /about/?momo
$url = mso_clean_str($_SERVER['REQUEST_URI']); // $_SERVER['REQUEST_URI']; // /?nono /about/?momo

$url = explode('?', $url);
if (isset($url[0])) $url = $url[0];
Expand Down

0 comments on commit 6b0ab1d

Please sign in to comment.