Merged
Conversation
Fix deprecated zip functions and undefined variable warnings in problem import Details: - Replace deprecated `zip_open()`, `zip_read()`, `zip_entry_*` functions with `ZipArchive` class in `problem_import_syzoj.php` and `problem_import_hoj.php`. - Fix "Undefined variable $spjlang" warning in `problem_import_xml.php` by adding `isset()` check. - Remove usage of undefined `$path` variable in import scripts.
Fix: Resolve PHP 8 deprecations, undefined warnings, and import logic bugs 1. Fix Problem Import Logic (problem_import_xml.php): - Fix "Undefined variable $spjlang" warning. - Fix bug where empty `remote_oj` tags in XML caused existing problems to be overwritten instead of creating new ones. - Add `unset($spjlang)` and `unset($tpjlang)` in batch import loop to prevent SPJ attributes from leaking to subsequent problems. - Replace deprecated `zip_open`/`zip_read` functions with `ZipArchive` class. 2. Fix Zip Import Handlers (problem_import_syzoj.php, problem_import_hoj.php): - Replace deprecated `zip_*` functions with `ZipArchive` for PHP 8 compatibility. - Remove redundant double-loop processing in HOJ import. - Add directory existence checks. 3. Fix Admin Warnings (problem_df_change.php, contest_add.php, news_add_page.php): - Add `isset($_POST['hlist'])` checks to resolve "Undefined array key" and "trim(): Passing null" warnings.
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.
消除导入的警告,以及修复导入批量会把前一题替换的逻辑