fix: restore missing str_replace subject arg in MokoRestore standalone gen (#226) #228
Reference in New Issue
Block a user
Delete Branch "fix/mokorestore-str-replace-args"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Every standalone-mode backup fatally errored at the "Generating standalone restore.php…" step:
generateStandaloneScript()rewrites the standalone script's "Backup Archive" pre-check with astr_replace(ORIG_heredoc, REPL_heredoc)— but the call was missing its third$phpsubject argument. Since PHP 8 that is a fatalArgumentCountErrorat runtime (aphp -lsyntax check cannot catch it).The archive still finalized and uploaded, but no
restore.phpwas ever produced — the real root cause behind #226 (restore script missing on the remote).Fix
Add the missing
$phpsubject to thestr_replace()atMokoRestore.php:181. Audited all sevenstr_replacecalls in the file — this was the only short one.Verify
php -lclean.str_replacecalls confirmed to carry their subject arg.Refs #226
https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i