Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2696468
D25122.1734879820.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25122.1734879820.diff
View Options
diff --git a/scripts/repository/commit_hook.php b/scripts/repository/commit_hook.php
--- a/scripts/repository/commit_hook.php
+++ b/scripts/repository/commit_hook.php
@@ -119,12 +119,14 @@
exit($err);
} else if ($repository->isGit() || $repository->isHg()) {
$username = getenv(DiffusionCommitHookEngine::ENV_USER);
- if (!phutil_nonempty_string($username)) {
- throw new Exception(
- pht(
- 'No Direct Pushes: You are pushing directly to a hosted repository. '.
- 'This will not work. See "No Direct Pushes" in the documentation '.
- 'for more information.'));
+ if ($username !== false ) {
+ if (!phutil_nonempty_string($username)) {
+ throw new Exception(
+ pht(
+ 'No Direct Pushes: You are pushing directly to a hosted repository. '.
+ 'This will not work. See "No Direct Pushes" in the documentation '.
+ 'for more information.'));
+ }
}
if ($repository->isHg()) {
@@ -181,18 +183,24 @@
$engine->setOriginalArgv(array_slice($argv, 2));
$remote_address = getenv(DiffusionCommitHookEngine::ENV_REMOTE_ADDRESS);
-if (phutil_nonempty_string($remote_address)) {
- $engine->setRemoteAddress($remote_address);
+if ($remote_address !== false ) {
+ if (phutil_nonempty_string($remote_address)) {
+ $engine->setRemoteAddress($remote_address);
+ }
}
$remote_protocol = getenv(DiffusionCommitHookEngine::ENV_REMOTE_PROTOCOL);
-if (phutil_nonempty_string($remote_protocol)) {
- $engine->setRemoteProtocol($remote_protocol);
+if ($remote_protocol !== false ) {
+ if (phutil_nonempty_string($remote_protocol)) {
+ $engine->setRemoteProtocol($remote_protocol);
+ }
}
$request_identifier = getenv(DiffusionCommitHookEngine::ENV_REQUEST);
-if (phutil_nonempty_string($request_identifier)) {
- $engine->setRequestIdentifier($request_identifier);
+if ($request_identifier !== false ) {
+ if (phutil_nonempty_string($request_identifier)) {
+ $engine->setRequestIdentifier($request_identifier);
+ }
}
try {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 15:03 (2 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1026052
Default Alt Text
D25122.1734879820.diff (1 KB)
Attached To
Mode
D25122: Fix InvalidArgumentException on commit hook
Attached
Detach File
Event Timeline
Log In to Comment