git.cweiske.de
/
shpub.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0544c4a
)
better URL completion
author
Christian Weiske
<
[email protected]
>
Tue, 6 Sep 2016 22:27:19 +0000
(
00:27
+0200)
committer
Christian Weiske
<
[email protected]
>
Tue, 6 Sep 2016 22:27:19 +0000
(
00:27
+0200)
src/shpub/Validator.php
patch
|
blob
|
history
diff --git
a/src/shpub/Validator.php
b/src/shpub/Validator.php
index f7f3605d103b999cfee3a314fdd4e48a0922958d..1da91cb390775b5f751efada1d8abb6f00dd8a81 100644
(file)
--- a/
src/shpub/Validator.php
+++ b/
src/shpub/Validator.php
@@
-16,8
+16,14
@@
class Validator
}
if (!isset($parts['host'])) {
- Log::err('Invalid URL: No host in ' . $helpName);
- return false;
+ if (count($parts) == 1 && isset($parts['path'])) {
+ //parse_url('example.org') puts 'example.org' in the path
+ // but this is common, so we fix it.
+ $url = 'http://' . $parts['path'];
+ } else {
+ Log::err('Invalid URL: No host in ' . $helpName);
+ return false;
+ }
}
return $url;