diff --git a/vendor/thinkcmf/cmf-appstore/src/controller/AppStoreController.php b/vendor/thinkcmf/cmf-appstore/src/controller/AppStoreController.php index 36c256cca1e334671edbb8a098ef91eb01277a38..96545246cd62b58667dcfc0e8cb61c5aa657dfad 100644 --- a/vendor/thinkcmf/cmf-appstore/src/controller/AppStoreController.php +++ b/vendor/thinkcmf/cmf-appstore/src/controller/AppStoreController.php @@ -69,7 +69,11 @@ class AppStoreController extends AppStoreAdminBaseController if (!empty($findAppSetting)) { $installedApp = $findAppSetting['option_value']; $mApp['installed'] = 1; - $mApp['need_update'] = $installedApp['version'] == $mApp['version'] ? 0 : 1; + if (version_compare($mApp['version'], $installedApp['version'], '>')) { + $mApp['need_update'] = 1; + } else { + $mApp['need_update'] = 0; + } $mApp['installed_app'] = $installedApp; } @@ -127,7 +131,11 @@ class AppStoreController extends AppStoreAdminBaseController if (!empty($installedPlugins[$pluginName]) && is_dir(WEB_ROOT . 'plugins' . DIRECTORY_SEPARATOR . cmf_parse_name($plugin['name'], 0))) { $installedPlugin = $installedPlugins[$pluginName]; $plugin['installed'] = 1; - $plugin['need_update'] = $installedPlugin['version'] == $plugin['version'] ? 0 : 1; + if (version_compare($plugin['version'], $installedPlugin['version'], '>')) { + $plugin['need_update'] = 1; + } else { + $plugin['need_update'] = 0; + } $plugin['installed_plugin'] = $installedPlugin; } @@ -183,7 +191,11 @@ class AppStoreController extends AppStoreAdminBaseController $findTheme = ThemeModel::where('theme', $themeName)->find(); if (!empty($findTheme)) { $mTheme['installed'] = 1; - $mTheme['need_update'] = $findTheme['version'] == $mTheme['version'] ? 0 : 1; + if (version_compare($mTheme['version'],$findTheme['version'],'>')) { + $mTheme['need_update'] = 1; + } else { + $mTheme['need_update'] = 0; + } $mTheme['installed_theme'] = $findTheme; } } else { @@ -193,7 +205,11 @@ class AppStoreController extends AppStoreAdminBaseController if (!empty($findThemeSetting)) { $installedTheme = $findThemeSetting['option_value']; $mTheme['installed'] = 1; - $mTheme['need_update'] = $installedTheme['version'] == $mTheme['version'] ? 0 : 1; + if (version_compare($mTheme['version'],$installedTheme['version'],'>')) { + $mTheme['need_update'] = 1; + } else { + $mTheme['need_update'] = 0; + } $mTheme['installed_theme'] = $installedTheme; } } diff --git a/vendor/thinkcmf/cmf/src/common.php b/vendor/thinkcmf/cmf/src/common.php index b992d75989e7ff95ef770408a4b6fb9f1442d57c..cd5f8eb6204abb2dd6be17988ff1fb22aecb0bbe 100644 --- a/vendor/thinkcmf/cmf/src/common.php +++ b/vendor/thinkcmf/cmf/src/common.php @@ -463,7 +463,7 @@ function cmf_param_lable($tag = '') foreach ($array as $v) { $v = trim($v); if (!empty($v)) { - [$key, $val] = explode(':', $v); + list($key, $val) = explode(':', $v); $param[trim($key)] = trim($val); } } @@ -1048,6 +1048,18 @@ function cmf_is_wechat() return false; } +/** + * 判断是否为支付宝访问 + * @return boolean + */ +function cmf_is_alipay() +{ + if( strpos($_SERVER['HTTP_USER_AGENT'], 'AlipayClient') !== false ) { + return true; + } + return false; +} + /** * 判断是否为Android访问 * @return boolean @@ -1885,8 +1897,12 @@ function cmf_lang_url(string $langSet = '', string $url = ''): string switch ($langConfig['multi_lang_mode']) { case 1: // URL模式 { - if (!empty($langConfig['lang_alias'][$langSet])) { - $langSet = $langConfig['lang_alias'][$langSet]; + if ($langSet == $langConfig['default_lang']) { + $langSet = ''; + } else { + if (!empty($langConfig['lang_alias'][$langSet])) { + $langSet = $langConfig['lang_alias'][$langSet]; + } } $url = rtrim(cmf_get_root() . "/$langSet", '/') . "/$url"; @@ -1939,15 +1955,15 @@ function cmf_url($url = '', $vars = '', $suffix = true, $domain = false, $lang = $anchor = $info['fragment']; if (false !== strpos($anchor, '?')) { // 解析参数 - [$anchor, $info['query']] = explode('?', $anchor, 2); + list($anchor, $info['query']) = explode('?', $anchor, 2); } if (false !== strpos($anchor, '@')) { // 解析域名 - [$anchor, $domain] = explode('@', $anchor, 2); + list($anchor, $domain) = explode('@', $anchor, 2); } } elseif (strpos($url, '@') && false === strpos($url, '\\')) { // 解析域名 - [$url, $domain] = explode('@', $url, 2); + list($url, $domain) = explode('@', $url, 2); } } @@ -2055,7 +2071,6 @@ function cmf_replace_content_file_url($content, $isForDbSave = false) } } else { - $href = empty($href) ? '' : $href; if (!(preg_match("/^\//", $href) || preg_match("/^http/", $href))) { $link->attr("href", cmf_get_file_download_url($href)); }