woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.22k stars 10.74k forks source link

wp-content hardcoded instead of using WP_CONTENT_DIR #30898

Open kkmuffme opened 2 years ago

kkmuffme commented 2 years ago

/includes/class-wc-download-handler.php

is using hardcoded wp-content, which is wrong (and gives incorrect results when WP_CONTENT_DIR is not wp-content)

} elseif ( '/wp-content' === substr( $file_path, 0, 11 ) ) {

should be:
} elseif ( '/' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) === substr( $file_path, 0, strlen( str_replace( ABSPATH, '', WP_CONTENT_DIR ) ) + 1 ) ) {
juliaamosova commented 2 years ago

Hi @kkmuffme,

Thank you for opening the issue! It requires further feedback from the WooCommerce Core team. I am adding the needs developer feedback label to this issue so that the Core team could take a look.

Please note it may take a few days for them to get to this issue. Thank you for your patience.

kkmuffme commented 2 years ago

@juliaamosova could anybody please merge this?

barryhughes commented 2 years ago

Removing dev feedback flag (seems reasonable to avoid hardcoding wp-content and it looks like Jorge is assigned to the PR).

barryhughes commented 4 months ago

This is still valid, but reducing the priority as it seems not to be generating too many problems in practice.