mirror of
https://github.com/typecho/typecho.git
synced 2025-01-17 04:28:17 +01:00
Fix themeUrl format
This commit is contained in:
parent
7279d4832d
commit
05e20c0ae5
@ -261,18 +261,18 @@ class Options extends Base
|
||||
*
|
||||
* @param string|null $path 子路径
|
||||
* @param string|null $theme 模版名称
|
||||
* @return string
|
||||
* @return string | void
|
||||
*/
|
||||
public function themeUrl(?string $path = null, ?string $theme = null): string
|
||||
public function themeUrl(?string $path, ?string $theme)
|
||||
{
|
||||
if (empty($theme)) {
|
||||
if (!isset($theme)) {
|
||||
echo Common::url($path, $this->themeUrl);
|
||||
} else {
|
||||
$url = defined('__TYPECHO_THEME_URL__') ? __TYPECHO_THEME_URL__ :
|
||||
Common::url(__TYPECHO_THEME_DIR__ . '/' . $theme, $this->siteUrl);
|
||||
|
||||
return isset($path) ? Common::url($path, $url) : $url;
|
||||
}
|
||||
|
||||
$url = defined('__TYPECHO_THEME_URL__') ? __TYPECHO_THEME_URL__ :
|
||||
Common::url(__TYPECHO_THEME_DIR__ . '/' . $theme, $this->siteUrl);
|
||||
|
||||
return Common::url($path, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -482,8 +482,7 @@ class Options extends Base
|
||||
*/
|
||||
protected function ___themeUrl(): string
|
||||
{
|
||||
return defined('__TYPECHO_THEME_URL__') ? __TYPECHO_THEME_URL__ :
|
||||
Common::url(__TYPECHO_THEME_DIR__ . '/' . $this->theme, $this->siteUrl);
|
||||
return $this->themeUrl(null, $this->theme);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,7 +46,7 @@ class Edit extends Options implements ActionInterface
|
||||
$this->update(['value' => 'recent'], $this->db->sql()->where('name = ?', 'frontPage'));
|
||||
}
|
||||
|
||||
$this->options->themeUrl = rtrim($this->options->themeUrl('', $theme), '/');
|
||||
$this->options->themeUrl = $this->options->themeUrl(null, $theme);
|
||||
|
||||
$configFile = $this->options->themeFile($theme, 'functions.php');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user