Plugin Directory

Changeset 2729570


Ignore:
Timestamp:
05/24/2022 03:41:27 PM (4 years ago)
Author:
eggnstone
Message:

v1.0.19: Added support for 404 page.

Location:
widgets-for-amazon/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • widgets-for-amazon/trunk/README.txt

    r2729563 r2729570  
    77Requires PHP: 7.0 
    88Tested up to: 5.9 
    9 Stable tag: 1.0.18
     9Stable tag: 1.0.19
    1010License: GPLv3 or later 
    1111License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    5252== Changelog ==
    5353
    54 #### 1.0.18 - 2022-05-24
     54#### 1.0.19 - 2022-05-24
    5555
    5656- Added support for 404 page.
  • widgets-for-amazon/trunk/includes/Plugin.php

    r2729563 r2729570  
    4747        {
    4848            $query = $_SERVER['REQUEST_URI'];
     49
     50            $questionPos = strpos($query, '?');
     51            if ($questionPos && $questionPos >= 0)
     52                $query = substr($query, 0, $questionPos);
     53
    4954            if (Tools::endsWith('/', $query))
    5055                $query = substr($query, 0, strlen($query) - 1);
    5156
    5257            $slashPos = strrpos($query, '/');
    53             if ($slashPos >= 0)
     58            if ($slashPos && $slashPos >= 0)
    5459                $query = substr($query, $slashPos + 1);
    5560        }
     
    5964        }
    6065
    61         $query = str_replace('"', '', $query);
     66        $query = str_replace('"', ' ', $query);
     67        $query = str_replace('?', ' ', $query);
     68        $query = str_replace('&', ' ', $query);
    6269        $inputForScript = 'category="' . $noResultsPageCategory . '" keywords="' . $query . '"';
    6370
     
    165172
    166173        if (!$keywords)
    167             return ('// Keywords missing => Cannot create search box widget for "amazon-search-' . $index . '".' . "\n");
     174            return 'console.log("Keywords missing => Cannot create search box widget for \"amazon-search-' . $index . '\".");';
    168175
    169176        if (!$affiliateTag)
  • widgets-for-amazon/trunk/widgets-for-amazon.php

    r2729563 r2729570  
    55 * Plugin URI: https://blog.eggnstone.com/blog/widgets-for-amazon-for-wordpress
    66 * Description: Widgets for Amazon by eggnstone
    7  * Version: 1.0.18
     7 * Version: 1.0.19
    88 * Author: eggnstone
    99 * Author URI: https://eggnstone.com
Note: See TracChangeset for help on using the changeset viewer.