Modify

Opened 6 years ago

Closed 6 years ago

#1655 closed Bug/Fehler (fixed)

advanced_search_result.php - isset() && !empty()

Reported by: web-looks <info@…> Owned by: somebody
Priority: normal Milestone: modified-shop-2.0.5.0
Component: Shop Version: 2.0.4.2
Keywords: Cc:
Blocked By: Blocking:

Description

In der advanced_search_result.php werden diverse Variablen zuerst mit isset() und dann mit empty() geprüft. empty() ist hier vollkommen ausreichend, da empty() keine Warnung, sondern false ausgibt, wenn eine Variable nicht existiert.

Suchen nach:

$keywords = $_GET['keywords'] = isset($_GET['keywords']) && !empty($_GET['keywords']) ? stripslashes(trim(urldecode($_GET['keywords']))) : false;
$pfrom = $_GET['pfrom'] = isset($_GET['pfrom']) && !empty($_GET['pfrom']) ? str_replace(',', '.', stripslashes(trim(urldecode($_GET['pfrom'])))) : false;
$pto = $_GET['pto'] = isset($_GET['pto']) && !empty($_GET['pto']) ? str_replace(',', '.', stripslashes(trim(urldecode($_GET['pto'])))) : false;
$manufacturers_id  = $_GET['manufacturers_id'] = isset($_GET['manufacturers_id']) && xtc_not_null($_GET['manufacturers_id']) ? (int)$_GET['manufacturers_id'] : false;
$categories_id = $_GET['categories_id'] = isset($_GET['categories_id']) && xtc_not_null($_GET['categories_id']) ? (int)$_GET['categories_id'] : false;
$_GET['inc_subcat'] = isset($_GET['inc_subcat']) && xtc_not_null($_GET['inc_subcat']) ? (int)$_GET['inc_subcat'] : null;

Ersetzen mit:

$keywords = $_GET['keywords'] = !empty($_GET['keywords']) ? stripslashes(trim(urldecode($_GET['keywords']))) : false;
$pfrom = $_GET['pfrom'] = !empty($_GET['pfrom']) ? str_replace(',', '.', stripslashes(trim(urldecode($_GET['pfrom'])))) : false;
$pto = $_GET['pto'] = !empty($_GET['pto']) ? str_replace(',', '.', stripslashes(trim(urldecode($_GET['pto'])))) : false;
$manufacturers_id  = $_GET['manufacturers_id'] = !empty($_GET['manufacturers_id']) ? (int)$_GET['manufacturers_id'] : false;
$categories_id = $_GET['categories_id'] = !empty($_GET['categories_id']) ? (int)$_GET['categories_id'] : false;
$_GET['inc_subcat'] = !empty($_GET['inc_subcat']) ? (int)$_GET['inc_subcat'] : null;

Attachments (0)

Change History (2)

comment:1 by Torsten Riemer, 6 years ago

Milestone: modified-shop-2.0.5.0

comment:2 by Gerhard Waldemair, 6 years ago

Resolution: fixed
Status: newclosed

In 12014:

fix #1655

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.