git.cweiske.de
/
phorkie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1e85286
)
Fix #43: gist.github.com URLs with usernames
author
Christian Weiske
<cweiske@cweiske.de>
Wed, 5 Feb 2014 05:31:19 +0000
(06:31 +0100)
committer
Christian Weiske
<cweiske@cweiske.de>
Wed, 5 Feb 2014 05:31:42 +0000
(06:31 +0100)
src/phorkie/HtmlParser.php
patch
|
blob
|
history
diff --git
a/src/phorkie/HtmlParser.php
b/src/phorkie/HtmlParser.php
index f75107415a10227093abe30ceb5469e00c0ba23f..6b5d26ad60d869874b976a5fa14d2afa7d49e16b 100644
(file)
--- a/
src/phorkie/HtmlParser.php
+++ b/
src/phorkie/HtmlParser.php
@@
-44,9
+44,17
@@
class HtmlParser
if ($scheme == 'https' && isset($arUrl['host'])
&& $arUrl['host'] == 'gist.github.com'
) {
if ($scheme == 'https' && isset($arUrl['host'])
&& $arUrl['host'] == 'gist.github.com'
) {
+ //https://gist.github.com/maddy2101/5764473
+ $parts = explode('/', ltrim($arUrl['path'], '/'));
+ if (count($parts == 2)) {
+ //we only want the number, not the user name
+ $path = $parts[1];
+ } else {
+ $path = ltrim($arUrl['path'], '/');
+ }
//FIXME: title
$this->arGitUrls[][] = 'git://gist.github.com/'
//FIXME: title
$this->arGitUrls[][] = 'git://gist.github.com/'
- .
ltrim($arUrl['path'], '/')
. '.git';
+ .
$path
. '.git';
return true;
}
return true;
}