This commit is contained in:
joyqi
2021-12-13 11:58:35 +08:00
parent c047669900
commit 157fc05265
4 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.2', '7.3', '7.4', '8.0']
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
steps:
- name: Checkout code
uses: actions/checkout@v2
+3 -1
View File
@@ -182,8 +182,10 @@ namespace Typecho {
*/
public static function url(?string $path, ?string $prefix): string
{
$path = $path ?? '';
$path = (0 === strpos($path, './')) ? substr($path, 2) : $path;
return rtrim($prefix, '/') . '/' . str_replace('//', '/', ltrim($path, '/'));
return rtrim($prefix ?? '', '/') . '/'
. str_replace('//', '/', ltrim($path, '/'));
}
/**
+3 -3
View File
@@ -20,10 +20,10 @@ trait QueryTrait
}
}
$sql['limit'] = (0 == strlen($sql['limit'])) ? null : ' LIMIT ' . $sql['limit'];
$sql['offset'] = (0 == strlen($sql['offset'])) ? null : ' OFFSET ' . $sql['offset'];
$sql['limit'] = isset($sql['limit']) ? ' LIMIT ' . $sql['limit'] : '';
$sql['offset'] = isset($sql['offset']) ? ' OFFSET ' . $sql['offset'] : '';
return 'SELECT ' . $sql['fields'] . ' FROM ' . $sql['table'] .
$sql['where'] . $sql['group'] . $sql['having'] . $sql['order'] . $sql['limit'] . $sql['offset'];
}
}
}
+1 -1
View File
@@ -585,7 +585,7 @@ class Contents extends Base implements QueryInterface
/** 处理密码保护流程 */
if (
strlen($value['password']) > 0 &&
strlen($value['password'] ?? '') > 0 &&
$value['password'] !== Cookie::get('protectPassword_' . $value['cid']) &&
$value['authorId'] != $this->user->uid &&
!$this->user->pass('editor', true)