Changeset 2981217
- Timestamp:
- 10/19/2023 01:54:11 PM (2 years ago)
- Location:
- datafeedr-comparison-sets
- Files:
-
- 8 edited
- 1 copied
-
tags/0.9.67 (copied) (copied from datafeedr-comparison-sets/trunk)
-
tags/0.9.67/datafeedr-comparison-sets.php (modified) (2 diffs)
-
tags/0.9.67/includes/actions.php (modified) (2 diffs)
-
tags/0.9.67/includes/functions.php (modified) (6 diffs)
-
tags/0.9.67/readme.txt (modified) (2 diffs)
-
trunk/datafeedr-comparison-sets.php (modified) (2 diffs)
-
trunk/includes/actions.php (modified) (2 diffs)
-
trunk/includes/functions.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
datafeedr-comparison-sets/tags/0.9.67/datafeedr-comparison-sets.php
r2901871 r2981217 10 10 Requires PHP: 7.4 11 11 Requires at least: 3.8 12 Tested up to: 6. 2.1-alpha13 Version: 0.9.6 612 Tested up to: 6.3.3-alpha 13 Version: 0.9.67 14 14 15 15 WC requires at least: 3.0 16 WC tested up to: 7. 016 WC tested up to: 7.9 17 17 18 18 Datafeedr Comparison Sets Plugin … … 43 43 * Define constants. 44 44 */ 45 define( 'DFRCS_VERSION', '0.9.6 6' );45 define( 'DFRCS_VERSION', '0.9.67' ); 46 46 define( 'DFRCS_DB_VERSION', '0.9.0' ); 47 47 define( 'DFRCS_URL', plugin_dir_url( __FILE__ ) ); -
datafeedr-comparison-sets/tags/0.9.67/includes/actions.php
r2755156 r2981217 1236 1236 1237 1237 $request = $_REQUEST; 1238 $source = $request['source']; 1239 $source = base64_decode( $source ); 1240 $source = unserialize( $source ); 1241 1238 1239 $request_source = $request['source']; 1240 $request_source = base64_decode( $request_source ); 1241 $request_source = unserialize( $request_source, [ 'allowed_classes' => false, 'max_depth' => 1 ] ); 1242 1243 // Ensure that $request_source is an array. Die if not an array. 1244 if ( ! is_array( $request_source ) ) { 1245 die(); 1246 } 1247 1248 $source = []; 1249 1250 // Sanitize data returned 1251 foreach ( $request_source as $k => $v ) { 1252 $source[ sanitize_text_field( $k ) ] = sanitize_text_field( $v ); 1253 } 1254 1255 /** 1256 * $source will look something like this: 1257 * 1258 * Array ( 1259 * [id] => 2173400008798575 1260 * [post_id] => 338 1261 * [context] => wc_single_product_page 1262 * ) 1263 */ 1242 1264 $source['display_method'] = 'ajax'; 1243 1265 … … 1263 1285 $source = $request['source']; 1264 1286 $source = base64_decode( $source ); 1265 $source = unserialize( $source ); 1287 $source = unserialize( $source, [ 'allowed_classes' => false, 'max_depth' => 1 ] ); 1288 1289 // Ensure that $source is an array. Die if not an array. 1290 if ( ! is_array( $source ) ) { 1291 die(); 1292 } 1266 1293 1267 1294 $source['display_method'] = 'ajax'; -
datafeedr-comparison-sets/tags/0.9.67/includes/functions.php
r2755156 r2981217 234 234 } 235 235 236 return apply_filters( 'dfrcs_title', str_replace( $s, $r, $compset->args['title'] ), $compset ) . $msg; 236 $title = apply_filters( 'dfrcs_title', str_replace( $s, $r, $compset->args['title'] ), $compset ); 237 238 return esc_html( $title ) . $msg; 237 239 } 238 240 … … 760 762 } 761 763 764 if ( ! dfrcs_is_valid_md5( $hash ) ) { 765 return; 766 } 767 762 768 global $wpdb; 763 769 … … 780 786 781 787 $hash = trim( $hash ); 782 if ( empty( $hash ) ) { 788 789 if ( ! dfrcs_is_valid_md5( $hash ) ) { 783 790 return false; 784 791 } … … 799 806 800 807 $hash = trim( $hash ); 801 if ( empty( $hash ) ) { 802 return false; 808 809 if ( ! dfrcs_is_valid_md5( $hash ) ) { 810 return; 803 811 } 804 812 … … 825 833 if ( empty( $hash ) ) { 826 834 _e( 'Missing comparison set hash.', DFRCS_DOMAIN ); 835 836 return; 837 } 838 839 if ( ! dfrcs_is_valid_md5( $hash ) ) { 840 _e( 'Invalid hash.', DFRCS_DOMAIN ); 827 841 828 842 return; … … 1387 1401 return (bool) dfrcs_get_option( 'use_amazon_data_in_search' ); 1388 1402 } 1403 1404 /** 1405 * Validates the validity of an MD5 hash. 1406 * 1407 * @see https://stackoverflow.com/a/14300703 1408 * 1409 * @param string $md5 1410 * 1411 * @return bool 1412 */ 1413 function dfrcs_is_valid_md5( string $md5 = '' ): bool { 1414 return boolval( preg_match( '/^[a-f0-9]{32}$/', $md5 ) ); 1415 } -
datafeedr-comparison-sets/tags/0.9.67/readme.txt
r2901871 r2981217 8 8 Requires PHP: 7.4 9 9 Requires at least: 3.8 10 Tested up to: 6. 2.1-alpha11 Stable tag: 0.9.6 610 Tested up to: 6.3.3-alpha 11 Stable tag: 0.9.67 12 12 13 13 Automatically create price comparison sets for your WooCommerce products or by using a shortcode. … … 205 205 206 206 == Changelog == 207 208 = 0.9.67 - 2023/10/19 = 209 * Verifying hashes 210 * Better handling of source data string 207 211 208 212 = 0.9.66 - 2023/04/20 = -
datafeedr-comparison-sets/trunk/datafeedr-comparison-sets.php
r2901871 r2981217 10 10 Requires PHP: 7.4 11 11 Requires at least: 3.8 12 Tested up to: 6. 2.1-alpha13 Version: 0.9.6 612 Tested up to: 6.3.3-alpha 13 Version: 0.9.67 14 14 15 15 WC requires at least: 3.0 16 WC tested up to: 7. 016 WC tested up to: 7.9 17 17 18 18 Datafeedr Comparison Sets Plugin … … 43 43 * Define constants. 44 44 */ 45 define( 'DFRCS_VERSION', '0.9.6 6' );45 define( 'DFRCS_VERSION', '0.9.67' ); 46 46 define( 'DFRCS_DB_VERSION', '0.9.0' ); 47 47 define( 'DFRCS_URL', plugin_dir_url( __FILE__ ) ); -
datafeedr-comparison-sets/trunk/includes/actions.php
r2755156 r2981217 1236 1236 1237 1237 $request = $_REQUEST; 1238 $source = $request['source']; 1239 $source = base64_decode( $source ); 1240 $source = unserialize( $source ); 1241 1238 1239 $request_source = $request['source']; 1240 $request_source = base64_decode( $request_source ); 1241 $request_source = unserialize( $request_source, [ 'allowed_classes' => false, 'max_depth' => 1 ] ); 1242 1243 // Ensure that $request_source is an array. Die if not an array. 1244 if ( ! is_array( $request_source ) ) { 1245 die(); 1246 } 1247 1248 $source = []; 1249 1250 // Sanitize data returned 1251 foreach ( $request_source as $k => $v ) { 1252 $source[ sanitize_text_field( $k ) ] = sanitize_text_field( $v ); 1253 } 1254 1255 /** 1256 * $source will look something like this: 1257 * 1258 * Array ( 1259 * [id] => 2173400008798575 1260 * [post_id] => 338 1261 * [context] => wc_single_product_page 1262 * ) 1263 */ 1242 1264 $source['display_method'] = 'ajax'; 1243 1265 … … 1263 1285 $source = $request['source']; 1264 1286 $source = base64_decode( $source ); 1265 $source = unserialize( $source ); 1287 $source = unserialize( $source, [ 'allowed_classes' => false, 'max_depth' => 1 ] ); 1288 1289 // Ensure that $source is an array. Die if not an array. 1290 if ( ! is_array( $source ) ) { 1291 die(); 1292 } 1266 1293 1267 1294 $source['display_method'] = 'ajax'; -
datafeedr-comparison-sets/trunk/includes/functions.php
r2755156 r2981217 234 234 } 235 235 236 return apply_filters( 'dfrcs_title', str_replace( $s, $r, $compset->args['title'] ), $compset ) . $msg; 236 $title = apply_filters( 'dfrcs_title', str_replace( $s, $r, $compset->args['title'] ), $compset ); 237 238 return esc_html( $title ) . $msg; 237 239 } 238 240 … … 760 762 } 761 763 764 if ( ! dfrcs_is_valid_md5( $hash ) ) { 765 return; 766 } 767 762 768 global $wpdb; 763 769 … … 780 786 781 787 $hash = trim( $hash ); 782 if ( empty( $hash ) ) { 788 789 if ( ! dfrcs_is_valid_md5( $hash ) ) { 783 790 return false; 784 791 } … … 799 806 800 807 $hash = trim( $hash ); 801 if ( empty( $hash ) ) { 802 return false; 808 809 if ( ! dfrcs_is_valid_md5( $hash ) ) { 810 return; 803 811 } 804 812 … … 825 833 if ( empty( $hash ) ) { 826 834 _e( 'Missing comparison set hash.', DFRCS_DOMAIN ); 835 836 return; 837 } 838 839 if ( ! dfrcs_is_valid_md5( $hash ) ) { 840 _e( 'Invalid hash.', DFRCS_DOMAIN ); 827 841 828 842 return; … … 1387 1401 return (bool) dfrcs_get_option( 'use_amazon_data_in_search' ); 1388 1402 } 1403 1404 /** 1405 * Validates the validity of an MD5 hash. 1406 * 1407 * @see https://stackoverflow.com/a/14300703 1408 * 1409 * @param string $md5 1410 * 1411 * @return bool 1412 */ 1413 function dfrcs_is_valid_md5( string $md5 = '' ): bool { 1414 return boolval( preg_match( '/^[a-f0-9]{32}$/', $md5 ) ); 1415 } -
datafeedr-comparison-sets/trunk/readme.txt
r2901871 r2981217 8 8 Requires PHP: 7.4 9 9 Requires at least: 3.8 10 Tested up to: 6. 2.1-alpha11 Stable tag: 0.9.6 610 Tested up to: 6.3.3-alpha 11 Stable tag: 0.9.67 12 12 13 13 Automatically create price comparison sets for your WooCommerce products or by using a shortcode. … … 205 205 206 206 == Changelog == 207 208 = 0.9.67 - 2023/10/19 = 209 * Verifying hashes 210 * Better handling of source data string 207 211 208 212 = 0.9.66 - 2023/04/20 =
Note: See TracChangeset
for help on using the changeset viewer.