git.cweiske.de
/
phancap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
31c1528
)
automatically add protocol if missing
author
Christian Weiske
<cweiske@cweiske.de>
Mon, 14 Apr 2014 16:25:18 +0000
(18:25 +0200)
committer
Christian Weiske
<cweiske@cweiske.de>
Mon, 14 Apr 2014 16:25:18 +0000
(18:25 +0200)
src/phancap/Options.php
patch
|
blob
|
history
diff --git
a/src/phancap/Options.php
b/src/phancap/Options.php
index 6aaa49f6131424187fd5ebf7d9119858c4691aa2..c1a9b09a94631600cb79682fd7a83cdbd6db792e 100644
(file)
--- a/
src/phancap/Options.php
+++ b/
src/phancap/Options.php
@@
-252,7
+252,10
@@
class Options
throw new \InvalidArgumentException('Invalid URL');
}
if (!isset($parts['scheme'])) {
- throw new \InvalidArgumentException('URL scheme missing');
+ $url = 'http://' . $url;
+ $parts = parse_url($url);
+ } else if ($parts['scheme'] != 'http' && $parts['scheme'] != 'https') {
+ throw new \InvalidArgumentException('Unsupported protocol');
}
if (!isset($parts['host'])) {
throw new \InvalidArgumentException('URL host missing');