autovit bug fix handling brand/model
autovit bug fix handling brand/model

--- a/app/lib/AutovitFetcher.php
+++ b/app/lib/AutovitFetcher.php
@@ -35,8 +35,9 @@
 
 	protected function getBrandModel ($model)
 	{
+		$model = trim ($model);
 		foreach ($this->carBrands as $brand) {
-			if ( stristr ($model, $brand) ) {
+			if ( preg_match ("/^".$brand."/i", $model) ) {
 				return array (
 					"brand" => $brand,
 					"model" => trim ( str_replace ($brand, "", $model) ),

comments