Detect shortcodes when saving URLs.

Fixes #7474
This commit is contained in:
Mike Jolley 2015-02-19 11:05:04 +00:00
parent b75034ae38
commit 82ac0fc11e
2 changed files with 9 additions and 5 deletions

View File

@ -1223,15 +1223,18 @@ class WC_Meta_Box_Product_Data {
$files = array();
if ( isset( $_POST['_wc_file_urls'] ) ) {
$file_names = isset( $_POST['_wc_file_names'] ) ? array_map( 'wc_clean', $_POST['_wc_file_names'] ) : array();
$file_urls = isset( $_POST['_wc_file_urls'] ) ? array_map( 'esc_url_raw', $_POST['_wc_file_urls'] ) : array();
$file_names = isset( $_POST['_wc_file_names'] ) ? $_POST['_wc_file_names'] : array();
$file_urls = isset( $_POST['_wc_file_urls'] ) ? array_map( 'trim', $_POST['_wc_file_urls'] ) : array();
$file_url_size = sizeof( $file_urls );
for ( $i = 0; $i < $file_url_size; $i ++ ) {
if ( ! empty( $file_urls[ $i ] ) ) {
$files[ md5( $file_urls[ $i ] ) ] = array(
'name' => $file_names[ $i ],
'file' => $file_urls[ $i ]
$file_url = 0 === strpos( $file_urls[ $i ], '[' ) ? wc_clean( $file_urls[ $i ] ) : esc_url_raw( $file_urls[ $i ] );
$file_name = wc_clean( $file_names[ $i ] );
$file_hash = md5( $file_url );
$files[ $file_hash ] = array(
'name' => $file_name,
'file' => $file_url
);
}
}

View File

@ -138,6 +138,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
== Changelog ==
* Fix - Detect shortcodes when saving URLs.
* Fix - Unhook wc_page_endpoint_title after it is ran once (main page title).
* Fix - Taxes save issue when page is paginated.
* Tweak - Improve category coupon message.