Skip to content

Commit fd5e94f

Browse files
committed
Clarify that text in phar files has no standard encoding
1 parent e2b8b5b commit fd5e94f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

archive/phar_without_stub.ksy

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ doc: |
2020
A phar's stub is terminated by the special token `__HALT_COMPILER();` (which may be followed by at most one space, the PHP tag end `?>`, and an optional line terminator). The stub termination sequence is immediately followed by the remaining parts of the phar format, as described in this spec.
2121
2222
The phar stub usually contains code that loads the phar and runs a contained PHP file, but this is not required. A minimal valid phar stub is `<?php __HALT_COMPILER();` - such a stub makes it impossible to execute the phar directly, but still allows loading or manipulating it using the phar extension.
23+
24+
Note: The phar format does not specify any encoding for text fields (stub, alias name, and all file names), so these fields may contain arbitrary binary data. The actual text encoding used in a specific phar file usually depends on the application that created the phar, and on the standard encoding of the system on which the phar was created.
2325
doc-ref:
2426
- 'https://www.php.net/manual/en/phar.fileformat.php'
2527
- 'https://github.com/php/php-src/tree/master/ext/phar'

0 commit comments

Comments
 (0)