Opened 6 years ago
Last modified 4 years ago
#46637 new defect (bug)
Corrupted functions.php file after editing in built-in theme editor
Reported by: | SergeyBiryukov | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.6.1 |
Component: | Themes | Keywords: | |
Focuses: | Cc: |
Description
Got at least two reports of the following scenario.
When editing the functions.php
file of a theme, WordPress says: "Unable to communicate back with site to check for fatal errors, so the PHP change was reverted." However, the reverted file has 0 bytes length, and has to be recovered from a backup copy.
From what I can see, this can only happen in two cases:
- file_get_contents() could not properly read the file contents.
- The file is writable and fwrite() succeeded, but file_put_contents() did not.
Don't have any more details at this point, created the ticket as a reference for investigation.
Note: See
TracTickets for help on using
tickets.
I am also facing this exact same issue. Lost the entire functions.php file due to this.