Commit 63f0d214 authored by Leo Iannacone's avatar Leo Iannacone

prevent people in insert .. in url [server already checked]

parent c14609b7
...@@ -38,11 +38,16 @@ function Page_Distrubion(socket) ...@@ -38,11 +38,16 @@ function Page_Distrubion(socket)
var new_lines = [] var new_lines = []
function __check_hash_makes_sense() { function __check_hash_makes_sense() {
if (window.location.hash.indexOf('..') >= 0) {
error.set('God Is Watching You !')
return false
}
if (! window.location.hash) if (! window.location.hash)
window.location.pathname = '/' window.location.pathname = '/'
var info = window.location.hash.split('/') var info = window.location.hash.split('/')
if (info.length == 2) if (info.length == 2)
window.location.hash = info[0] window.location.hash = info[0]
return true
} }
var title = { var title = {
...@@ -433,7 +438,8 @@ function Page_Distrubion(socket) ...@@ -433,7 +438,8 @@ function Page_Distrubion(socket)
}) })
$(window).on('hashchange', function() { $(window).on('hashchange', function() {
__check_hash_makes_sense() if (! __check_hash_makes_sense())
return
var old_view = Utils.clone(view) var old_view = Utils.clone(view)
var new_view = Utils.from_hash_to_view() var new_view = Utils.from_hash_to_view()
// reset current view // reset current view
...@@ -447,7 +453,8 @@ function Page_Distrubion(socket) ...@@ -447,7 +453,8 @@ function Page_Distrubion(socket)
}); });
$(window).on('load', function () { $(window).on('load', function () {
__check_hash_makes_sense() if (! __check_hash_makes_sense())
return
populate() populate()
// Init sticky-view back_on_top on click // Init sticky-view back_on_top on click
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment