@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fatal during setup for "mbstring.func_overload"

Summary:
Fixes T5545. We assume `strlen()` returns the number of bytes in a string, which is the normal behavior (and the documented behavior).

There's a config option, `mbstring.func_overload`, which silently calls mb_strlen() instead. This may return some other result, might fail, etc., and there's no way to get the byte length of a string if this option is set.

If this option is set, fatal immediately. Nothing good can ever come of it.

Test Plan: {F173990}

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5545

Differential Revision: https://secure.phabricator.com/D9811

+17
+17
src/applications/config/check/PhabricatorSetupCheckPHPConfig.php
··· 75 75 } 76 76 } 77 77 78 + $overload_option = 'mbstring.func_overload'; 79 + $func_overload = ini_get($overload_option); 80 + if ($func_overload) { 81 + $message = pht( 82 + "You have '%s' enabled in your PHP configuration.\n\n". 83 + "This option is not compatible with Phabricator. Disable ". 84 + "'%s' in your PHP configuration to continue.", 85 + $overload_option, 86 + $overload_option); 87 + 88 + $this->newIssue('php'.$overload_option) 89 + ->setIsFatal(true) 90 + ->setName(pht('Disable PHP %s', $overload_option)) 91 + ->setMessage($message) 92 + ->addPHPConfig($overload_option); 93 + } 94 + 78 95 $open_basedir = ini_get('open_basedir'); 79 96 if ($open_basedir) { 80 97