Skip to content

[ページ管理]固定リンクを空で登録するとシステムエラーとなる問題を修正しました #2184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025

Conversation

gakigaki
Copy link
Contributor

@gakigaki gakigaki commented Apr 30, 2025

概要

ページ管理機能において、ページ登録または更新時に固定リンクを空のまま保存しようとするとシステムエラーが発生する問題を修正しました。

変更の目的

固定リンクが未入力の状態で保存操作が行われた際に、予期せぬシステムエラー(strncmp() 関数の型エラー)が発生するのを防ぎ、アプリケーションの安定性を向上させます。

変更内容

app/Plugins/Manage/PageManage/PageManage.php の 224 行目付近にある strncmp() 関数において、第一引数 $request->permanent_linknull となる可能性がありました。

null 合体演算子 (??) を使用し、$request->permanent_linknull の場合に空文字列 ('') を strncmp() 関数に渡すよう修正しました。

// 修正前
// if (strncmp($request->permanent_link, '/', 1) !== 0) {

// 修正後
if (strncmp($request->permanent_link ?? '', '/', 1) !== 0) {

レビュー完了希望日

関連Pull requests/Issues

#2183

参考

DB変更の有無

無し

チェックリスト

@gakigaki gakigaki marked this pull request as ready for review April 30, 2025 08:29
@gakigaki gakigaki merged commit 8a153ef into master Apr 30, 2025
1 check passed
@gakigaki gakigaki deleted the fix-page-permalink branch April 30, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant