Revert "removing exceptions - in these cases server admins can opt to disable the warning message in the configuration"

This reverts commit d0365faf76.
This commit is contained in:
El RIDO 2019-06-23 09:54:48 +02:00
parent d9f27fb004
commit dc193f7555
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
3 changed files with 21 additions and 2 deletions

View file

@ -4538,10 +4538,29 @@ jQuery.PrivateBin = (function($, RawDeflate) {
} }
const url = new URL(window.location); const url = new URL(window.location);
// HTTP is obviously insecure // HTTP is obviously insecure
if (url.protocol !== 'http:') { if (url.protocol !== 'http:') {
return false; return false;
} }
// filter out actually secure connections over HTTP
if (
url.hostname.endsWith('.onion') ||
url.hostname.endsWith('.i2p')
) {
return false;
}
// whitelist localhost for development
if (
url.hostname === 'localhost' ||
url.hostname === '127.0.0.1'
) {
return false;
}
// totally INSECURE http protocol!
return true; return true;
} }

View file

@ -72,7 +72,7 @@ if ($MARKDOWN):
endif; endif;
?> ?>
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.10.js" integrity="sha512-CqskSFXERL38A1PJP9BlO04me7kmwgDIhN1+k24RoFiisEwXA0BMdm0lzJC7g5jCRZ4k5OYdOJGEqW9CwDl4CA==" crossorigin="anonymous"></script> <script type="text/javascript" data-cfasync="false" src="js/purify-1.0.10.js" integrity="sha512-CqskSFXERL38A1PJP9BlO04me7kmwgDIhN1+k24RoFiisEwXA0BMdm0lzJC7g5jCRZ4k5OYdOJGEqW9CwDl4CA==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-0Vv7H6Clyx/hCJ0CZGXO+aJr6UERFwpxHXhhqfYyQNTj0F7pZKAYFrKePW3xn/EZVAUvUXnVmVCRFuziKkcOYg==" crossorigin="anonymous"></script> <script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-5gKAd6tYYmYAFpoLXkuB0nmvFrNpgK9E79RrlwEfde/aWrdAczlD6lL06IFg0E00vUajgMzxM3WlTw25M7lFLw==" crossorigin="anonymous"></script>
<!--[if IE]> <!--[if IE]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style> <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
<![endif]--> <![endif]-->

View file

@ -50,7 +50,7 @@ if ($MARKDOWN):
endif; endif;
?> ?>
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.10.js" integrity="sha512-CqskSFXERL38A1PJP9BlO04me7kmwgDIhN1+k24RoFiisEwXA0BMdm0lzJC7g5jCRZ4k5OYdOJGEqW9CwDl4CA==" crossorigin="anonymous"></script> <script type="text/javascript" data-cfasync="false" src="js/purify-1.0.10.js" integrity="sha512-CqskSFXERL38A1PJP9BlO04me7kmwgDIhN1+k24RoFiisEwXA0BMdm0lzJC7g5jCRZ4k5OYdOJGEqW9CwDl4CA==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-0Vv7H6Clyx/hCJ0CZGXO+aJr6UERFwpxHXhhqfYyQNTj0F7pZKAYFrKePW3xn/EZVAUvUXnVmVCRFuziKkcOYg==" crossorigin="anonymous"></script> <script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-5gKAd6tYYmYAFpoLXkuB0nmvFrNpgK9E79RrlwEfde/aWrdAczlD6lL06IFg0E00vUajgMzxM3WlTw25M7lFLw==" crossorigin="anonymous"></script>
<!--[if IE]> <!--[if IE]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style> <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
<![endif]--> <![endif]-->