diff --git a/docs/NEWS b/docs/NEWS index db42d0fe..4bbb8a20 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -4,6 +4,8 @@ Version 1.7 () ------------------------------------------------------------------------ + * Made Spartacus recognize github.com mirror (garvinhicking) + * Add "Summary" output to title of summary archive pages, patch by hboeck diff --git a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php index a0fd8bdc..8fe0b719 100644 --- a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php +++ b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php @@ -100,7 +100,7 @@ class serendipity_event_spartacus extends serendipity_event 'xml' => array( 'http://netmirror.org/mirror/serendipity/', 'http://s9y.org/mirror/', - 'https://raw.github.com/s9y/additional_plugins/', + 'https://raw.github.com/s9y/additional_plugins/master/', // 'http://openmirror.org/pub/s9y/', ), @@ -370,8 +370,8 @@ class serendipity_event_spartacus extends serendipity_event static $error = false; // Fix double URL strings. - $url = str_replace('http:/', 'http://', str_replace('//', '/', $url)); - + $url = preg_replace('@http(s)?:/@i', 'http\1://', str_replace('//', '/', $url)); + // --JAM: Get the URL's IP in the most error-free way possible $url_parts = @parse_url($url); $url_hostname = 'localhost'; @@ -879,6 +879,7 @@ class serendipity_event_spartacus extends serendipity_event function download(&$tree, $plugin_to_install, $sub = 'plugins') { global $serendipity; + $gitloc = ''; switch($sub) { case 'plugins': default: @@ -946,9 +947,13 @@ class serendipity_event_spartacus extends serendipity_event $servers = explode('|', $custom); $mirror = $servers[0]; } + + if (stristr($mirror, 'github.com')) { + $gitloc = 'master/'; + } foreach($files AS $file) { - $url = $mirror . '/' . $sfloc . '/' . $file . '?revision=1.9999'; + $url = $mirror . '/' . $sfloc . '/' . $gitloc . $file . '?revision=1.9999'; $target = $pdir . $file; $this->rmkdir($pdir . $plugin_to_install,$sub); $this->fileperm($pdir . $plugin_to_install, true);