Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13962025
D16450.id39566.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D16450.id39566.diff
View Options
diff --git a/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php b/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php
--- a/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php
+++ b/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php
@@ -197,5 +197,33 @@
->setMessage($message);
}
}
+
+ if (empty($_SERVER['REMOTE_ADDR'])) {
+ $doc_href = PhabricatorEnv::getDocLink('Configuring a Preamble Script');
+
+ $summary = pht(
+ 'You likely need to fix your preamble script so '.
+ 'REMOTE_ADDR is no longer empty.');
+
+ $message = pht(
+ 'No REMOTE_ADDR is available, so Phabricator cannot determine the '.
+ 'origin address for requests. This will prevent Phabricator from '.
+ 'performing important security checks. This most often means you '.
+ 'have a mistake in your preamble script. %s and double-check that '.
+ 'the script is written correctly.',
+ phutil_tag(
+ 'a',
+ array(
+ 'href' => $doc_href,
+ 'target' => '_blank',
+ 'rel' => 'noopener',
+ ),
+ pht('Consult the documentation')));
+
+ $this->newIssue('php.remote_addr')
+ ->setName(pht('No REMOTE_ADDR available'))
+ ->setSummary($summary)
+ ->setMessage($message);
+ }
}
}
diff --git a/src/applications/people/storage/PhabricatorUserLog.php b/src/applications/people/storage/PhabricatorUserLog.php
--- a/src/applications/people/storage/PhabricatorUserLog.php
+++ b/src/applications/people/storage/PhabricatorUserLog.php
@@ -108,7 +108,7 @@
$log->setUserPHID((string)$object_phid);
$log->setAction($action);
- $log->remoteAddr = idx($_SERVER, 'REMOTE_ADDR', '');
+ $log->remoteAddr = (string)idx($_SERVER, 'REMOTE_ADDR', '');
return $log;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 16 2024, 7:37 AM (4 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6716603
Default Alt Text
D16450.id39566.diff (1 KB)
Attached To
Mode
D16450: Added a setup check for empty REMOTE_ADDR
Attached
Detach File
Event Timeline
Log In to Comment