Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

213
 
245
 
245
 
product.php
_> 1616     function osC_Product($id) {
  1717       global $osC_Database, $osC_Services;
  1818 
<> 19 -      $Qproduct = $osC_Database->query('select pd.products_name as name, pd.products_description as description, p.products_model as model, p.products_quantity as quantity, p.products_image as image, pd.products_url as url, p.products_price as price, p.products_tax_class_id as tax_class_id, p.products_date_added as date_added, p.products_date_available as date_available, p.manufacturers_id from :table_products p, :table_products_description pd where p.products_id = :products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id');
   19+      $Qproduct = $osC_Database->query('select p.products_id as id, p.products_model as model, p.products_quantity as quantity, p.products_image as image, pd.products_url as url, p.products_price as price, p.products_tax_class_id as tax_class_id, p.products_date_added as date_added, p.products_date_available as date_available, p.manufacturers_id, pd.products_name as name, pd.products_description as description from :table_products p, :table_products_description pd where');
2020       $Qproduct->bindTable(':table_products', TABLE_PRODUCTS);
  2121       $Qproduct->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
<> 22 -      $Qproduct->bindInt(':products_id', tep_get_prid($id));
   22+
   23+      if (is_numeric($id) || ereg('[0-9]+[{[0-9]+}[0-9]+]*$', $id)) {
   24+        $Qproduct->appendQuery('p.products_id = :products_id');
   25+        $Qproduct->bindInt(':products_id', tep_get_prid($id));
   26+      } else {
   27+        $Qproduct->appendQuery('p.products_model = :products_model');
   28+        $Qproduct->bindValue(':products_model', $id);
   29+      }
   30+
   31+      $Qproduct->appendQuery('and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id');
2332       $Qproduct->bindInt(':language_id', $_SESSION['languages_id']);
  2433       $Qproduct->execute();
  2534 
  2635       $this->_data = $Qproduct->toArray();
<> 27 -      $this->_data['id'] = $id;
2836 
  2937       $Qcheck = $osC_Database->query('select products_attributes_id from :table_products_attributes patrib where products_id = :products_id limit 1');
  3038       $Qcheck->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
     
 !
162170     function checkEntry($id) {
  163171       global $osC_Database;
  164172 
<> 165 -      $Qcheck = $osC_Database->query('select products_id from :table_products where products_id = :products_id and products_status = 1 limit 1');
   173+      $Qcheck = $osC_Database->query('select products_id from :table_products where');
166174       $Qcheck->bindTable(':table_products', TABLE_PRODUCTS);
<> 167 -      $Qcheck->bindInt(':products_id', tep_get_prid($id));
   175+
   176+      if (is_numeric($id) || ereg('[0-9]+[{[0-9]+}[0-9]+]*$', $id)) {
   177+        $Qcheck->appendQuery('products_id = :products_id');
   178+        $Qcheck->bindInt(':products_id', tep_get_prid($id));
   179+      } else {
   180+        $Qcheck->appendQuery('products_model = :products_model');
   181+        $Qcheck->bindValue(':products_model', $id);
   182+      }
   183+
   184+      $Qcheck->appendQuery('and products_status = 1 limit 1');
<_ 168185       $Qcheck->execute();
  169186 
  170187       if ($Qcheck->numberOfRows() === 1) {