:octocat: move version clamp to options

This commit is contained in:
codemasher
2018-11-06 14:03:05 +01:00
parent 736d05dd5b
commit c19b2e2184
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ abstract class QRDataAbstract implements QRDataInterface{
$maxlength = 0;
// guess the version number within the given range
foreach(range(max(1, $this->options->versionMin), min($this->options->versionMax, 40)) as $version){
foreach(range($this->options->versionMin, $this->options->versionMax) as $version){
$maxlength = $this::MAX_LENGTH[$version][QRCode::DATA_MODES[$this->datamode]][QRCode::ECC_MODES[$this->options->eccLevel]];
if($this->strlen <= $maxlength){