master
Dave Winer 9 years ago
parent 0b9e50ee85
commit ffba20e201

@ -88,6 +88,12 @@ There will always be more work to do here. ;-)
#### Updates
##### v0.66 7/19/15 by DW
In prefs.json a new value, legalPathChars, defaults to the empty string. In this string you can specify characters that are legal in paths on your server. We are very conservative in what we will allow in paths, but if you need to use one of the characters that we consider illegal, add it to this string.
For example, I am redirecting urls from discuss.userland.com to a static archive. It was a Manila site, so it uses a $ in the URLs, a character which PagePark by default considers illegal. Here's an <a href="http://discuss.userland.com/msgReader$18647">example</a>. I set legalPathChars to "$" in prefs.json, and it lets the character through, and it is redirected by the very clever little script that handles redirection for that domain.
##### v0.65 7/16/15 by DW
In prefs.json a new value, error404File, defaults to prefs/error.html

@ -384,13 +384,14 @@ function jsonStringify (jstruct, flFixBreakage) { //7/30/14 by DW
function stringAddCommas (x) { //5/27/14 by DW
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function readHttpFile (url, callback, timeoutInMilliseconds) { //5/27/14 by DW
function readHttpFile (url, callback, timeoutInMilliseconds, headers) { //5/27/14 by DW xxx
if (timeoutInMilliseconds === undefined) {
timeoutInMilliseconds = 30000;
}
var jxhr = $.ajax ({
url: url,
dataType: "text" ,
dataType: "text",
headers: headers,
timeout: timeoutInMilliseconds
})
.success (function (data, status) {

@ -1,4 +1,4 @@
var myVersion = "0.65a", myProductName = "PagePark";
var myVersion = "0.66a", myProductName = "PagePark";
/* The MIT License (MIT)
Copyright (c) 2014-2015 Dave Winer
@ -42,7 +42,8 @@ var pageparkPrefs = {
flProcessScriptFiles: true, extScriptFiles: "js", //5/5/15 by DW
flProcessMarkdownFiles: true, extMarkdownFiles: "md", //5/5/15 by DW
flProcessOpmlFiles: true, extOpmlFiles: "opml", //6/23/15 by DW
error404File: "prefs/error.html" //7/16/15 by DW
error404File: "prefs/error.html", //7/16/15 by DW
legalPathChars: "" //7/19/15 by DW
};
var fnamePrefs = "prefs/prefs.json";
@ -157,6 +158,11 @@ function checkPathForIllegalChars (path) {
case "/": case "_": case "-": case ".": case " ": case "*":
return (false);
}
for (var i = 0; i < pageparkPrefs.legalPathChars.length; i++) { //7/19/15 by DW -- check if they are legal on this server
if (ch == pageparkPrefs.legalPathChars [i]) {
return (false);
}
}
return (true);
}
for (var i = 0; i < path.length; i++) {

Loading…
Cancel
Save