mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-31 12:38:22 +00:00
:octocat: ECI: throw on invalid encoding ID
This commit is contained in:
@@ -65,6 +65,7 @@ final class ECI extends QRDataModeAbstract{
|
||||
* Writes an ECI designator to the bitbuffer
|
||||
*
|
||||
* @inheritDoc
|
||||
* @throws \chillerlan\QRCode\Data\QRCodeDataException
|
||||
*/
|
||||
public function write(BitBuffer $bitBuffer, int $versionNumber):QRDataModeInterface{
|
||||
$bitBuffer->put(self::DATAMODE, 4);
|
||||
@@ -78,6 +79,9 @@ final class ECI extends QRDataModeAbstract{
|
||||
elseif($this->encoding < 1000000){
|
||||
$bitBuffer->put(($this->encoding | 0xC00000), 24);
|
||||
}
|
||||
else{
|
||||
throw new QRCodeDataException('invalid ECI ID');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user