woocommerce/woocommerce

wp-content hardcoded instead of using WP_CONTENT_DIR

Closed

#30898 opened on Oct 7, 2021

View on GitHub
 (5 comments) (2 reactions) (1 assignee)PHP (10,294 stars) (10,695 forks)batch import
BugGood First IssueOrder ManagementRubikplugin: woocommerce

Description

/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 ) ) {

Contributor guide