Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix delete files on delete attachment #307

Merged
merged 1 commit into from
Apr 16, 2019
Merged

Fix delete files on delete attachment #307

merged 1 commit into from
Apr 16, 2019

Conversation

joehoyle
Copy link
Member

In WordPress 4.9.7, attachment file deleting changed again, which mangles the s3:// paths very badly. What's more, there's no hooks to be able to adjust / change this behaviour. More details in the code comment.

In WordPress 4.9.7, attachment file deleting changed again, which mangles the s3:// paths very badly. What's more, there's no hooks to be able to adjust / change this behaviour. More details in the code comment.
Copy link

@hm-linter hm-linter bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting failed (1029 errors, 81 warnings).

(1100 notices occurred in your codebase, but were on files/lines not included in this PR.)

@codecov-io
Copy link

codecov-io commented Apr 10, 2019

Codecov Report

Merging #307 into master will increase coverage by 0.65%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #307      +/-   ##
============================================
+ Coverage     48.39%   49.05%   +0.65%     
+ Complexity      248      247       -1     
============================================
  Files             5        5              
  Lines           686      685       -1     
============================================
+ Hits            332      336       +4     
+ Misses          354      349       -5
Impacted Files Coverage Δ Complexity Δ
inc/class-s3-uploads.php 79.48% <100%> (+4.06%) 43 <3> (-1) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48c3242...ad9c6f6. Read the comment docs.

Copy link
Contributor

@roborourke roborourke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a type hint on the comment. This is pretty annoying! Looks like it should have been fixed looking at this trac ticket https://core.trac.wordpress.org/ticket/39476
Looks like this is the related core changeset https://core.trac.wordpress.org/changeset/43392 shakes fist at @johnbillion

*
* @param string $file_path
* @return string
* @param $post_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param $post_id
* @param int $post_id

@johnbillion
Copy link
Member

@roborourke Yeah this was a fix for a core security issue. See https://codex.wordpress.org/Version_4.9.7.

@roborourke
Copy link
Contributor

@johnbillion ah cool, thanks for the context :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants