Commit d1240a28 authored by Elliot Pahl's avatar Elliot Pahl Committed by Elliot Pahl
Browse files

Fix bug 2339. JSON encode copyright notice.

parent a392aadc
......@@ -144,6 +144,7 @@ $getstring = quotestrings(array(
// These variables are needed by file.js. They should really be set
// automatically when file.js is included.
$copyright = get_field('site_content', 'content', 'name', 'uploadcopyright');
$copyright = json_encode($copyright);
$wwwroot = get_config('wwwroot');
......@@ -157,7 +158,7 @@ $javascript = <<<EOF
// The file uploader uploads files to the list of blog post attachments
var copyrightnotice = '{$copyright}';
var copyrightnotice = {$copyright};
// The fourth parameter below is just a hack so that the user sees
// "Uploading file to blog post" in the upload status line.
var uploader = new FileUploader('uploader', 'upload.php', null, {$getstring['blogpost']}, false,
......
......@@ -579,10 +579,11 @@ abstract class ArtefactTypeFileBase extends ArtefactType {
}
$copyright = get_field('site_content', 'content', 'name', 'uploadcopyright');
$copyright = json_encode($copyright);
$wwwroot = get_config('wwwroot');
$javascript = <<<JAVASCRIPT
var copyrightnotice = '{$copyright}';
var copyrightnotice = {$copyright};
var browser = new FileBrowser('filelist', '{$wwwroot}artefact/file/myfiles.json.php', null, null, null, null, {$enc_folders});
var uploader = new FileUploader('uploader', '{$wwwroot}artefact/file/upload.php', {}, null, null, browser.refresh, browser.fileexists);
browser.changedircallback = uploader.updatedestination;
......
Supports Markdown
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