regression in 4.0.0 on windows
-
When replacing a PNG image (with either
Just replace the file
orReplace the file, use the new file name, and update all links
) on Windows, the_wp_attached_file
postmeta ends up with the fill path the file rather than a path relative to the uploads folder. Thefile
entry in the_wp_attachment_metadata
postmeta also has the full path.I’ve confirmed that if I rollback to version 3.6.3 everything works fine (hurray for wp-cli for making that rollback easy :-).
I’m not 100% sure, but I think the problem is in the new
FileModel::processPath()
method.That new method calls
wp_normalize_path()
, which among other things replaces windows “backslashes” in file paths to forward slashes. And that causes a problem with__wp_relative_upload_path()
, because thebasedir
entry in the array returned bywp_get_upload_dir()
on windows has backslashes, so__wp_relative_upload_path()
doesn’t strip thebasedir
.OS: Win11 Pro for Workstations (21H2, 22000.918)
PHP: 7.4.29
WP: 6.0.2
Apache: 2.4.53
MySQL: 5.7.38Let me know if you need any other info to help replicate the problem.
- The topic ‘regression in 4.0.0 on windows’ is closed to new replies.