diff --git a/README.md b/README.md index 4d0383e5..d1c1ae31 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ infinity About ------------ -infinity is a fork of vichan, with the difference that 8chan is geared towards allowing users to create their own boards. A running instance is at https://8chan.co. +infinity is a fork of vichan, with the difference that infinity is geared towards allowing users to create their own boards. A running instance is at https://8chan.co. Most things (other than installation) that apply to upstream vichan also apply to infinity. See their readme for a detailed FAQ: https://github.com/vichan-devel/vichan/blob/master/README.md @@ -12,8 +12,8 @@ If you are not interested in letting your users make their own boards, install v Because I cannot be bothered to maintain `install.php`, the install process is as such: ``` -mysql -uroot 8chan < install.sql -echo '8chan' > .installed +mysql -uroot infinity < install.sql +echo 'infinity' > .installed ``` Here's my install script as of 11/14/2014 for the 8chan servers which run Ubuntu 14.04: diff --git a/inc/8chan-mod-pages.php b/inc/8chan-mod-pages.php index b704567d..0b636137 100644 --- a/inc/8chan-mod-pages.php +++ b/inc/8chan-mod-pages.php @@ -520,23 +520,42 @@ EOT; preg_match_all("#$match_urls#im", $clean_css, $matched); - $allowed_urls = array('https://i.imgur.com/', 'https://media.8chan.co/', 'https://a.pomf.se/', 'https://fonts.googleapis.com/', 'http://8ch.net/'); - $error = false; + $allowed_urls = array('https://i.imgur.com/', 'https://media.8chan.co/', 'https://a.pomf.se/', 'https://fonts.googleapis.com/', 'https://fonts.gstatic.com/', 'http://8ch.net/', 'https://8chan.co/'); if (isset($matched[0])) { - foreach ($matched[0] as $i => $v) { - $error = true; - foreach ($allowed_urls as $ii => $url) { - if (strpos($v, $url) === 0) { - $error = false; - break; + foreach ($matched[0] as $match) { + $match_okay = false; + foreach ($allowed_urls as $allowed_url) { + if (strpos($match, $allowed_url) !== false) { + $match_okay = true; } } + if ($match_okay !== true) { + error(sprintf(_("Off-site link \"%s\" is not allowed in the board stylesheet"), $match)); + } } } - - if ($error) { - error(_('Off-site links are not allowed in board stylesheets!')); + + //Filter out imports from sites with potentially unsafe content + $css_no_comments = preg_replace('|\/\*.*\*\/|', '', $clean_css); //I can't figure out how to ignore comments in the match + $match_imports = '@import[^;]*'; + $matched = array(); + preg_match_all("#$match_imports#im", $css_no_comments, $matched); + + $unsafe_import_urls = array('https://a.pomf.se/'); + + if (isset($matched[0])) { + foreach ($matched[0] as $match) { + $match_okay = true; + foreach ($unsafe_import_urls as $unsafe_import_url) { + if (strpos($match, $unsafe_import_url) !== false) { + $match_okay = false; + } + } + if ($match_okay !== true) { + error(sprintf(_("Potentially unsafe import \"%s\" is not allowed in the board stylesheet"), $match)); + } + } } $query = query('SELECT `uri`, `title`, `subtitle` FROM ``boards`` WHERE `8archive` = TRUE'); diff --git a/inc/config.php b/inc/config.php index 09f63ca5..a66fab32 100644 --- a/inc/config.php +++ b/inc/config.php @@ -184,7 +184,7 @@ // Prevents most Tor exit nodes from making posts. Recommended, as a lot of abuse comes from Tor because // of the strong anonymity associated with it. - $config['dnsbl'][] = array('tor.dnsbl.sectoor.de', 1); + $config['dnsbl'][] = array('exitnodes.tor.dnsbl.sectoor.de', 1); // http://www.sorbs.net/using.shtml // $config['dnsbl'][] = array('dnsbl.sorbs.net', array(2, 3, 4, 5, 6, 7, 8, 9)); diff --git a/inc/functions.php b/inc/functions.php index d2417f74..2d5da1f6 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -1964,7 +1964,7 @@ function markup(&$body, $track_cites = false, $op = false) { } // replace tabs with 8 spaces - $body = str_replace("\t", ' ', $body); + $body = str_replace("\t", ' ', $body); return $tracked_cites; } diff --git a/stylesheets/tomorrow.css b/stylesheets/tomorrow.css index 1ddfcd3b..29b2a68d 100644 --- a/stylesheets/tomorrow.css +++ b/stylesheets/tomorrow.css @@ -47,9 +47,9 @@ div.post-hover { border:1px solid #000!important; box-shadow:none!important } -div.thread:hover { +.theme-catalog div.thread:hover { background-color:#1d1f21; - border-color:#000 + border-color:#111 } p.intro span.subject { color:#b294bb @@ -106,13 +106,13 @@ div#options_div { background-color:#282a2e } div.options_tab_icon { - color: #AAA + color:#AAA } div.options_tab_icon:hover { - background-color: #111 + background-color:#111 } div.options_tab_icon.active { - color: #F20 + color:#F20 } div.blotter { color:#F20 @@ -120,7 +120,7 @@ div.blotter { span.omitted { color:#707070 } -p.intro a, span.omitted a { +p.intro a,span.omitted a { text-decoration:none } form#quick-reply { @@ -132,9 +132,9 @@ span.capcode { padding:2px 5px; border-radius: 10px } -div#watchlist { - border:1px solid #111; - background-color:#282a2e +div#watchlist,div#alert_div { + border:1px solid #111; + background-color:#282a2e } div#watchlist a,a.watchThread { color:#81a2be; @@ -143,10 +143,12 @@ div#watchlist a,a.watchThread { div#watchlist a:hover,a.watchThread:hover { color:#5F89AC } -/* Keep small thumbnails */ -a:not([data-expanded="true"]) .post-image{ + +/* Remove the following parts if those annoy you */ +/* Keep small thumbnails in replies */ +.post.reply a:not([data-expanded="true"]) .post-image{ width:auto!important; height:auto!important; - max-height:200px!important; - max-width:200px!important + max-height:160px; + max-width:160px }