Update canonical link condition (#1881)

This commit is contained in:
Luffy
2025-06-11 16:39:39 +08:00
committed by GitHub
parent ba4e4134ad
commit d9d0be334d
4 changed files with 4 additions and 4 deletions

View File

@@ -1015,7 +1015,7 @@ class Archive extends Contents
$allows = self::pluginHandle()->filter('headerOptions', $allows, $this);
$title = (empty($this->archiveTitle) ? '' : $this->archiveTitle . ' » ') . $this->options->title;
$header = $this->is('single') ? '<link rel="canonical" href="' . $this->archiveUrl . '" />' . "\n" : '';
$header = ($this->is('single') && !$this->is('index')) ? '<link rel="canonical" href="' . $this->archiveUrl . '" />' . "\n" : '';
if (!empty($allows['pingback']) && 2 == $this->options->allowXmlRpc) {
$header .= '<link rel="pingback" href="' . $allows['pingback'] . '" />' . "\n";

View File

@@ -452,7 +452,7 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
}
}
$allow &= ($this->row['allow' . ucfirst($permission)] == 1) and !$this->hidden;
$allow &= ($this->row['allow' . ucfirst($permission)] == 1) && !$this->hidden;
}
}