Răsfoiți Sursa

Merge branch 'master' into keyboard-trap

El RIDO 1 an în urmă
părinte
comite
4076a831eb

+ 5 - 4
.github/workflows/tests.yml

@@ -22,11 +22,12 @@ jobs:
     continue-on-error: "${{ matrix.experimental }}"
     continue-on-error: "${{ matrix.experimental }}"
     strategy:
     strategy:
       matrix:
       matrix:
-        php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
+        php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
         experimental: [false]
         experimental: [false]
-        include:
-          - php-versions: '8.4' # development release, things can break
-            experimental: true
+# uncomment this to start testing on development release
+#        include:
+#          - php-versions: '8.5' # development release, things can break
+#            experimental: true
     env:
     env:
       extensions: gd, sqlite3
       extensions: gd, sqlite3
       extensions-cache-key-name: phpextensions
       extensions-cache-key-name: phpextensions

+ 2 - 1
CHANGELOG.md

@@ -6,7 +6,8 @@
 * CHANGED: Switched to WASM streaming and replace unsafe-eval with wasm-unsafe-eval CSP declaration (#1464), requires webserver to have `application/wasm` MIME type configured.
 * CHANGED: Switched to WASM streaming and replace unsafe-eval with wasm-unsafe-eval CSP declaration (#1464), requires webserver to have `application/wasm` MIME type configured.
 * CHANGED: Replaced usage of strpos with str_starts_with & str_contains (#1373)
 * CHANGED: Replaced usage of strpos with str_starts_with & str_contains (#1373)
 * CHANGED: Added polyfill libraries for ctype, str_starts_with & str_contains functions (#1476)
 * CHANGED: Added polyfill libraries for ctype, str_starts_with & str_contains functions (#1476)
-* CHANGED: Upgrading libraries to: cloud-storage 1.44.0, aws-sdk-php 3.331.0
+* CHANGED: Turned paste delete link into a button (#266)
+* CHANGED: Upgrading libraries to: DOMpurify 3.2.3, cloud-storage 1.45.0, aws-sdk-php 3.336.2
 
 
 ## 1.7.5 (2024-11-16)
 ## 1.7.5 (2024-11-16)
 * ADDED: Allow non persistent SQL connections, if configured (#1394)
 * ADDED: Allow non persistent SQL connections, if configured (#1394)

+ 2 - 2
composer.json

@@ -32,8 +32,8 @@
 		"yzalis/identicon": "2.0.0"
 		"yzalis/identicon": "2.0.0"
 	},
 	},
 	"suggest" : {
 	"suggest" : {
-		"google/cloud-storage" : "1.44.0",
-		"aws/aws-sdk-php" : "3.331.0"
+		"google/cloud-storage" : "1.45.0",
+		"aws/aws-sdk-php" : "3.336.2"
 	},
 	},
 	"require-dev" : {
 	"require-dev" : {
 		"phpunit/phpunit" : "^9"
 		"phpunit/phpunit" : "^9"

+ 4 - 4
i18n/de.json

@@ -221,10 +221,10 @@
     "Error compressing paste, due to missing WebAssembly support.": "Fehler beim Komprimieren des Textes, da WebAssembly-Unterstützung fehlt.",
     "Error compressing paste, due to missing WebAssembly support.": "Fehler beim Komprimieren des Textes, da WebAssembly-Unterstützung fehlt.",
     "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Fehler beim Dekomprimieren des Textes. Dein Browser unterstützt WebAssembly nicht. Bitte verwende einen anderen Browser, um diesen Text anzuzeigen.",
     "Error decompressing paste, your browser does not support WebAssembly. Please use another browser to view this paste.": "Fehler beim Dekomprimieren des Textes. Dein Browser unterstützt WebAssembly nicht. Bitte verwende einen anderen Browser, um diesen Text anzuzeigen.",
     "Start over": "Neuen Text erstellen",
     "Start over": "Neuen Text erstellen",
-    "Paste copied to clipboard": "Paste copied to clipboard",
-    "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
-    "Copy link": "Copy link",
-    "Link copied to clipboard": "Link copied to clipboard",
+    "Paste copied to clipboard": "Text wurde in Zwischenablage kopiert.",
+    "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "Zum Kopieren des Textes drücken Sie die Kopieren-Schaltfläche oder verwenden Sie die Tastenkombination <kbd>Strg</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
+    "Copy link": "Verknüpfung kopieren",
+    "Link copied to clipboard": "Verknüpfung wurde in die Zwischenablage kopiert.",
     "Paste text": "Paste text",
     "Paste text": "Paste text",
     "Tabulator key serves as character (Hit <kbd>Ctrl</kbd>+<kbd>m</kbd> or <kbd>Esc</kbd> to toggle)": "Tabulator key serves as character (Hit <kbd>Ctrl</kbd>+<kbd>m</kbd> or <kbd>Esc</kbd> to toggle)"
     "Tabulator key serves as character (Hit <kbd>Ctrl</kbd>+<kbd>m</kbd> or <kbd>Esc</kbd> to toggle)": "Tabulator key serves as character (Hit <kbd>Ctrl</kbd>+<kbd>m</kbd> or <kbd>Esc</kbd> to toggle)"
 }
 }

+ 1 - 1
i18n/fr.json

@@ -223,7 +223,7 @@
     "Start over": "Recommencer",
     "Start over": "Recommencer",
     "Paste copied to clipboard": "Paste copied to clipboard",
     "Paste copied to clipboard": "Paste copied to clipboard",
     "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
     "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>": "To copy paste press on the copy button or use the clipboard shortcut <kbd>Ctrl</kbd>+<kbd>c</kbd>/<kbd>Cmd</kbd>+<kbd>c</kbd>",
-    "Copy link": "Copy link",
+    "Copy link": "Copier le lien",
     "Link copied to clipboard": "Link copied to clipboard",
     "Link copied to clipboard": "Link copied to clipboard",
     "Paste text": "Paste text",
     "Paste text": "Paste text",
     "Tabulator key serves as character (Hit <kbd>Ctrl</kbd>+<kbd>m</kbd> or <kbd>Esc</kbd> to toggle)": "Tabulator key serves as character (Hit <kbd>Ctrl</kbd>+<kbd>m</kbd> or <kbd>Esc</kbd> to toggle)"
     "Tabulator key serves as character (Hit <kbd>Ctrl</kbd>+<kbd>m</kbd> or <kbd>Esc</kbd> to toggle)": "Tabulator key serves as character (Hit <kbd>Ctrl</kbd>+<kbd>m</kbd> or <kbd>Esc</kbd> to toggle)"

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
img/bootstrap-icons.svg


+ 1 - 1
js/common.js

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

+ 2 - 2
js/privatebin.js

@@ -2120,8 +2120,8 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             $pasteUrl.click(pasteLinkClick);
             $pasteUrl.click(pasteLinkClick);
 
 
             // delete link
             // delete link
-            $('#deletelink').html('<a href="' + deleteUrl + '"></a>');
-            I18n._($('#deletelink a').first(), 'Delete data');
+            $('#deletelink').attr('href', deleteUrl);
+            I18n._($('#deletelink span').not('.glyphicon').first(), 'Delete data');
 
 
             // enable shortener button
             // enable shortener button
             $shortenButton.removeClass('buttondisabled');
             $shortenButton.removeClass('buttondisabled');

Fișier diff suprimat deoarece este prea mare
+ 0 - 1
js/purify-3.1.7.js


Fișier diff suprimat deoarece este prea mare
+ 1 - 0
js/purify-3.2.3.js


+ 2 - 2
js/test/PasteStatus.js

@@ -30,11 +30,11 @@ describe('PasteStatus', function () {
                 const expected1 = common.urlToString(url1).replace(/&(gt|lt)$/, '&$1a'),
                 const expected1 = common.urlToString(url1).replace(/&(gt|lt)$/, '&$1a'),
                     expected2 = common.urlToString(url2).replace(/&(gt|lt)$/, '&$1a'),
                     expected2 = common.urlToString(url2).replace(/&(gt|lt)$/, '&$1a'),
                     clean = jsdom();
                     clean = jsdom();
-                $('body').html('<div><div id="deletelink"></div><div id="pastelink"></div></div>');
+                $('body').html('<a href="#" id="deletelink"><span></span></a><div id="pastelink"></div>');
                 $.PrivateBin.PasteStatus.init();
                 $.PrivateBin.PasteStatus.init();
                 $.PrivateBin.PasteStatus.createPasteNotification(expected1, expected2);
                 $.PrivateBin.PasteStatus.createPasteNotification(expected1, expected2);
                 const result1 = $('#pasteurl')[0].href,
                 const result1 = $('#pasteurl')[0].href,
-                    result2 = $('#deletelink a')[0].href;
+                    result2 = $('#deletelink')[0].href;
                 clean();
                 clean();
                 return result1 === expected1 && result2 === expected2;
                 return result1 === expected1 && result2 === expected2;
             }
             }

+ 2 - 2
lib/Configuration.php

@@ -108,8 +108,8 @@ class Configuration
             'js/kjua-0.9.0.js'       => 'sha512-CVn7af+vTMBd9RjoS4QM5fpLFEOtBCoB0zPtaqIDC7sF4F8qgUSRFQQpIyEDGsr6yrjbuOLzdf20tkHHmpaqwQ==',
             'js/kjua-0.9.0.js'       => 'sha512-CVn7af+vTMBd9RjoS4QM5fpLFEOtBCoB0zPtaqIDC7sF4F8qgUSRFQQpIyEDGsr6yrjbuOLzdf20tkHHmpaqwQ==',
             'js/legacy.js'           => 'sha512-UxW/TOZKon83n6dk/09GsYKIyeO5LeBHokxyIq+r7KFS5KMBeIB/EM7NrkVYIezwZBaovnyNtY2d9tKFicRlXg==',
             'js/legacy.js'           => 'sha512-UxW/TOZKon83n6dk/09GsYKIyeO5LeBHokxyIq+r7KFS5KMBeIB/EM7NrkVYIezwZBaovnyNtY2d9tKFicRlXg==',
             'js/prettify.js'         => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==',
             'js/prettify.js'         => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==',
-            'js/privatebin.js'       => 'sha512-y5pDCqVhRdT+tnV0Klp4wfjYPEPz/C31k/16QwaIV3sjQSxQq3mpqMfXlgFzVgxFyRjWQNZHMcik4naNl8rzEw==',
-            'js/purify-3.1.7.js'     => 'sha512-LegvqULiMtOfboJZw9MpETN/b+xnLRXZI90gG7oIFHW+yAeHmKvRtEUbiMFx2WvUqQoL9XB3gwU+hWXUT0X+8A==',
+            'js/privatebin.js'       => 'sha512-K1ruSW69RR4ptss0PgmyPjXW8UnJTyWCQs8cVylQ330AoVL6apWtK3p6vLFHtrHSW6Z1zoA85D6wz1L2JPgKaQ==',
+            'js/purify-3.2.3.js'     => 'sha512-m8Wa/I//YoYMiIahBxDDwYfTnycl+i2DwH58nR8ps1o4KWqXzF8k1K4qHDgAz2HSQFNCNNKH/Qcbfu/jLOuhuQ==',
             'js/rawinflate-0.3.js'   => 'sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==',
             'js/rawinflate-0.3.js'   => 'sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==',
             'js/showdown-2.1.0.js'   => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',
             'js/showdown-2.1.0.js'   => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',
             'js/zlib-1.3.1.js'       => 'sha512-5bU9IIP4PgBrOKLZvGWJD4kgfQrkTz8Z3Iqeu058mbQzW3mCumOU6M3UVbVZU9rrVoVwaW4cZK8U8h5xjF88eQ==',
             'js/zlib-1.3.1.js'       => 'sha512-5bU9IIP4PgBrOKLZvGWJD4kgfQrkTz8Z3Iqeu058mbQzW3mCumOU6M3UVbVZU9rrVoVwaW4cZK8U8h5xjF88eQ==',

+ 10 - 5
tpl/bootstrap.php

@@ -71,7 +71,7 @@ if ($MARKDOWN) :
 <?php
 <?php
 endif;
 endif;
 ?>
 ?>
-		<?php $this->_scriptTag('js/purify-3.1.7.js', 'async'); ?>
+		<?php $this->_scriptTag('js/purify-3.2.3.js', 'async'); ?>
 		<?php $this->_scriptTag('js/legacy.js', 'async'); ?>
 		<?php $this->_scriptTag('js/legacy.js', 'async'); ?>
 		<?php $this->_scriptTag('js/privatebin.js', 'defer'); ?>
 		<?php $this->_scriptTag('js/privatebin.js', 'defer'); ?>
 		<!-- icon -->
 		<!-- icon -->
@@ -535,12 +535,17 @@ if ($HTTPWARNING) :
 endif;
 endif;
 ?>
 ?>
 				<div id="pastesuccess" class="hidden">
 				<div id="pastesuccess" class="hidden">
-					<button id="copyLink" type="button" class="btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
-						<span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Copy link') ?>
-					</button>
+					<div class="nav nav-justified">
+						<button id="copyLink" type="button" class="btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
+							<span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Copy link') ?>
+						</button>
+						<a href="#" id="deletelink" class="btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
+							<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
+							<span></span>
+						</a>
+					</div>
 					<div role="alert" class="alert alert-success">
 					<div role="alert" class="alert alert-success">
 						<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
 						<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
-						<div id="deletelink"></div>
 						<div id="pastelink"></div>
 						<div id="pastelink"></div>
 					</div>
 					</div>
 <?php
 <?php

+ 10 - 5
tpl/bootstrap5.php

@@ -55,7 +55,7 @@ if ($MARKDOWN) :
 <?php
 <?php
 endif;
 endif;
 ?>
 ?>
-		<?php $this->_scriptTag('js/purify-3.1.7.js', 'defer'); ?>
+		<?php $this->_scriptTag('js/purify-3.2.3.js', 'defer'); ?>
 		<?php $this->_scriptTag('js/legacy.js', 'async'); ?>
 		<?php $this->_scriptTag('js/legacy.js', 'async'); ?>
 		<?php $this->_scriptTag('js/privatebin.js', 'defer'); ?>
 		<?php $this->_scriptTag('js/privatebin.js', 'defer'); ?>
 		<!-- icon -->
 		<!-- icon -->
@@ -400,12 +400,17 @@ if ($HTTPWARNING) :
 endif;
 endif;
 ?>
 ?>
 				<div id="pastesuccess" class="hidden">
 				<div id="pastesuccess" class="hidden">
-					<button id="copyLink" type="button" class="btn btn-secondary flex-fill mb-2">
-						<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#copy" /></svg> <?php echo I18n::_('Copy link') ?>
-					</button>
+					<div class="nav justify-content-between mb-2">
+						<button id="copyLink" type="button" class="btn btn-secondary">
+							<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#copy" /></svg> <?php echo I18n::_('Copy link') ?>
+						</button>
+						<a href="#" id="deletelink" class="btn btn-secondary">
+							<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#trash" /></svg>
+							<span></span>
+						</a>
+					</div>
 					<div role="alert" class="alert alert-success">
 					<div role="alert" class="alert alert-success">
 						<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#check" /></svg>
 						<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#check" /></svg>
-						<div id="deletelink"></div>
 						<div id="pastelink"></div>
 						<div id="pastelink"></div>
 					</div>
 					</div>
 <?php
 <?php

+ 1 - 1
tpl/page.php

@@ -49,7 +49,7 @@ if ($MARKDOWN):
 <?php
 <?php
 endif;
 endif;
 ?>
 ?>
-		<?php $this->_scriptTag('js/purify-3.1.7.js', 'async'); ?>
+		<?php $this->_scriptTag('js/purify-3.2.3.js', 'async'); ?>
 		<?php $this->_scriptTag('js/legacy.js', 'async'); ?>
 		<?php $this->_scriptTag('js/legacy.js', 'async'); ?>
 		<?php $this->_scriptTag('js/privatebin.js', 'defer'); ?>
 		<?php $this->_scriptTag('js/privatebin.js', 'defer'); ?>
 		<!-- icon -->
 		<!-- icon -->

+ 2 - 2
vendor/composer/installed.php

@@ -3,7 +3,7 @@
         'name' => 'privatebin/privatebin',
         'name' => 'privatebin/privatebin',
         'pretty_version' => 'dev-master',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => 'dc85a67a037a5de1111d728d4df07ec2b4001bc5',
+        'reference' => '8b7ccb0fd4165f14ce7eab19c9213fb5c3ea7b80',
         'type' => 'project',
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
         'aliases' => array(),
@@ -31,7 +31,7 @@
         'privatebin/privatebin' => array(
         'privatebin/privatebin' => array(
             'pretty_version' => 'dev-master',
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => 'dc85a67a037a5de1111d728d4df07ec2b4001bc5',
+            'reference' => '8b7ccb0fd4165f14ce7eab19c9213fb5c3ea7b80',
             'type' => 'project',
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
             'aliases' => array(),

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff