SMF Development > Fixed or Bogus Bugs

2.0 RC5 Function matchPackageVersion(): only allows one interval

<< < (6/7) > >>

Joshua Dickerson:
In the way that it is being used... yes. Commas are used to delimit the version number, not spaces. Otherwise, they are completely different.

Why make a simple typo break an entire mod? Especially one that would be so hard to find and fix. Then we'd have to document that. It doesn't make sense when removing space characters makes so much more sense.

Arantor:
That has consequences too.

OK, so let's say you strip spaces entirely. This means now that 2.0RC5 > 2.0.1 in version terms. I also bet there are issues with 2.0.9 being greater than 2.0.11 as well if you go down that road.

Joshua Dickerson:

--- Code: ---<?php
if (version_compare('2.0RC5', '2.0.1', '>'))
echo 'arantor is right';
else
echo 'groundup is right';
// returns 'groundup is right'
?>
--- End code ---

Arantor:
Oh, so you're actually going to move everything to use version_compare instead of using the custom function as was suggested how many moons ago?

That also assumes that version numbers stick to the method used by version_compare...

davidhs:

--- Quote from: Arantor on February 12, 2011, 06:52:40 PM ---I also bet there are issues with 2.0.9 being greater than 2.0.11
--- End quote ---
With matchPackageVersion() of SMF 1.1.11 and lower was 2.0.9 > 2.0.11 because compared strings.
In SMF 1.1.12 was fixed and now compare each number (2 = 2 AND 0 = 0 AND 9 < 11 => 2.0.9 < 2.0.11


I also think that is better to use the PHP function version_compare and so everything is fixed.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version