Skip to content

Commit 04d7d79

Browse files
committed
Start php83 branch
Merge branch 'php81' into php83 # Conflicts: # composer.json
2 parents 02d4a43 + 36abb5f commit 04d7d79

3 files changed

Lines changed: 43 additions & 11 deletions

File tree

library/Zend/Filter/LocalizedToNormalized.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ public function setOptions(?array $options = null)
9797
*/
9898
public function filter($value)
9999
{
100+
$value = $this->filterTrailingNumberSigns($value);
101+
100102
if (Zend_Locale_Format::isNumber($value, $this->_options)) {
101103
return Zend_Locale_Format::getNumber($value, $this->_options);
102104
} else if (($this->_options['date_format'] === null) && (strpos($value, ':') !== false)) {
@@ -109,4 +111,26 @@ public function filter($value)
109111

110112
return $value;
111113
}
114+
115+
/**
116+
* Remove dots and commas from the end of the given value, as they lead to problems and are usually unintended
117+
* by the user who entered them.
118+
*/
119+
private function filterTrailingNumberSigns($value)
120+
{
121+
if (empty($value)) {
122+
return $value;
123+
}
124+
125+
if (!is_string($value)) {
126+
return $value;
127+
}
128+
129+
$lastChar = substr($value, -1, 1);
130+
$numberFormattingChars = [',', '.'];
131+
if (!empty($value) && in_array($lastChar, $numberFormattingChars)) {
132+
$value = rtrim($value, implode('', $numberFormattingChars));
133+
}
134+
return $value;
135+
}
112136
}

library/Zend/Session/SaveHandler/DbTable.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public function getOverrideLifetime()
290290
* @param string $name
291291
* @return boolean
292292
*/
293-
public function open($save_path, $name)
293+
public function open(string $save_path, string $name): bool
294294
{
295295
$this->_sessionSavePath = $save_path;
296296
$this->_sessionName = $name;
@@ -303,7 +303,7 @@ public function open($save_path, $name)
303303
*
304304
* @return boolean
305305
*/
306-
public function close()
306+
public function close(): bool
307307
{
308308
return true;
309309
}
@@ -314,7 +314,7 @@ public function close()
314314
* @param string $id
315315
* @return string
316316
*/
317-
public function read($id)
317+
public function read(string $id): string
318318
{
319319
$return = '';
320320

@@ -338,7 +338,7 @@ public function read($id)
338338
* @param string $data
339339
* @return boolean
340340
*/
341-
public function write($id, $data)
341+
public function write(string $id, string $data): bool
342342
{
343343
$data = [$this->_modifiedColumn => time(),
344344
$this->_dataColumn => (string) $data];
@@ -366,7 +366,7 @@ public function write($id, $data)
366366
* @param string $id
367367
* @return boolean
368368
*/
369-
public function destroy($id)
369+
public function destroy($id): bool
370370
{
371371
$this->delete($this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE));
372372
return true; //always return true, since if nothing can be deleted, it is already deleted and thats OK.
@@ -378,13 +378,11 @@ public function destroy($id)
378378
* @param int $maxlifetime
379379
* @return true
380380
*/
381-
public function gc($maxlifetime)
381+
public function gc(int $maxlifetime): int
382382
{
383-
$this->delete($this->getAdapter()->quoteIdentifier($this->_modifiedColumn, true) . ' + '
384-
. $this->getAdapter()->quoteIdentifier($this->_lifetimeColumn, true) . ' < '
385-
. $this->getAdapter()->quote(time()));
386-
387-
return true;
383+
return $this->delete($this->getAdapter()->quoteIdentifier($this->_modifiedColumn, true) . ' + '
384+
. $this->getAdapter()->quoteIdentifier($this->_lifetimeColumn, true) . ' < '
385+
. $this->getAdapter()->quote(time()));
388386
}
389387

390388
/**

php83.info.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
PHP8.3 Intera Version
2+
3+
Branch is based on 8.2 compabible release https://github.com/Shardj/zf1-future/releases/tag/release-1.25.0 from
4+
base repository.
5+
6+
We add previous customizations that we did in php81 branch on top.
7+
8+
Additionally, we had some composer patches that we applied in php81, that are now part of this branch as well.
9+
10+
Lastly, we fixed some php8.3 deprecations.

0 commit comments

Comments
 (0)