Opened 2 years ago

Closed 2 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

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 Changed 2 years ago by Tomcraft

  • Milestone set to modified-shop-2.0.5.0

comment:2 Changed 2 years ago by GTB

  • Resolution set to fixed
  • Status changed from new to closed

In 12014:

fix #1655

Add Comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.