fix undefined array key (#1688)
* fix undefined array key * fix: change security email
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
# Security Policy
|
||||
|
||||
Vulnerabilities can be reported by emailing info@joyqi.com
|
||||
Vulnerabilities can be reported by emailing security@typecho.org
|
||||
|
||||
@@ -79,16 +79,16 @@ class Comments extends Base implements QueryInterface, RowFilterInterface, Prima
|
||||
$insertStruct = [
|
||||
'cid' => $rows['cid'],
|
||||
'created' => empty($rows['created']) ? $this->options->time : $rows['created'],
|
||||
'author' => Common::strBy($rows['author']),
|
||||
'author' => Common::strBy($rows['author'] ?? null),
|
||||
'authorId' => empty($rows['authorId']) ? 0 : $rows['authorId'],
|
||||
'ownerId' => empty($rows['ownerId']) ? 0 : $rows['ownerId'],
|
||||
'mail' => Common::strBy($rows['mail']),
|
||||
'url' => Common::strBy($rows['url']),
|
||||
'ip' => Common::strBy($rows['ip'], $this->request->getIp()),
|
||||
'agent' => Common::strBy($rows['agent'], $this->request->getAgent()),
|
||||
'text' => Common::strBy($rows['text']),
|
||||
'type' => Common::strBy($rows['type'], 'comment'),
|
||||
'status' => Common::strBy($rows['status'], 'approved'),
|
||||
'mail' => Common::strBy($rows['mail'] ?? null),
|
||||
'url' => Common::strBy($rows['url'] ?? null),
|
||||
'ip' => Common::strBy($rows['ip'] ?? null, $this->request->getIp()),
|
||||
'agent' => Common::strBy($rows['agent'] ?? null, $this->request->getAgent()),
|
||||
'text' => Common::strBy($rows['text'] ?? null),
|
||||
'type' => Common::strBy($rows['type'] ?? null, 'comment'),
|
||||
'status' => Common::strBy($rows['status'] ?? null, 'approved'),
|
||||
'parent' => empty($rows['parent']) ? 0 : $rows['parent'],
|
||||
];
|
||||
|
||||
@@ -136,11 +136,11 @@ class Comments extends Base implements QueryInterface, RowFilterInterface, Prima
|
||||
|
||||
/** 构建插入结构 */
|
||||
$preUpdateStruct = [
|
||||
'author' => Common::strBy($rows['author']),
|
||||
'mail' => Common::strBy($rows['mail']),
|
||||
'url' => Common::strBy($rows['url']),
|
||||
'text' => Common::strBy($rows['text']),
|
||||
'status' => Common::strBy($rows['status'], 'approved'),
|
||||
'author' => Common::strBy($rows['author'] ?? null),
|
||||
'mail' => Common::strBy($rows['mail'] ?? null),
|
||||
'url' => Common::strBy($rows['url'] ?? null),
|
||||
'text' => Common::strBy($rows['text'] ?? null),
|
||||
'status' => Common::strBy($rows['status'] ?? null, 'approved'),
|
||||
];
|
||||
|
||||
$updateStruct = [];
|
||||
|
||||
@@ -133,13 +133,13 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
|
||||
? null : htmlspecialchars($rows['title']),
|
||||
'created' => empty($rows['created']) ? $this->options->time : $rows['created'],
|
||||
'modified' => $this->options->time,
|
||||
'text' => Common::strBy($rows['text']),
|
||||
'text' => Common::strBy($rows['text'] ?? null),
|
||||
'order' => empty($rows['order']) ? 0 : intval($rows['order']),
|
||||
'authorId' => $rows['authorId'] ?? $this->user->uid,
|
||||
'template' => Common::strBy($rows['template']),
|
||||
'type' => Common::strBy($rows['type'], 'post'),
|
||||
'status' => Common::strBy($rows['status'], 'publish'),
|
||||
'password' => Common::strBy($rows['password']),
|
||||
'template' => Common::strBy($rows['template'] ?? null),
|
||||
'type' => Common::strBy($rows['type'] ?? null, 'post'),
|
||||
'status' => Common::strBy($rows['status'] ?? null, 'publish'),
|
||||
'password' => Common::strBy($rows['password'] ?? null),
|
||||
'commentsNum' => empty($rows['commentsNum']) ? 0 : $rows['commentsNum'],
|
||||
'allowComment' => !empty($rows['allowComment']) && 1 == $rows['allowComment'] ? 1 : 0,
|
||||
'allowPing' => !empty($rows['allowPing']) && 1 == $rows['allowPing'] ? 1 : 0,
|
||||
@@ -156,7 +156,7 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
|
||||
|
||||
/** 更新缩略名 */
|
||||
if ($insertId > 0) {
|
||||
$this->applySlug(!isset($rows['slug']) || strlen($rows['slug']) === 0 ? null : $rows['slug'], $insertId, $insertStruct['title']);
|
||||
$this->applySlug(Common::strBy($rows['slug'] ?? null), $insertId, $insertStruct['title']);
|
||||
}
|
||||
|
||||
return $insertId;
|
||||
@@ -230,11 +230,11 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
|
||||
'title' => !isset($rows['title']) || strlen($rows['title']) === 0
|
||||
? null : htmlspecialchars($rows['title']),
|
||||
'order' => empty($rows['order']) ? 0 : intval($rows['order']),
|
||||
'text' => Common::strBy($rows['text']),
|
||||
'template' => Common::strBy($rows['template']),
|
||||
'type' => Common::strBy($rows['type'], 'post'),
|
||||
'status' => Common::strBy($rows['status'], 'publish'),
|
||||
'password' => Common::strBy($rows['password']),
|
||||
'text' => Common::strBy($rows['text'] ?? null),
|
||||
'template' => Common::strBy($rows['template'] ?? null),
|
||||
'type' => Common::strBy($rows['type'] ?? null, 'post'),
|
||||
'status' => Common::strBy($rows['status'] ?? null, 'publish'),
|
||||
'password' => Common::strBy($rows['password'] ?? null),
|
||||
'allowComment' => !empty($rows['allowComment']) && 1 == $rows['allowComment'] ? 1 : 0,
|
||||
'allowPing' => !empty($rows['allowPing']) && 1 == $rows['allowPing'] ? 1 : 0,
|
||||
'allowFeed' => !empty($rows['allowFeed']) && 1 == $rows['allowFeed'] ? 1 : 0,
|
||||
|
||||
@@ -95,7 +95,7 @@ class Edit extends Contents implements ActionInterface
|
||||
|
||||
/** 取出数据 */
|
||||
$input = $this->request->from('name', 'slug', 'description');
|
||||
$input['slug'] = Common::slugName(Common::strBy($input['slug'], $input['name']));
|
||||
$input['slug'] = Common::slugName(Common::strBy($input['slug'] ?? null, $input['name']));
|
||||
|
||||
$attachment['title'] = $input['name'];
|
||||
$attachment['slug'] = $input['slug'];
|
||||
|
||||
@@ -133,7 +133,7 @@ class Edit extends Metas implements ActionInterface
|
||||
/** 取出数据 */
|
||||
$category = $this->request->from('name', 'slug', 'description', 'parent');
|
||||
|
||||
$category['slug'] = Common::slugName(Common::strBy($category['slug'], $category['name']));
|
||||
$category['slug'] = Common::slugName(Common::strBy($category['slug'] ?? null, $category['name']));
|
||||
$category['type'] = 'category';
|
||||
$category['order'] = $this->getMaxOrder('category', $category['parent']) + 1;
|
||||
|
||||
@@ -284,7 +284,7 @@ class Edit extends Metas implements ActionInterface
|
||||
/** 取出数据 */
|
||||
$category = $this->request->from('name', 'slug', 'description', 'parent');
|
||||
$category['mid'] = $this->request->get('mid');
|
||||
$category['slug'] = Common::slugName(Common::strBy($category['slug'], $category['name']));
|
||||
$category['slug'] = Common::slugName(Common::strBy($category['slug'] ?? null, $category['name']));
|
||||
$category['type'] = 'category';
|
||||
$current = $this->db->fetchRow($this->select()->where('mid = ?', $category['mid']));
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ class Edit extends Metas implements ActionInterface
|
||||
/** 取出数据 */
|
||||
$tag = $this->request->from('name', 'slug');
|
||||
$tag['type'] = 'tag';
|
||||
$tag['slug'] = Common::slugName(Common::strBy($tag['slug'], $tag['name']));
|
||||
$tag['slug'] = Common::slugName(Common::strBy($tag['slug'] ?? null, $tag['name']));
|
||||
|
||||
/** 插入数据 */
|
||||
$tag['mid'] = $this->insert($tag);
|
||||
@@ -254,7 +254,7 @@ class Edit extends Metas implements ActionInterface
|
||||
/** 取出数据 */
|
||||
$tag = $this->request->from('name', 'slug', 'mid');
|
||||
$tag['type'] = 'tag';
|
||||
$tag['slug'] = Common::slugName(Common::strBy($tag['slug'], $tag['name']));
|
||||
$tag['slug'] = Common::slugName(Common::strBy($tag['slug'] ?? null, $tag['name']));
|
||||
|
||||
/** 更新数据 */
|
||||
$this->update($tag, $this->db->sql()->where('mid = ?', $this->request->filter('int')->get('mid')));
|
||||
|
||||
@@ -449,9 +449,9 @@ class XmlRpc extends Contents implements ActionInterface, Hook
|
||||
{
|
||||
/** 开始接受数据 */
|
||||
$input['name'] = $category['name'];
|
||||
$input['slug'] = Common::slugName(Common::strBy($category['slug'], $category['name']));
|
||||
$input['slug'] = Common::slugName(Common::strBy($category['slug'] ?? null, $category['name']));
|
||||
$input['parent'] = $category['parent_id'] ?? ($category['parent'] ?? 0);
|
||||
$input['description'] = Common::strBy($category['description'], $category['name']);
|
||||
$input['description'] = Common::strBy($category['description'] ?? null, $category['name']);
|
||||
|
||||
/** 调用已有组件 */
|
||||
$categoryWidget = CategoryEdit::alloc(null, $input, function (CategoryEdit $category) {
|
||||
|
||||
Reference in New Issue
Block a user