diff --git a/support/init/init-script.php b/support/init/init-script.php index 9b67daef..ad40b8bd 100644 --- a/support/init/init-script.php +++ b/support/init/init-script.php @@ -56,6 +56,15 @@ function __arcanist_init_script__() { // inspect "args", and this option generally obscures useful debugging // information without any benefit in the context of Phabricator. 'zend.exception_ignore_args' => 0, + + // See T13100. We'd like the regex engine to fail, rather than segfault, + // if handed a pathological regular expression. + 'pcre.backtrack_limit' => 10000, + 'pcre.recusion_limit' => 10000, + + // NOTE: Phabricator applies a similar set of startup options for Web + // environments in "PhabricatorStartup". Changes here may also be + // appropriate to apply there. ); foreach ($config_map as $config_key => $config_value) { @@ -106,8 +115,6 @@ function __arcanist_init_script__() { PhutilErrorHandler::initialize(); - PhutilErrorHandler::initialize(); - // If "variables_order" excludes "E", silently repair it so that $_ENV has // the values we expect. PhutilExecutionEnvironment::repairMissingVariablesOrder();