introduce new zerobincompatibility option, replacing the base64 one, if it is enabled, delete tokens use sha256; added per paste salt with server salt fallback; this resolves the points 2.2 & 2.9 in #103

This commit is contained in:
El RIDO
2016-07-06 11:37:13 +02:00
parent 6b0b814dc6
commit 0e217a42c5
8 changed files with 87 additions and 38 deletions

View File

@@ -85,6 +85,7 @@ class helper
public static function getPasteWithAttachment($meta = array())
{
$example = self::$paste;
$example['meta']['salt'] = serversalt::generate();
$example['meta'] = array_merge($example['meta'], $meta);
return $example;
}
@@ -97,6 +98,8 @@ class helper
public static function getPasteAsJson($meta = array())
{
$example = self::getPaste();
// the JSON shouldn't contain the salt
unset($example['meta']['salt']);
if (count($meta))
$example['meta'] = $meta;
$example['comments'] = array();