Update canonical link condition (#1881)
This commit is contained in:
@@ -14,7 +14,7 @@ $this->need('header.php');
|
||||
|
||||
<main class="container">
|
||||
<div class="container-thin">
|
||||
<?php if (!($this->is('index')) and !($this->is('post'))): ?>
|
||||
<?php if (!($this->is('index')) && !($this->is('post'))): ?>
|
||||
<h6 class="text-center text-muted">
|
||||
<?php $this->archiveTitle([
|
||||
'category' => _t('分类 %s 下的文章'),
|
||||
|
||||
@@ -13,7 +13,7 @@ $this->need('header.php');
|
||||
?>
|
||||
|
||||
<div class="col-mb-12 col-8" id="main" role="main">
|
||||
<?php if (!($this->is('index')) and !($this->is('post'))): ?>
|
||||
<?php if (!($this->is('index')) && !($this->is('post'))): ?>
|
||||
<h3 class="archive-title"><?php $this->archiveTitle([
|
||||
'category' => _t('分类 %s 下的文章'),
|
||||
'search' => _t('包含关键字 %s 的文章'),
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user