﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking
1900	Undefined variable: author in File: product_reviews_write.php on Line: 158	Timo Paul	somebody	"Kompletter Eintrag in der mod_notice_*.log:

{{{
[2020-09-28 05:10:04]	[notice]	[modified]	[pid:96812]	Undefined variable: author in File: /var/www/shop-root/product_reviews_write.php on Line: 158	{}	{}
}}}

Die Variable $author ist nicht vordefiniert und bleibt somit undefiniert wenn Gäste ein Produkt bewerten möchten.

Betroffene Zeilen: 133 - 144

{{{
  if (!isset($author)) {
    if(isset($_SESSION['customer_id'])) {
      $customer_info_query = xtc_db_query(""SELECT customers_firstname,
                                                  customers_lastname
                                             FROM "".TABLE_CUSTOMERS.""
                                            WHERE customers_id = '"".(int) $_SESSION['customer_id'].""'"");
      if (xtc_db_num_rows($customer_info_query) > 0) {
        $customer_info = xtc_db_fetch_array($customer_info_query);
        $author = $customer_info['customers_firstname'].' '.$customer_info['customers_lastname'][0].'.';
      }
    }
  }

}}}

Lösung in Zeile 134 die Variable vordefinieren:

{{{
  if (!isset($author)) {
    $author = '';
    if(isset($_SESSION['customer_id'])) {
      $customer_info_query = xtc_db_query(""SELECT customers_firstname,
                                                  customers_lastname
                                             FROM "".TABLE_CUSTOMERS.""
                                            WHERE customers_id = '"".(int) $_SESSION['customer_id'].""'"");
      if (xtc_db_num_rows($customer_info_query) > 0) {
        $customer_info = xtc_db_fetch_array($customer_info_query);
        $author = $customer_info['customers_firstname'].' '.$customer_info['customers_lastname'][0].'.';
      }
    }
  }

}}}"	Bug/Fehler	closed	normal	modified-shop-2.0.6.0	Shop	2.0.5.1	fixed				
