VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: mb000000 on August 02, 2013, 18:07:28 PM

Title: [SOLVED] Possible bug in router.php - or is it a stylistic issue?
Post by: mb000000 on August 02, 2013, 18:07:28 PM
J2.5.14 (at last) and VM2.0.22a

Whilst investigating an entirely different problem in a payments plugin I have written, I noticed that VM's router.php contains on line 466:
if ($segments[0] = 'number')
Perhaps it's just me but I nearly always think this style of code (a conditional test that also does assignment) is hard to read *and*, more often than not, is a simple typoe when the = should have been ==

So, I ask - should this really be ==?

Mark
[Edit - marked as solved]
Title: Re: Possible bug in router.php - or is it a stylistic issue?
Post by: alatak on August 02, 2013, 19:36:10 PM
Hello
yes you are rigth,
and it should even be this code
$helper->compareKey($segments[0],'number')