Page MenuHomePhabricator

Preamble fix
Needs RevisionPublic

Authored by theascone on May 22 2015, 6:50 PM.
Tags
None
Referenced Files
F13086682: D12977.diff
Thu, Apr 25, 12:40 AM
Unknown Object (File)
Sun, Apr 21, 1:33 PM
Unknown Object (File)
Thu, Apr 11, 8:32 AM
Unknown Object (File)
Sun, Mar 31, 9:19 AM
Unknown Object (File)
Sat, Mar 30, 11:54 PM
Unknown Object (File)
Mar 22 2024, 9:11 PM
Unknown Object (File)
Feb 4 2024, 2:45 AM
Unknown Object (File)
Dec 31 2023, 8:29 AM
Subscribers

Details

Summary

Ref T7114
Should make it possible to override values in $_SERVER using the preamble script.

Example (inside preamble.php):

<?php

$GLOBALS['PREAMBLE'] = array (
  'SERVER' => array (
    'REMOTE_ADDR' => $_SERVER['HTTP_X_FORWARDED_FOR'],
    'HTTPS' => true,
  ),
);
Test Plan

$_SERVER values are being overridden using this method.

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 6216
Build 6237: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

theascone retitled this revision from to Preamble fix.
theascone updated this object.
theascone edited the test plan for this revision. (Show Details)
theascone added a reviewer: epriestley.
theascone set the repository for this revision to rP Phabricator.
epriestley edited edge metadata.

I think we can just not filter $_SERVER instead. I believe there is no sensible setting for filter.default which causes problems with Phabricator without completely breaking all reasonable applications. The only values I can possibly see an issue with are PHP_AUTH_USER and PHP_AUTH_PW, which could interact poorly with settings like "magic_quotes", "string" or "stripped".

Let's try not resetting $_SERVER (that is, basically remove the INPUT_SERVER case from this function) and see if anyone runs into issues? If it does, we could selectively decline to filter values which make sense to override in the preamble (REMOTE_ADDR, HTTPS) since they are not sensitive to remotely reasonable input filters anyway.

This revision now requires changes to proceed.May 25 2015, 2:57 PM