Modify ↓
Opened 6 years ago
Closed 6 years ago
#1655 closed Bug/Fehler (fixed)
advanced_search_result.php - isset() && !empty()
| Reported by: | 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 , 6 years ago
| Milestone: | → modified-shop-2.0.5.0 |
|---|
comment:2 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

In 12014: