Changeset 3652921
- Timestamp:
- 08/18/2026 01:08:29 PM (2 months ago)
- Location:
- ajax-search-for-woocommerce/trunk
- Files:
-
- 8 edited
-
ajax-search-for-woocommerce.php (modified) (2 diffs)
-
includes/Engines/WordPressNative/DetailsBox.php (modified) (1 diff)
-
includes/Engines/WordPressNative/Search.php (modified) (10 diffs)
-
includes/Helpers.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (2 diffs)
-
vendor/composer/autoload_static.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ajax-search-for-woocommerce/trunk/ajax-search-for-woocommerce.php
r3632527 r3652921 5 5 * Plugin URI: https://fibosearch.com?utm_source=wp-admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc 6 6 * Description: The most popular WooCommerce product search. Gives your users a well-designed advanced AJAX search bar with live search suggestions. 7 * Version: 1.34. 07 * Version: 1.34.1 8 8 * Author: FiboSearch Team 9 9 * Author URI: https://fibosearch.com?utm_source=wp-admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc … … 12 12 * Requires Plugins: woocommerce 13 13 * WC requires at least: 5.5 14 * WC tested up to: 1 0.914 * WC tested up to: 11.0 15 15 * 16 16 */ -
ajax-search-for-woocommerce/trunk/includes/Engines/WordPressNative/DetailsBox.php
r3516415 r3652921 199 199 ob_start(); 200 200 $queryArgs = $this->getProductsQueryArgs( $termID, $taxonomy ); 201 add_filter( 202 'posts_where', 203 ['DgoraWcas\\Helpers', 'excludePasswordProtectedProducts'], 204 90, 205 2 206 ); 201 207 $products = new \WP_Query($queryArgs); 208 remove_filter( 'posts_where', ['DgoraWcas\\Helpers', 'excludePasswordProtectedProducts'], 90 ); 202 209 if ( $products->have_posts() ) { 203 210 $limit = $queryArgs['posts_per_page']; -
ajax-search-for-woocommerce/trunk/includes/Engines/WordPressNative/Search.php
r3632527 r3652921 191 191 return $this->getEmptyOutput(); 192 192 } else { 193 echo json_encode( Helpers::noResultsSuggestion( $this->getEmptyOutput() ) ); 194 die; 193 wp_send_json( Helpers::noResultsSuggestion( $this->getEmptyOutput() ) ); 194 } 195 } 196 // Break early if keyword is empty - an empty phrase must not return the whole catalog. 197 if ( $keyword === '' ) { 198 if ( $return ) { 199 return $this->getEmptyOutput(); 200 } else { 201 wp_send_json( Helpers::noResultsSuggestion( $this->getEmptyOutput() ) ); 195 202 } 196 203 } … … 228 235 } 229 236 $args = apply_filters( 'dgwt/wcas/search_query/args', $args ); 237 add_filter( 238 'posts_where', 239 ['DgoraWcas\\Helpers', 'excludePasswordProtectedProducts'], 240 90, 241 2 242 ); 230 243 $products = get_posts( $args ); 244 remove_filter( 'posts_where', ['DgoraWcas\\Helpers', 'excludePasswordProtectedProducts'], 90 ); 231 245 $products = apply_filters( 'dgwt/wcas/search_results/products_raw', $products ); 232 246 $totalProducts = count( $products ); … … 273 287 return $result; 274 288 } else { 275 echo json_encode( $result ); 276 die; 289 wp_send_json( $result ); 277 290 } 278 291 } … … 291 304 return $result; 292 305 } else { 293 echo json_encode( $result ); 294 die; 306 wp_send_json( $result ); 295 307 } 296 308 } … … 344 356 return $result; 345 357 } else { 346 echo json_encode( $result ); 347 die; 358 wp_send_json( $result ); 348 359 } 349 360 } … … 373 384 return $result; 374 385 } else { 375 echo json_encode( $result ); 376 die; 386 wp_send_json( $result ); 377 387 } 378 388 } … … 527 537 'taxonomy' => 'product_cat', 528 538 ]; 539 $keywordUnslashed = wp_unslash( $keyword ); 540 if ( $keywordUnslashed === '' ) { 541 return $results; 542 } 529 543 $productCategories = get_terms( 'product_cat', apply_filters( 'dgwt/wcas/search/product_cat/args', $args ) ); 530 $keywordUnslashed = wp_unslash( $keyword );531 544 // Compare keyword and term name 532 545 $i = 0; … … 566 579 * Extend research in the Woo tags 567 580 * 568 * @param str ong $keyword581 * @param string $keyword 569 582 * @param int $limit 570 583 * … … 579 592 'taxonomy' => 'product_tag', 580 593 ]; 594 $keywordUnslashed = wp_unslash( $keyword ); 595 if ( $keywordUnslashed === '' ) { 596 return $results; 597 } 581 598 $productTags = get_terms( 'product_tag', apply_filters( 'dgwt/wcas/search/product_tag/args', $args ) ); 582 $keywordUnslashed = wp_unslash( $keyword );583 599 // Compare keyword and term name 584 600 $i = 0; … … 661 677 if ( !empty( $search ) ) { 662 678 $search = " AND ({$search}) "; 663 // Password-protected products are never searchable, regardless of the login state.664 $search .= " AND ({$wpdb->posts}.post_password = '') ";665 679 } 666 680 } -
ajax-search-for-woocommerce/trunk/includes/Helpers.php
r3419868 r3652921 1406 1406 } 1407 1407 return ''; 1408 } 1409 1410 /** 1411 * Exclude password-protected products from a query. 1412 * 1413 * Meant to be hooked tightly around a single get_posts()/WP_Query call and 1414 * unhooked immediately after, so it never leaks into unrelated queries. The 1415 * post_type === 'product' guard is defense-in-depth in case the caller's 1416 * remove_filter() somehow doesn't run. 1417 * 1418 * @param string $where SQL WHERE clause. 1419 * @param \WP_Query $query The WP_Query instance (passed by reference). 1420 * 1421 * @return string 1422 */ 1423 public static function excludePasswordProtectedProducts( $where, $query ) { 1424 global $wpdb; 1425 if ( empty( $query->query_vars['post_type'] ) || $query->query_vars['post_type'] !== 'product' ) { 1426 return $where; 1427 } 1428 $where .= " AND ({$wpdb->posts}.post_password = '') "; 1429 return $where; 1408 1430 } 1409 1431 -
ajax-search-for-woocommerce/trunk/readme.txt
r3632527 r3652921 3 3 Tags: woocommerce search, ajax search, search by sku, product search, woocommerce 4 4 Requires at least: 6.5 5 Tested up to: 7. 05 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.34. 07 Stable tag: 1.34.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 148 148 149 149 == Changelog == 150 151 = 1.34.1, August 18, 2026 = 152 * SECURITY: A search request with an empty query could reveal password-protected products to unauthenticated users. Thanks to Duy Tran for the responsible disclosure. 153 * UPDATED: The `.pot` file 150 154 151 155 = 1.34.0, August 3, 2026 = … … 325 329 * UPDATED: Freemius SDK 326 330 327 = 1.26.1, October 19, 2023 =328 * FIXED: Details Panel: wrong HTML format of the stock status element329 330 331 [See changelog for all versions](https://fibosearch.com/changelog/). -
ajax-search-for-woocommerce/trunk/vendor/autoload.php
r3632527 r3652921 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit c3736af2ab144591bbc7587e60ab1765::getLoader();25 return ComposerAutoloaderInita9a788dab01b4dc03d7408a803691670::getLoader(); -
ajax-search-for-woocommerce/trunk/vendor/composer/autoload_real.php
r3632527 r3652921 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit c3736af2ab144591bbc7587e60ab17655 class ComposerAutoloaderInita9a788dab01b4dc03d7408a803691670 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInit c3736af2ab144591bbc7587e60ab1765', 'loadClassLoader'), true, true);25 spl_autoload_register(array('ComposerAutoloaderInita9a788dab01b4dc03d7408a803691670', 'loadClassLoader'), true, true); 26 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 27 spl_autoload_unregister(array('ComposerAutoloaderInit c3736af2ab144591bbc7587e60ab1765', 'loadClassLoader'));27 spl_autoload_unregister(array('ComposerAutoloaderInita9a788dab01b4dc03d7408a803691670', 'loadClassLoader')); 28 28 29 29 require __DIR__ . '/autoload_static.php'; 30 call_user_func(\Composer\Autoload\ComposerStaticInit c3736af2ab144591bbc7587e60ab1765::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInita9a788dab01b4dc03d7408a803691670::getInitializer($loader)); 31 31 32 32 $loader->register(true); 33 33 34 $filesToLoad = \Composer\Autoload\ComposerStaticInit c3736af2ab144591bbc7587e60ab1765::$files;34 $filesToLoad = \Composer\Autoload\ComposerStaticInita9a788dab01b4dc03d7408a803691670::$files; 35 35 $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { 36 36 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { -
ajax-search-for-woocommerce/trunk/vendor/composer/autoload_static.php
r3632527 r3652921 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit c3736af2ab144591bbc7587e60ab17657 class ComposerStaticInita9a788dab01b4dc03d7408a803691670 8 8 { 9 9 public static $files = array ( … … 31 31 { 32 32 return \Closure::bind(function () use ($loader) { 33 $loader->prefixLengthsPsr4 = ComposerStaticInit c3736af2ab144591bbc7587e60ab1765::$prefixLengthsPsr4;34 $loader->prefixDirsPsr4 = ComposerStaticInit c3736af2ab144591bbc7587e60ab1765::$prefixDirsPsr4;35 $loader->classMap = ComposerStaticInit c3736af2ab144591bbc7587e60ab1765::$classMap;33 $loader->prefixLengthsPsr4 = ComposerStaticInita9a788dab01b4dc03d7408a803691670::$prefixLengthsPsr4; 34 $loader->prefixDirsPsr4 = ComposerStaticInita9a788dab01b4dc03d7408a803691670::$prefixDirsPsr4; 35 $loader->classMap = ComposerStaticInita9a788dab01b4dc03d7408a803691670::$classMap; 36 36 37 37 }, null, ClassLoader::class);
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)