mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-25 16:00:22 +01:00
8chan-mod-pages.php: Fix CSS URL filter ignoring all but the last URL on a line
This commit is contained in:
parent
aa71065dac
commit
dbc4fbc5fe
@ -521,24 +521,21 @@ 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/', 'https://fonts.gstatic.com/', 'http://8ch.net/', 'https://8chan.co/');
|
||||
$error = false;
|
||||
|
||||
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!"), $match));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
error(_('Off-site links are not allowed in board stylesheets!'));
|
||||
}
|
||||
|
||||
$query = query('SELECT `uri`, `title`, `subtitle` FROM ``boards`` WHERE `8archive` = TRUE');
|
||||
file_write('8archive.json', json_encode($query->fetchAll(PDO::FETCH_ASSOC)));
|
||||
file_write($b.'/config.php', $config_file);
|
||||
|
Loading…
Reference in New Issue
Block a user