Last active
March 21, 2017 15:22
-
-
Save evaisse/b02dff1242e55e6eaabcd40c2043cd3b to your computer and use it in GitHub Desktop.
A Docker container to confirm the bug : https://bugs.php.net/bug.php?id=63426
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian | |
RUN apt-get update && apt-get install -y libapache2-mod-php5 php5-xdebug nano vim | |
RUN a2enmod php5 | |
RUN rm /var/www/html/index.html | |
COPY index.php /var/www/html/index.php | |
COPY test.php /var/www/html/test.php | |
ADD start.sh /root/start.sh | |
RUN chmod +x /root/start.sh | |
EXPOSE 80 | |
CMD ["/root/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (@$_GET['txt']) { | |
foreach (ini_get_all() as $key => $value) { | |
print "$key = ".json_encode($value)."\n"; | |
} | |
} else { | |
phpinfo(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source /etc/apache2/envvars | |
exec apache2 -D FOREGROUND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Charset: utf-8'); | |
try { | |
// this don't work, you should not even go in the catch block | |
throw new Exception("C'est pas p" . html_entity_decode("àté", ENT_COMPAT | ENT_HTML401, 'ISO-8859-1')); | |
// if you skip the first exception, this one is ok will not segfault | |
throw new Exception("C'est pas p" . html_entity_decode("àté", ENT_COMPAT | ENT_HTML401, 'utf-8')); | |
} catch (\Exception $e) { | |
print $e->getMessage(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment