Skip to content

Commit f105b5a

Browse files
bug #51030 [Intl] Fixed directory traversal in emoji compression tool (rlandgrebe)
This PR was merged into the 6.3 branch. Discussion ---------- [Intl] Fixed directory traversal in emoji compression tool When using the compression tool, the emoji data is not compressed properly due to directory traversal issues. It only goes one level deep in the `data' directory. | Q | A | ------------- | --- | Branch? | 6.3 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #51029 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Commits ------- da26542 [Intl] Fixed directory traversal in emoji compression tool
2 parents a451ae5 + da26542 commit f105b5a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/intl-data-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ jobs:
8484
run: |
8585
[ -f src/Symfony/Component/Intl/Resources/data/locales/en.php ]
8686
[ ! -f src/Symfony/Component/Intl/Resources/data/locales/en.php.gz ]
87+
[ -f src/Symfony/Component/Intl/Resources/data/transliterator/emoji/emoji-en.php ]
88+
[ ! -f src/Symfony/Component/Intl/Resources/data/transliterator/emoji/emoji-en.php.gz ]
8789
src/Symfony/Component/Intl/Resources/bin/compress
8890
[ ! -f src/Symfony/Component/Intl/Resources/data/locales/en.php ]
8991
[ -f src/Symfony/Component/Intl/Resources/data/locales/en.php.gz ]
92+
[ ! -f src/Symfony/Component/Intl/Resources/data/transliterator/emoji/emoji-en.php ]
93+
[ -f src/Symfony/Component/Intl/Resources/data/transliterator/emoji/emoji-en.php.gz ]
9094
./phpunit src/Symfony/Component/Intl

src/Symfony/Component/Intl/Resources/bin/compress

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,15 @@ if (!extension_loaded('zlib')) {
1717
throw new Exception('This script requires the zlib extension.');
1818
}
1919

20-
foreach (glob(dirname(__DIR__).'/data/*/*.php') as $file) {
21-
if ('meta.php' === basename($file)) {
20+
$iterator = new RecursiveIteratorIterator(
21+
new RecursiveDirectoryIterator(
22+
dirname(__DIR__).'/data',
23+
FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS
24+
)
25+
);
26+
27+
foreach ($iterator as $file) {
28+
if ('php' !== $file->getExtension() || 'meta.php' === $file->getFilename()) {
2229
continue;
2330
}
2431

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy