VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Virtuemart 1.1 Development (Archiv) => Quality & Testing VirtueMart 1.1.x => Topic started by: doorknob on August 12, 2008, 15:45:32 PM

Title: Bug: ps_product_type.php
Post by: doorknob on August 12, 2008, 15:45:32 PM
When the 'search according to parameters' is run, the hidden fields used to hold the search parameter values also use the same text value as the field id. This causes two problems

1. The ID may contain illegal characters such as spaces (see fix below)
2. More than one parameter may contain the same text value, causing illegal duplicated IDs (no fix proposed here)

To fix the illegal ID value issue, I made the following chamge to line 460:
$html .= "<input type=\"hidden\" id=\"$value\" name=\"".$item_name."[]\"  value=\"".$value."\" />\n";

changed to:
$id = preg_replace( "/[\-]+/", "_", preg_replace( "/[^a-z0-9]/", "_", strtolower( $value )));
$html .= "<input type=\"hidden\" id=\"$id\" name=\"".$item_name."[]\"  value=\"".$value."\" />\n";


This fixes the syntax problem but I'm not sure what other implication there might be.
Regards
Phil
(J1.5.3 vm 1.1.2 (nightly 8th Aug)