Merged
Conversation
修复题目编辑 (problem_edit.php):
- 优雅处理写测试样例文件 (sample.in/sample.out) 时的权限错误。
- 在 `fopen` 调用前添加 `@` 抑制符并增加 `if($fp)` 检查,防止因 Web 服务器缺少数据目录写入权限而导致页面致命错误。
- 修复 `htmlentities()` 中 "Passing null to parameter #1" 的废弃警告。
- 在将 `remote_oj` 和 `remote_id` 传递给 `htmlentities` 之前,强制转换为 `(string)` 类型,确保不传入 null 值。
- 恢复数据库更新功能(移除了临时的调试打印代码)。
修复题目导出 (problem_export_xml.php): - 修复 `str_replace()` 中 "Passing null to parameter zhblue#3" 的废弃警告。 - 在 `fixcdata()` 函数中增加空值检查,如果内容为 null 则直接返回空字符串。 - 此修复防止了 XML 导出文件损坏,避免了 PHP 警告信息被错误地注入到 `remote_oj`/`remote_id` 标签中。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复:处理题目编辑与导出中的空值及权限问题
修复题目编辑 (problem_edit.php):
修复题目导出 (problem_export_xml.php):