mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Trying a fix for encoding issues occuring from time to time
This commit is contained in:
@@ -46,7 +46,11 @@ var Channel = {
|
|||||||
number_suggested = 0;
|
number_suggested = 0;
|
||||||
var no_socket = true;
|
var no_socket = true;
|
||||||
|
|
||||||
chan = Helper.decodeChannelName(Helper.html("#chan"));
|
//chan = Helper.decodeChannelName(Helper.html("#chan"));
|
||||||
|
var _p = window.location.pathname;
|
||||||
|
if(_p.substring(0,1) == "/") _p = _p.substring(1);
|
||||||
|
if(_p.substring(_p.length - 1) == "/") _p = _p.substring(0, _p.length - 1);
|
||||||
|
chan = Helper.decodeChannelName(_p);
|
||||||
|
|
||||||
mobile_beginning = Helper.mobilecheck();
|
mobile_beginning = Helper.mobilecheck();
|
||||||
var side = Helper.mobilecheck() ? "left" : "right";
|
var side = Helper.mobilecheck() ? "left" : "right";
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ var Helper = {
|
|||||||
decodeChannelName: function(str) {
|
decodeChannelName: function(str) {
|
||||||
var _fn = decodeURIComponent;
|
var _fn = decodeURIComponent;
|
||||||
str = str.toUpperCase();
|
str = str.toUpperCase();
|
||||||
|
/*if(str.indexOf("%25") >= 0) {
|
||||||
|
var _percentSign = str.indexOf("%25") + 1;
|
||||||
|
var _before = str.substring(0, _percentSign);
|
||||||
|
var _after = str.substring(_percentSign);
|
||||||
|
str = _before + "25" + _after;
|
||||||
|
console.log(str);
|
||||||
|
}*/
|
||||||
var toReturn = _fn(str.replace(/%5F/g, "_"));
|
var toReturn = _fn(str.replace(/%5F/g, "_"));
|
||||||
toReturn = toReturn.toLowerCase().replace(/&/g, "&");
|
toReturn = toReturn.toLowerCase().replace(/&/g, "&");
|
||||||
return toReturn.toLowerCase();
|
return toReturn.toLowerCase();
|
||||||
|
|||||||
@@ -255,7 +255,8 @@ function channel(req, res, next) {
|
|||||||
}*/
|
}*/
|
||||||
var data = {
|
var data = {
|
||||||
title: "404: File Not Found",
|
title: "404: File Not Found",
|
||||||
list_name: capitalizeFirstLetter(Functions.decodeChannelName(req.params.channel_name)),
|
//list_name: capitalizeFirstLetter(Functions.decodeChannelName(req.params.channel_name)),
|
||||||
|
list_name: capitalizeFirstLetter(req.params.channel_name),
|
||||||
year: year,
|
year: year,
|
||||||
javascript_file: "main.min.js",
|
javascript_file: "main.min.js",
|
||||||
captcha: res.recaptcha,
|
captcha: res.recaptcha,
|
||||||
|
|||||||
Reference in New Issue
Block a user