File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- 2.4.25
1+ 2.4.26
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ protected function setBars(): void
9191 for ($ chr = 0 ; $ chr < $ clen ; ++$ chr ) {
9292 $ char = $ this ->extcode [$ chr ];
9393 if (! isset ($ this ::CHBAR [$ char ])) {
94- throw new BarcodeException ('Invalid character: \chr( ' . \ord ($ char ) . ') ' );
94+ throw new BarcodeException ('Invalid character: \chr( ' . ( \ord ($ char) & 0xFF ) . ') ' );
9595 }
9696
9797 for ($ pos = 0 ; $ pos < 8 ; ++$ pos ) {
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ protected function setBars(): void
136136 for ($ chr = 0 ; $ chr < $ clen ; ++$ chr ) {
137137 $ char = $ this ->extcode [$ chr ];
138138 if (! isset ($ this ::CHBAR [$ char ])) {
139- throw new BarcodeException ('Invalid character: \chr( ' . \ord ($ char ) . ') ' );
139+ throw new BarcodeException ('Invalid character: \chr( ' . ( \ord ($ char) & 0xFF ) . ') ' );
140140 }
141141
142142 for ($ pos = 0 ; $ pos < 6 ; ++$ pos ) {
Original file line number Diff line number Diff line change @@ -294,7 +294,7 @@ protected function getExtendCode(string $code): string
294294 for ($ chr = 0 ; $ chr < $ clen ; ++$ chr ) {
295295 $ item = \ord ($ code [$ chr ]);
296296 if ($ item > 127 ) {
297- throw new BarcodeException ('Invalid character: \chr( ' . $ item . ') ' );
297+ throw new BarcodeException ('Invalid character: \chr( ' . ( $ item & 0xFF ) . ') ' );
298298 }
299299
300300 $ ext .= $ this ::EXTCODES [$ item ];
@@ -347,7 +347,7 @@ protected function setBars(): void
347347 for ($ chr = 0 ; $ chr < $ clen ; ++$ chr ) {
348348 $ char = $ this ->extcode [$ chr ];
349349 if (! isset ($ this ::CHBAR [$ char ])) {
350- throw new BarcodeException ('Invalid character: \chr( ' . \ord ($ char ) . ') ' );
350+ throw new BarcodeException ('Invalid character: \chr( ' . ( \ord ($ char) & 0xFF ) . ') ' );
351351 }
352352
353353 for ($ pos = 0 ; $ pos < 9 ; ++$ pos ) {
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ protected function setBars(): void
119119 for ($ pos = 0 ; $ pos < $ clen ; ++$ pos ) {
120120 $ digit = $ this ->extcode [$ pos ];
121121 if (! isset ($ this ::CHBAR [$ digit ])) {
122- throw new BarcodeException ('Invalid character: \chr( ' . \ord ($ digit ) . ') ' );
122+ throw new BarcodeException ('Invalid character: \chr( ' . ( \ord ($ digit) & 0xFF ) . ') ' );
123123 }
124124
125125 $ seq .= $ this ::CHBAR [$ digit ];
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ protected function setBars(): void
112112 for ($ chr = 0 ; $ chr < $ clen ; ++$ chr ) {
113113 $ char = $ this ->extcode [$ chr ];
114114 if (! isset ($ this ::CHBAR [$ char ])) {
115- throw new BarcodeException ('Invalid character: \chr( ' . \ord ($ char ) . ') ' );
115+ throw new BarcodeException ('Invalid character: \chr( ' . ( \ord ($ char) & 0xFF ) . ') ' );
116116 }
117117
118118 for ($ pos = 0 ; $ pos < 5 ; ++$ pos ) {
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ protected function getChecksum(string $code): int
146146 for ($ pos = 0 ; $ pos < $ len ; ++$ pos ) {
147147 $ char = $ code [$ pos ];
148148 if (! isset ($ this ::CHKSUM [$ char ])) {
149- throw new BarcodeException ('Invalid character: \chr( ' . \ord ($ char ) . ') ' );
149+ throw new BarcodeException ('Invalid character: \chr( ' . ( \ord ($ char) & 0xFF ) . ') ' );
150150 }
151151
152152 $ row += (int ) $ this ::CHKSUM [$ char ][0 ];
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ protected function setBars(): void
113113 for ($ idx = 0 ; $ idx < $ clen ; ++$ idx ) {
114114 $ digit = $ this ->extcode [$ idx ];
115115 if (! isset ($ this ::CHBAR [$ digit ])) {
116- throw new BarcodeException ('Invalid character: \chr( ' . \ord ($ digit ) . ') ' );
116+ throw new BarcodeException ('Invalid character: \chr( ' . ( \ord ($ digit) & 0xFF ) . ') ' );
117117 }
118118
119119 $ seq .= $ this ::CHBAR [$ digit ];
Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ protected function toUpper(string $data): string
247247 $ pos += 2 ;
248248 } else {
249249 if ((\ord ($ data [$ pos ]) >= \ord ('a ' )) && (\ord ($ data [$ pos ]) <= \ord ('z ' ))) {
250- $ data [$ pos ] = \chr (\ord ($ data [$ pos ]) - 32 );
250+ $ data [$ pos ] = \chr (( \ord ($ data [$ pos ]) - 32 ) & 0xFF );
251251 }
252252
253253 ++$ pos ;
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ protected function getCode(): int
130130 */
131131 protected function setFrameAt (array $ pos , int $ val ): void
132132 {
133- $ this ->frame [$ pos ['y ' ]][$ pos ['x ' ]] = \chr ($ val );
133+ $ this ->frame [$ pos ['y ' ]][$ pos ['x ' ]] = \chr ($ val & 0xFF );
134134 }
135135
136136 /**
You can’t perform that action at this time.
0 commit comments