1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/sapi/fuzzer/generate_unserialize_dict.php
Nikita Popov 828c93bedc Fix unserialize dictionary generation
We now have namespaced classes in here, and need to escape the
backslashes.
2022-07-30 17:14:22 +02:00

10 lines
213 B
PHP

<?php
$dict = "";
foreach (get_declared_classes() as $class) {
$len = strlen($class);
$dict .= "\"$len:\\\"" . addslashes($class) . "\\\"\"\n";
}
file_put_contents(__DIR__ . "/dict/unserialize", $dict);