Page MenuHomePhabricator

D13152.diff
No OneTemporary

D13152.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -3903,7 +3903,6 @@
'DivinerLiveBook' => array(
'DivinerDAO',
'PhabricatorPolicyInterface',
- 'PhabricatorProjectInterface',
'PhabricatorDestructibleInterface',
),
'DivinerLivePublisher' => 'DivinerPublisher',
diff --git a/src/aphront/configuration/AphrontApplicationConfiguration.php b/src/aphront/configuration/AphrontApplicationConfiguration.php
--- a/src/aphront/configuration/AphrontApplicationConfiguration.php
+++ b/src/aphront/configuration/AphrontApplicationConfiguration.php
@@ -80,7 +80,7 @@
// This is the earliest we can get away with this, we need env config first.
PhabricatorAccessLog::init();
$access_log = PhabricatorAccessLog::getLog();
- PhabricatorStartup::setGlobal('log.access', $access_log);
+ PhabricatorStartup::setAccessLog($access_log);
$access_log->setData(
array(
'R' => AphrontRequest::getHTTPHeader('Referer', '-'),
diff --git a/support/PhabricatorStartup.php b/support/PhabricatorStartup.php
--- a/support/PhabricatorStartup.php
+++ b/support/PhabricatorStartup.php
@@ -39,7 +39,7 @@
private static $startTime;
private static $debugTimeLimit;
- private static $globals = array();
+ private static $accessLog;
private static $capturingOutput;
private static $rawInput;
private static $oldMemoryLimit;
@@ -72,29 +72,14 @@
/**
* @task info
*/
- public static function setGlobal($key, $value) {
- self::validateGlobal($key);
-
- self::$globals[$key] = $value;
+ public static function setAccessLog($access_log) {
+ self::$accessLog = $access_log;
}
/**
* @task info
*/
- public static function getGlobal($key, $default = null) {
- self::validateGlobal($key);
-
- if (!array_key_exists($key, self::$globals)) {
- return $default;
- }
-
- return self::$globals[$key];
- }
-
- /**
- * @task info
- */
public static function getRawInput() {
return self::$rawInput;
}
@@ -108,7 +93,7 @@
*/
public static function didStartup() {
self::$startTime = microtime(true);
- self::$globals = array();
+ self::$accessLog = null;
static $registered;
if (!$registered) {
@@ -348,8 +333,7 @@
}
self::endOutputCapture();
- $access_log = self::getGlobal('log.access');
-
+ $access_log = self::$accessLog;
if ($access_log) {
// We may end up here before the access log is initialized, e.g. from
// verifyPHP().
@@ -402,9 +386,15 @@
*/
private static function normalizeInput() {
// Replace superglobals with unfiltered versions, disrespect php.ini (we
- // filter ourselves)
- $filter = array(INPUT_GET, INPUT_POST,
- INPUT_SERVER, INPUT_ENV, INPUT_COOKIE,
+ // filter ourselves).
+
+ // NOTE: We don't filter INPUT_SERVER because we don't want to overwrite
+ // changes made in "preamble.php".
+ $filter = array(
+ INPUT_GET,
+ INPUT_POST,
+ INPUT_ENV,
+ INPUT_COOKIE,
);
foreach ($filter as $type) {
$filtered = filter_input_array($type, FILTER_UNSAFE_RAW);
@@ -412,9 +402,6 @@
continue;
}
switch ($type) {
- case INPUT_SERVER:
- $_SERVER = array_merge($_SERVER, $filtered);
- break;
case INPUT_GET:
$_GET = array_merge($_GET, $filtered);
break;
@@ -552,21 +539,6 @@
/**
- * @task validation
- */
- private static function validateGlobal($key) {
- static $globals = array(
- 'log.access' => true,
- 'csrf.salt' => true,
- );
-
- if (empty($globals[$key])) {
- throw new Exception("Access to unknown startup global '{$key}'!");
- }
- }
-
-
- /**
* Detect if this request has had its POST data stripped by exceeding the
* 'post_max_size' PHP configuration limit.
*

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 25, 11:10 PM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6742896
Default Alt Text
D13152.diff (3 KB)

Event Timeline