Skip to content

Commit 32630bd

Browse files
committed
[phalcon#16593] - fix: fixed memory leak by anonymous function in PascalCase.zep
1 parent 041897a commit 32630bd

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

CHANGELOG-5.0.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [5.7.1](https://github.com/phalcon/cphalcon/releases/tag/v5.7.1) (XXXX-XX-XX)
4+
5+
### Changed
6+
7+
### Added
8+
9+
### Fixed
10+
11+
- Fixed `Phalcon\Support\Helper\PascalCase` causing memory leak by anonymous function [#16593](https://github.com/phalcon/cphalcon/issues/16593)
12+
13+
### Removed
14+
315
## [5.7.0](https://github.com/phalcon/cphalcon/releases/tag/v5.7.0) (2024-05-17)
416

517
### Changed

phalcon/Support/Helper/Str/PascalCase.zep

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,16 @@ class PascalCase
2525
string text,
2626
string delimiters = null
2727
) -> string {
28-
var exploded, output;
28+
var exploded, output, element;
2929

3030
let exploded = this->processArray(text, delimiters);
3131

32-
let output = array_map(
33-
function (element) {
34-
return ucfirst(mb_strtolower(element));
35-
},
36-
exploded
37-
);
32+
let output = "";
33+
for element in exploded {
34+
let output = output . ucfirst(mb_strtolower(element));
35+
}
3836

39-
return implode("", output);
37+
return output;
4038
}
4139

4240
/**

0 commit comments

Comments
 (0)