Merge remote-tracking branch 'upstream/master' into copy_to_clipboard_btn

# Conflicts:
#	i18n/ar.json
#	i18n/bg.json
#	i18n/ca.json
#	i18n/co.json
#	i18n/cs.json
#	i18n/de.json
#	i18n/el.json
#	i18n/en.json
#	i18n/es.json
#	i18n/et.json
#	i18n/fi.json
#	i18n/fr.json
#	i18n/he.json
#	i18n/hi.json
#	i18n/hu.json
#	i18n/id.json
#	i18n/it.json
#	i18n/ja.json
#	i18n/jbo.json
#	i18n/ko.json
#	i18n/ku.json
#	i18n/la.json
#	i18n/lt.json
#	i18n/nl.json
#	i18n/no.json
#	i18n/oc.json
#	i18n/pl.json
#	i18n/pt.json
#	i18n/ro.json
#	i18n/ru.json
#	i18n/sk.json
#	i18n/sl.json
#	i18n/sv.json
#	i18n/th.json
#	i18n/tr.json
#	i18n/uk.json
#	i18n/zh.json
#	lib/Configuration.php
This commit is contained in:
ribas160 2024-12-29 22:19:35 +02:00
commit a6a7df9a72
76 changed files with 591 additions and 551 deletions

View file

@ -17,7 +17,7 @@ require('./prettify');
global.prettyPrint = window.PR.prettyPrint;
global.prettyPrintOne = window.PR.prettyPrintOne;
global.showdown = require('./showdown-2.1.0');
global.DOMPurify = require('./purify-3.1.6');
global.DOMPurify = require('./purify-3.1.7');
global.baseX = require('./base-x-4.0.0').baseX;
global.Legacy = require('./legacy').Legacy;
require('./bootstrap-3.4.1');

View file

@ -6,7 +6,6 @@
* @see {@link https://github.com/PrivateBin/PrivateBin}
* @copyright 2012 Sébastien SAUVAGE ({@link http://sebsauvage.net})
* @license {@link https://www.opensource.org/licenses/zlib-license.php The zlib/libpng License}
* @version 1.3.1
* @name Legacy
* @namespace
*/
@ -175,18 +174,6 @@
)) {
return true;
}
// async & ES6 support
try {
eval('async () => {}');
} catch (e) {
if (e instanceof SyntaxError) {
return true;
} else {
throw e; // throws CSP error
}
}
return false;
}
@ -238,7 +225,7 @@
{
return init;
};
/**
* returns the current status of the check
*
@ -250,7 +237,7 @@
{
return status;
};
/**
* init on application start, returns an all-clear signal
*
@ -308,4 +295,4 @@
this.Legacy = {
Check: Check
};
}).call(this);
}).call(this);

8
js/package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "privatebin",
"version": "1.7.4",
"version": "1.7.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "privatebin",
"version": "1.7.4",
"version": "1.7.5",
"license": "zlib-acknowledgement",
"devDependencies": {
"@peculiar/webcrypto": "^1.1.1",
@ -49,7 +49,7 @@
"@peculiar/json-schema": "^1.1.12",
"pvtsutils": "^1.3.2",
"tslib": "^2.4.0",
"webcrypto-core": "^1.7.4"
"webcrypto-core": "^1.7.5"
},
"engines": {
"node": ">=10.12.0"
@ -1012,7 +1012,7 @@
"@peculiar/json-schema": "^1.1.12",
"pvtsutils": "^1.3.2",
"tslib": "^2.4.0",
"webcrypto-core": "^1.7.4"
"webcrypto-core": "^1.7.5"
}
},
"abab": {

View file

@ -1,6 +1,6 @@
{
"name": "privatebin",
"version": "1.7.4",
"version": "1.7.5",
"description": "PrivateBin is a minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using 256 bit AES in Galois Counter mode (GCM).",
"main": "privatebin.js",
"directories": {

View file

@ -3988,7 +3988,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
}
emailBody += I18n._('Link:');
emailBody += EOL;
emailBody += $('#pasteurl').attr('href'); // might have been shortened
emailBody += $('#pasteurl').attr('href') || window.location.href; // href is tried first as it might have been shortened
return emailBody;
}
@ -5763,8 +5763,11 @@ jQuery.PrivateBin = (function($, RawDeflate) {
me.initZ();
// if delete token is passed (i.e. paste has been deleted by this
// access), there is nothing more to do
// access), add an event listener for the 'new' paste button in the alert
if (Model.hasDeleteToken()) {
$("#new-from-alert").on("click", function () {
UiHelper.reloadHome();
});
return;
}

File diff suppressed because one or more lines are too long

2
js/purify-3.1.7.js Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
'use strict';
(function() {
(function () {
let ret;
async function initialize() {
@ -23,16 +23,7 @@
_abort: errno => { console.error(`Error: ${errno}`) },
_grow: () => { },
};
let buff;
if (typeof fs === 'object') {
buff = fs.readFileSync('zlib-1.3.1.wasm');
} else {
const resp = await fetch('js/zlib-1.3.1.wasm');
buff = await resp.arrayBuffer();
}
const module = await WebAssembly.compile(buff);
const ins = await WebAssembly.instantiate(module, { env });
const ins = (await WebAssembly.instantiateStreaming(fetch('js/zlib-1.3.1.wasm'), { env })).instance;
const srcPtr = ins.exports._malloc(CHUNK_SIZE);
const dstPtr = ins.exports._malloc(CHUNK_SIZE);
@ -116,28 +107,28 @@
}
ret = {
inflate(rawDeflateBuffer) {
const rawInf = new RawInf();
for (let offset = 0; offset < rawDeflateBuffer.length; offset += CHUNK_SIZE) {
const end = Math.min(offset + CHUNK_SIZE, rawDeflateBuffer.length);
const chunk = rawDeflateBuffer.subarray(offset, end);
rawInf.inflate(chunk);
}
const ret = rawInf.getBuffer();
rawInf.destroy();
return ret;
},
deflate(rawInflateBuffer) {
const rawDef = new RawDef();
for (let offset = 0; offset < rawInflateBuffer.length; offset += CHUNK_SIZE) {
const end = Math.min(offset + CHUNK_SIZE, rawInflateBuffer.length);
const chunk = rawInflateBuffer.subarray(offset, end);
rawDef.deflate(chunk, rawInflateBuffer.length <= offset + CHUNK_SIZE);
}
const ret = rawDef.getBuffer();
rawDef.destroy();
return ret;
},
inflate(rawDeflateBuffer) {
const rawInf = new RawInf();
for (let offset = 0; offset < rawDeflateBuffer.length; offset += CHUNK_SIZE) {
const end = Math.min(offset + CHUNK_SIZE, rawDeflateBuffer.length);
const chunk = rawDeflateBuffer.subarray(offset, end);
rawInf.inflate(chunk);
}
const ret = rawInf.getBuffer();
rawInf.destroy();
return ret;
},
deflate(rawInflateBuffer) {
const rawDef = new RawDef();
for (let offset = 0; offset < rawInflateBuffer.length; offset += CHUNK_SIZE) {
const end = Math.min(offset + CHUNK_SIZE, rawInflateBuffer.length);
const chunk = rawInflateBuffer.subarray(offset, end);
rawDef.deflate(chunk, rawInflateBuffer.length <= offset + CHUNK_SIZE);
}
const ret = rawDef.getBuffer();
rawDef.destroy();
return ret;
},
}
return ret;