Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

support check buffer #9

Closed
Joungkyun opened this issue Mar 24, 2021 · 0 comments
Closed

support check buffer #9

Joungkyun opened this issue Mar 24, 2021 · 0 comments
Assignees
Milestone

Comments

@Joungkyun
Copy link
Member

AS-IS

Currently, you can only obtain MAGIC information in the file specified in the first argument.

<?php
echo filebin('sample string');
?>

Result:
PHP Warning:  sample string file not found. in /root/work/github/php/mod_filebin/sample.php on line 63

Warning: sample string file not found. in /root/work/github/php/mod_filebin/sample.php on line 1

TO-BE

If the first 5Byte of the 1st argument value is DATA: prefix, use the magic_buffer api instead of the magic_file api.

<?php
$buffer = file_get_contents('/some/path/image.png');
echo filebin('DATA:' . $buffer);
?>
@Joungkyun Joungkyun added this to the 3.0.1 milestone Mar 24, 2021
@Joungkyun Joungkyun self-assigned this Mar 24, 2021
Joungkyun added a commit that referenced this issue Mar 25, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant