1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00

Improved url sanitizing

This commit is contained in:
sam 2012-05-22 12:45:44 +02:00
parent 14b0b37bfb
commit 7703b26333

View File

@ -269,12 +269,12 @@ window.zerobin = {
getPasteId: function(url){
var loc = url ? zerobin.parseUrl(url) : window.location;
return loc.pathname.replace(/\/|paste/g, '').replace(/\?.*$/, '');
return loc.pathname.replace(/\/|paste/g, '');
},
getPasteKey: function(url){
var loc = url ? zerobin.parseUrl(url) : window.location;
return loc.hash.replace('#', '').replace(/\?.*$/, '');
return loc.hash.replace('#', '').replace(/(\?|&).*$/, '');
},
/** Return the paste content stripted from any code coloration */