Skip to content

Commit

Permalink
Merge pull request #292 from Nosto/feature/escape-all-product-tagging
Browse files Browse the repository at this point in the history
Feature - Bump SDK to auto escape all product tagging
  • Loading branch information
supercid authored Apr 8, 2019
2 parents e0c6b10 + b5041e4 commit afbba6f
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 49 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning(http://semver.org/).

## 3.7.0
- Encode HTML characters automatically

## 3.6.3
- Fix order import sorting

Expand Down
15 changes: 8 additions & 7 deletions classes/blocks/NostoSearchTagging.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

use Nosto\Object\SearchTerm;

class NostoSearchTagging
{
/**
Expand All @@ -32,14 +34,13 @@ class NostoSearchTagging
*/
public static function get()
{
$searchTerm = Tools::getValue('search_query', Tools::getValue('s'));
//$searchTerm could be boolean value false. Don't use is_null() here to verify the value
if (!is_string($searchTerm) || $searchTerm == '') {
$searchQuery = Tools::getValue('search_query', Tools::getValue('s'));
// $searchQuery could be boolean value false. Don't use is_null() here to verify the value
if (!is_string($searchQuery) || $searchQuery === '') {
return null;
}

$nostoQuery = NostoSearch::loadData(Tools::htmlentitiesUTF8($searchTerm));

return $nostoQuery ? $nostoQuery->toHtml() : null;
$searchTerm = new SearchTerm($searchQuery);
$searchTerm->disableAutoEncodeAll();
return $searchTerm->toHtml();
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nosto/nostotagging",
"description": "Nosto Module for Prestashop",
"require": {
"nosto/php-sdk": "3.9.2"
"nosto/php-sdk": "3.12.1"
},
"require-dev": {
"phing/phing": "2.*",
Expand Down
80 changes: 40 additions & 40 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nostotagging.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class NostoTagging extends Module
*
* @var string
*/
const PLUGIN_VERSION = '3.6.3';
const PLUGIN_VERSION = '3.7.0';

/**
* Internal name of the Nosto plug-in
Expand Down

0 comments on commit afbba6f

Please sign in to comment.