diff --git a/.eslintrc b/.eslintrc
index 97437c73..e2a42cc7 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -15,7 +15,9 @@ globals:
# http://eslint.org/docs/rules/
rules:
# Possible Errors
- comma-dangle: [2, never]
+ comma-dangle:
+ - error
+ - never
no-cond-assign: 2
no-console: 0
no-constant-condition: 2
@@ -31,7 +33,9 @@ rules:
no-extra-parens: 0
no-extra-semi: 2
no-func-assign: 2
- no-inner-declarations: [2, functions]
+ no-inner-declarations:
+ - error
+ - functions
no-invalid-regexp: 2
no-irregular-whitespace: 2
no-negated-in-lhs: 2
@@ -47,7 +51,9 @@ rules:
# Best Practices
accessor-pairs: 2
block-scoped-var: 0
- complexity: [2, 6]
+ complexity:
+ - error
+ - 20
consistent-return: 0
curly: 0
default-case: 0
@@ -99,7 +105,7 @@ rules:
no-with: 2
radix: 2
vars-on-top: 0
- wrap-iife: 2
+ wrap-iife: 0
yoda: 0
# Strict
@@ -152,7 +158,9 @@ rules:
max-len: 0
max-nested-callbacks: 0
max-params: 0
- max-statements: [2, 30]
+ max-statements:
+ - error
+ - 60
new-cap: 0
new-parens: 0
newline-after-var: 0
diff --git a/.gitignore b/.gitignore
index e476e383..a752f8cc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
# Ignore server files for safety
.htaccess
.htpasswd
+cfg/conf.ini
# Ignore data/
data/
@@ -30,6 +31,7 @@ vendor/**/build_phar.php
# Ignore local node modules, unit testing logs, api docs and eclipse project files
js/node_modules/
tst/log/
+tst/ConfigurationCombinationsTest.php
.settings
.buildpath
.project
diff --git a/.travis.yml b/.travis.yml
index c5e0d074..79987186 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,15 +1,26 @@
language: php
sudo: false
php:
- - 5.5
- - 5.6
- - 7.0
+ - '5.4'
+ - '5.5'
+ - '5.6'
+ - '7.0'
+ - '7.1'
+
+# as this is a php project, node.js v4 (for JS unit testing) isn't installed
+install:
+ - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install 4
before_script:
- composer install -n
+ - npm install -g mocha
+ - cd js
+ - npm install jsverify jsdom jsdom-global
+ - cd ..
script:
- - cd tst && phpunit
+ - cd tst && ../vendor/bin/phpunit
+ - cd ../js && mocha
after_script:
- cd ..
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2dc2e3c7..964d4ee5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,8 +1,10 @@
# PrivateBin version history
* **next (not yet released)**
- * ADDED: Translations for Spanish, Occitan and Norwegian
+ * ADDED: Translations for Spanish, Occitan, Norwegian and Portuguese
* ADDED: Option in configuration to change the default "PrivateBin" title of the site
+ * CHANGED: Minimum required PHP version is 5.4 (#186)
+ * CHANGED: Shipped .htaccess files were updated for Apache 2.4 (#192)
* CHANGED: Cleanup of bootstrap template variants and moved icons to `img` directory
* **1.1 (2016-12-26)**
* ADDED: Translations for Italian and Russian
diff --git a/CREDITS.md b/CREDITS.md
index dfb2d83e..1c7ec3cc 100644
--- a/CREDITS.md
+++ b/CREDITS.md
@@ -35,3 +35,4 @@ Sébastien Sauvage - original idea and main developer
* Alfredo Fabián Altamirano Tena - Spanish
* Quent-in - Occitan
* idarlund - Norwegian
+* Tulio Leao - Portuguese
diff --git a/INSTALL.md b/INSTALL.md
index 5dbc5095..b627bc9e 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -10,7 +10,7 @@ check the options and adjust them as you see fit.
### Requirements
-- PHP version 5.3 or above
+- PHP version 5.4 or above
- _one_ of the following sources of cryptographically safe randomness is required:
- PHP 7 or higher
- [Libsodium](https://download.libsodium.org/libsodium/content/installation/) and it's [PHP extension](https://paragonie.com/book/pecl-libsodium/read/00-intro.md#installing-libsodium)
diff --git a/README.md b/README.md
index 0086f461..a259cb5d 100644
--- a/README.md
+++ b/README.md
@@ -16,10 +16,10 @@ Data is encrypted/decrypted in the browser using 256bit AES in [Galois Counter m
This is a fork of ZeroBin, originally developed by
[Sébastien Sauvage](https://github.com/sebsauvage/ZeroBin). It was refactored
-to allow easier and cleaner extensions and has now much more features than the
+to allow easier and cleaner extensions and has now many more features than the
original. It is however still fully compatible to the original ZeroBin 0.19
data storage scheme. Therefore such installations can be upgraded to this fork
-without loosing any data.
+without losing any data.
## What PrivateBin provides
diff --git a/cfg/.gitignore b/cfg/.gitignore
deleted file mode 100644
index 69db0209..00000000
--- a/cfg/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/conf.ini
diff --git a/cfg/.htaccess b/cfg/.htaccess
index b584d98c..b66e8088 100644
--- a/cfg/.htaccess
+++ b/cfg/.htaccess
@@ -1,2 +1 @@
-Allow from none
-Deny from all
+Require all denied
diff --git a/composer.json b/composer.json
index b92f4629..4248b5f4 100644
--- a/composer.json
+++ b/composer.json
@@ -18,13 +18,14 @@
}
],
"require": {
- "php": "^5.3.0 || ^7.0",
+ "php": "^5.4.0 || ^7.0",
"paragonie/random_compat": "2.0.4",
"yzalis/identicon": "1.1.0"
},
"require-dev": {
"codacy/coverage": "dev-master",
- "codeclimate/php-test-reporter": "dev-master"
+ "codeclimate/php-test-reporter": "dev-master",
+ "phpunit/phpunit": "^4.6 || ^5.0"
},
"autoload": {
"psr-4": {
diff --git a/css/bootstrap/privatebin.css b/css/bootstrap/privatebin.css
index ca447d5d..34a2f471 100644
--- a/css/bootstrap/privatebin.css
+++ b/css/bootstrap/privatebin.css
@@ -17,6 +17,10 @@ body.navbar-spacing {
padding-top: 70px;
}
+body.loading {
+ cursor: wait;
+}
+
.buttondisabled {
opacity: 0.3;
}
@@ -115,6 +119,12 @@ body.navbar-spacing {
border-left: 1px solid #ccc;
padding: 5px 0 5px 10px;
white-space: pre-wrap;
+ transition: background-color 0.75s ease-out;
+}
+
+.comment.highlight {
+ background-color: #ffdd86;
+ transition: background-color 0.2s ease-in;
}
footer h4 {
diff --git a/i18n/de.json b/i18n/de.json
index 5f976daa..19edcbdc 100644
--- a/i18n/de.json
+++ b/i18n/de.json
@@ -7,8 +7,8 @@
"en": "de",
"Paste does not exist, has expired or has been deleted.":
"Diesen Text gibt es nicht, er ist abgelaufen oder wurde gelöscht.",
- "%s requires php 5.3.0 or above to work. Sorry.":
- "%s benötigt PHP 5.3.0 oder höher, um zu funktionieren. Sorry.",
+ "%s requires php %s or above to work. Sorry.":
+ "%s benötigt PHP %s oder höher, um zu funktionieren. Sorry.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s benötigt den Konfigurationsabschnitt [%s] in der Konfigurationsdatei um zu funktionieren.",
"Please wait %d seconds between each post.":
@@ -83,25 +83,25 @@
"Could not decrypt data (Wrong key?)":
"Konnte Daten nicht entschlüsseln (Falscher Schlüssel?)",
"Could not delete the paste, it was not stored in burn after reading mode.":
- "Konnte den Text nicht löschen, er wurde nicht im Einmal-Modus gespeichert.",
+ "Konnte das Paste nicht löschen, es wurde nicht im Einmal-Modus gespeichert.",
"FOR YOUR EYES ONLY. Don't close this window, this message can't be displayed again.":
- "DIESER TEXT IST NUR FÜR DICH GEDACHT. Schliesse das Fenster nicht, diese Nachricht kann nur einmal geöffnet werden.",
+ "DIESER TEXT IST NUR FÜR DICH GEDACHT. Schließe das Fenster nicht, diese Nachricht kann nur einmal geöffnet werden.",
"Could not decrypt comment; Wrong key?":
"Konnte Kommentar nicht entschlüsseln; Falscher Schlüssel?",
"Reply":
"Antworten",
"Anonymous":
"Anonym",
- "Anonymous avatar (Vizhash of the IP address)":
- "Anonymer Avatar (Vizhash der IP-Addresse)",
+ "Avatar generated from IP address":
+ "Avatar (generiert aus der IP-Adresse)",
"Add comment":
"Kommentar hinzufügen",
- "Optional nickname...":
- "Optionales Pseudonym...",
+ "Optional nickname…":
+ "Optionales Pseudonym…",
"Post comment":
"Kommentar absenden",
- "Sending comment...":
- "Sende Kommentar...",
+ "Sending comment…":
+ "Sende Kommentar…",
"Comment posted.":
"Kommentar gesendet.",
"Could not refresh display: %s":
@@ -112,24 +112,25 @@
"Fehler auf dem Server oder keine Antwort vom Server",
"Could not post comment: %s":
"Konnte Kommentar nicht senden: %s",
- "Sending paste (Please move your mouse for more entropy)...":
- "Sende Text (Bitte bewege Deine Maus um die Entropie zu erhöhen)...",
- "Sending paste...":
- "Sende Text...",
+ "Please move your mouse for more entropy…":
+ "Bitte bewege Deine Maus um die Entropie zu erhöhen…",
+ "Sending paste…":
+ "Sende Paste…",
"Your paste is %s(Hit [Ctrl]+[c] to copy)":
- "Dein Text ist unter %s zu finden (Drücke [Strg]+[c] um den Link zu kopieren)",
+ "Dein Paste ist unter %s zu finden (Drücke [Strg]+[c] um den Link zu kopieren)",
"Delete data":
"Lösche Daten",
"Could not create paste: %s":
- "Konnte Text nicht erstellen: %s",
+ "Konnte Paste nicht erstellen: %s",
"Cannot decrypt paste: Decryption key missing in URL (Did you use a redirector or an URL shortener which strips part of the URL?)":
- "Konnte Text nicht entschlüsseln: Der Schlüssel fehlt in der Adresse (Hast du eine Umleitung oder einen URL-Verkürzer benutzt, der Teile der Adresse entfernt?)",
+ "Konnte Paste nicht entschlüsseln: Der Schlüssel fehlt in der Adresse (Hast du eine Umleitung oder einen URL-Verkürzer benutzt, der Teile der Adresse entfernt?)",
"Format": "Format",
"Plain Text": "Nur Text",
"Source Code": "Quellcode",
"Markdown": "Markdown",
"Download attachment": "Anhang herunterladen",
- "Cloned file attached.": "Kopierte Datei angehängt.",
+ "Cloned: '%s'": "Geklont: '%s'",
+ "The cloned file '%s' was attached to this paste.": "Die geklonte Datei '%s' wurde angehängt.",
"Attach a file": "Datei anhängen",
"or drag & drop file": "oder per Drag & Drop einfügen",
"File too large, to display a preview. Please download the attachment.": "Datei zu groß, um als Vorschau angezeigt zu werden. Bitte Anhang herunterladen.",
@@ -148,6 +149,9 @@
"Enter password":
"Passwort eingeben",
"Loading…": "Lädt…",
+ "Decrypting paste…": "Entschlüssle Paste…",
+ "Preparing new paste…": "Bereite neues Paste vor…",
"In case this message never disappears please have a look at this FAQ for information to troubleshoot.":
- "Wenn diese Nachricht nicht mehr verschwindet, schau bitte in die FAQ (englisch), um zu sehen, wie der Fehler behoben werden kann."
+ "Wenn diese Nachricht nicht mehr verschwindet, schau bitte in die FAQ (englisch), um zu sehen, wie der Fehler behoben werden kann.",
+ "+++ no paste text +++": "+++ kein Paste-Text +++"
}
diff --git a/i18n/es.json b/i18n/es.json
index 61b15409..427f90dc 100644
--- a/i18n/es.json
+++ b/i18n/es.json
@@ -7,10 +7,10 @@
"en": "es",
"Paste does not exist, has expired or has been deleted.":
"El texto no existe, ha caducado o ha sido eliminado.",
- "%s requires php 5.3.0 or above to work. Sorry.":
- "%s requiere php 5.3.0 o superior para funcionar. Lo siento.",
+ "%s requires php %s or above to work. Sorry.":
+ "%s requiere php %s o superior para funcionar. Lo siento.",
"%s requires configuration section [%s] to be present in configuration file.":
- "%s requiere que la sección de configuración [% s] esté presente en el archivo de configuración.",
+ "%s requiere que la sección de configuración [%s] esté presente en el archivo de configuración.",
"Please wait %d seconds between each post.":
"Por favor espere %d segundos entre cada publicación.",
"Paste is limited to %s of encrypted data.":
@@ -92,16 +92,16 @@
"Responder",
"Anonymous":
"Anónimo",
- "Anonymous avatar (Vizhash of the IP address)":
+ "Avatar generated from IP address":
"Avatar anónimo (Vizhash de la dirección IP)",
"Add comment":
"Añadir comentario",
- "Optional nickname...":
- "Seudónimo opcional...",
+ "Optional nickname…":
+ "Seudónimo opcional…",
"Post comment":
"Publicar comentario",
- "Sending comment...":
- "Enviando comentario...",
+ "Sending comment…":
+ "Enviando comentario…",
"Comment posted.":
"Comentario publicado.",
"Could not refresh display: %s":
@@ -112,10 +112,10 @@
"Error del servidor o el servidor no responde",
"Could not post comment: %s":
"No fue posible publicar comentario: %s",
- "Sending paste (Please move your mouse for more entropy)...":
- "Enviando texto (Por favor, mueva el ratón para mayor entropía)...",
- "Sending paste...":
- "Enviando texto...",
+ "Please move your mouse for more entropy…":
+ "Por favor, mueva el ratón para mayor entropía…",
+ "Sending paste…":
+ "Enviando texto…",
"Your paste is %s(Hit [Ctrl]+[c] to copy)":
"Su texto está en %s(Presione [Ctrl]+[c] para copiar)",
"Delete data":
@@ -129,7 +129,8 @@
"Source Code": "Código fuente",
"Markdown": "Markdown",
"Download attachment": "Descargar adjunto",
- "Cloned file attached.": "Archivo clonado adjunto.",
+ "Cloned: '%s'": "Clonado: '%s'.",
+ "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
"Attach a file": "Adjuntar archivo",
"Remove attachment": "Remover adjunto",
"Your browser does not support uploading encrypted files. Please use a newer browser.":
@@ -146,6 +147,9 @@
"Enter password":
"Ingrese contraseña",
"Loading…": "Cargando…",
+ "Decrypting paste…": "Decrypting paste…",
+ "Preparing new paste…": "Preparing new paste…",
"In case this message never disappears please have a look at this FAQ for information to troubleshoot.":
- "En caso de que este mensaje nunca desaparezca por favor revise este FAQ para obtener información para solucionar problemas."
+ "En caso de que este mensaje nunca desaparezca por favor revise este FAQ para obtener información para solucionar problemas.",
+ "+++ no paste text +++": "+++ no paste text +++"
}
diff --git a/i18n/fr.json b/i18n/fr.json
index 89a45049..10c36a4e 100644
--- a/i18n/fr.json
+++ b/i18n/fr.json
@@ -7,8 +7,8 @@
"en": "fr",
"Paste does not exist, has expired or has been deleted.":
"Le paste n'existe pas, a expiré, ou a été supprimé.",
- "%s requires php 5.3.0 or above to work. Sorry.":
- "Désolé, %s nécessite php 5.3.0 ou supérieur pour fonctionner.",
+ "%s requires php %s or above to work. Sorry.":
+ "Désolé, %s nécessite php %s ou supérieur pour fonctionner.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s a besoin de la section de configuration [%s] dans le fichier de configuration pour fonctionner.",
"Please wait %d seconds between each post.":
@@ -92,16 +92,16 @@
"Répondre",
"Anonymous":
"Anonyme",
- "Anonymous avatar (Vizhash of the IP address)":
+ "Avatar generated from IP address":
"Avatar anonyme (Vizhash de l'adresse IP)",
"Add comment":
"Ajouter un commentaire",
- "Optional nickname...":
- "Pseudonyme optionnel...",
+ "Optional nickname…":
+ "Pseudonyme optionnel…",
"Post comment":
"Poster le commentaire",
- "Sending comment...":
- "Envoi du commentaire...",
+ "Sending comment…":
+ "Envoi du commentaire…",
"Comment posted.":
"Commentaire posté.",
"Could not refresh display: %s":
@@ -112,10 +112,10 @@
"Le serveur ne répond pas ou a rencontré une erreur",
"Could not post comment: %s":
"Impossible de poster le commentaire : %s",
- "Sending paste (Please move your mouse for more entropy)...":
- "Envoi du paste (Merci de bouger votre souris pour plus d'entropie)...",
- "Sending paste...":
- "Envoi du paste...",
+ "Please move your mouse for more entropy…":
+ "Merci de bouger votre souris pour plus d'entropie…",
+ "Sending paste…":
+ "Envoi du paste…",
"Your paste is %s(Hit [Ctrl]+[c] to copy)":
"Votre paste est disponible à l'adresse %s(Appuyez sur [Ctrl]+[c] pour copier)",
"Delete data":
@@ -138,7 +138,8 @@
"Source Code": "Code source",
"Markdown": "Markdown",
"Download attachment": "Télécharger la pièce jointe",
- "Cloned file attached.": "Cloner le fichier attaché.",
+ "Cloned: '%s'": "Cloner '%s'",
+ "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
"Attach a file": "Attacher un fichier ",
"Remove attachment": "Enlever l'attachement",
"Your browser does not support uploading encrypted files. Please use a newer browser.":
@@ -149,12 +150,15 @@
"Editor": "Éditer",
"Preview": "Prévisualiser",
"%s requires the PATH to end in a \"%s\". Please update the PATH in your index.php.":
- "%s requires the PATH to end in a \"%s\". Please update the PATH in your index.php.",
+ "%s requiert que le PATH se termine dans un \"%s\". Veuillez mettre à jour le PATH dans votre index.php.",
"Decrypt":
- "Decrypt",
+ "Déchiffrer",
"Enter password":
"Entrez le mot de passe",
- "Loading…": "Loading…",
+ "Loading…": "Chargement…",
+ "Decrypting paste…": "Decrypting paste…",
+ "Preparing new paste…": "Preparing new paste…",
"In case this message never disappears please have a look at this FAQ for information to troubleshoot.":
- "In case this message never disappears please have a look at this FAQ for information to troubleshoot (in English)."
+ "Si ce message ne disparaîssait pas, jetez un oeil à cette FAQ pour des idées de résolution (en Anglais).",
+ "+++ no paste text +++": "+++ no paste text +++"
}
diff --git a/i18n/it.json b/i18n/it.json
index 24b79ec9..d7885d70 100644
--- a/i18n/it.json
+++ b/i18n/it.json
@@ -7,8 +7,8 @@
"en": "it",
"Paste does not exist, has expired or has been deleted.":
"Questo messaggio non esiste, è scaduto o è stato cancellato.",
- "%s requires php 5.3.0 or above to work. Sorry.":
- "%s richiede PHP 5.3.0 o superiore.",
+ "%s requires php %s or above to work. Sorry.":
+ "%s richiede php %s o superiore per funzionare. Ci spiace.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s richiede la presenza della sezione [%s] nei file di configurazione.",
"Please wait %d seconds between each post.":
@@ -18,7 +18,7 @@
"Invalid data.":
"Dati non validi.",
"You are unlucky. Try again.":
- "Riprova, sarai più fortunato.",
+ "Ritenta, sarai più fortunato.",
"Error saving comment. Sorry.":
"Errore durante il salvataggio del commento.",
"Error saving paste. Sorry.":
@@ -67,7 +67,7 @@
"Never":
"Mai",
"Note: This is a test service: Data may be deleted anytime. Kittens will die if you abuse this service.":
- "Nota: questo è un servizio di prova, i dati possono essere cancellati in qualsiasi momento. Ti preghiamo di non abusare di questo servizio, grazie.",
+ "Nota: questo è un servizio di prova, i messaggi salvati possono essere cancellati in qualsiasi momento. Moriranno dei gattini se abuserai di questo servizio.",
"This document will expire in %d seconds.":
["Questo documento scadrà tra un secondo.", "Questo documento scadrà in %d secondi."],
"This document will expire in %d minutes.":
@@ -87,41 +87,41 @@
"FOR YOUR EYES ONLY. Don't close this window, this message can't be displayed again.":
"FOR YOUR EYES ONLY. Non chiudere questa finestra, il messaggio non può essere visualizzato una seconda volta.",
"Could not decrypt comment; Wrong key?":
- "Non riesco a decifrari il commento (Chiave errata?)",
+ "Non riesco a decifrare il commento (Chiave errata?)",
"Reply":
"Rispondi",
"Anonymous":
"Anonimo",
- "Anonymous avatar (Vizhash of the IP address)":
- "Avatar Anonino (Vizhash dell'indirizzo IP)",
+ "Avatar generated from IP address":
+ "Avatar generato dall'indirizzo IP)",
"Add comment":
"Aggiungi un commento",
- "Optional nickname...":
- "Nickname opzionale...",
+ "Optional nickname…":
+ "Nickname opzionale…",
"Post comment":
"Invia commento",
- "Sending comment...":
- "Commento in fase di invio...",
+ "Sending comment…":
+ "Commento in fase di invio…",
"Comment posted.":
"Commento inviato.",
"Could not refresh display: %s":
"Non riesco ad aggiornare il display: %s",
"unknown status":
- "errore sconosciuto",
+ "stato sconosciuto",
"server error or not responding":
"errore o mancata risposta dal server",
"Could not post comment: %s":
"Impossibile inviare il commento: %s",
- "Sending paste (Please move your mouse for more entropy)...":
- "Invio messaggio (Muovi il mouse in modo casuale, per generare maggior entropia)...",
- "Sending paste...":
- "Messaggio in fase di invio...",
+ "Please move your mouse for more entropy…":
+ "Muovi il mouse in modo casuale, per generare maggior entropia…",
+ "Sending paste…":
+ "Messaggio in fase di invio…",
"Your paste is %s(Hit [Ctrl]+[c] to copy)":
- "Il tuo messaggio è qui: %s([CTRL | CMD]+[C] per copiare il link)",
+ "Il tuo messaggio è qui: %s(Premi [Ctrl]+[c] (Windows) o [Cmd]+[c] (Mac) per copiare il link)",
"Delete data":
"Cancella i dati",
"Could not create paste: %s":
- "Non rieco a creare il messaggio: %s",
+ "Non riesco a creare il messaggio: %s",
"Cannot decrypt paste: Decryption key missing in URL (Did you use a redirector or an URL shortener which strips part of the URL?)":
"Non riesco a decifrare il messaggio: manca la chiave di decifrazione nell'URL (La chiave è parte integrante dell'URL. Per caso hai usato un Redirector o un altro servizio che ha rimosso una parte dell'URL?)",
"Format": "Formato",
@@ -129,7 +129,8 @@
"Source Code": "Codice Sorgente",
"Markdown": "Markdown",
"Download attachment": "Scarica Allegato",
- "Cloned file attached.": "Copia del file allegata.",
+ "Cloned: '%s'": "Clonato: '%s'",
+ "The cloned file '%s' was attached to this paste.": "Il file clonato '%s' era allegato a questo messaggio.",
"Attach a file": "Allega un file",
"Remove attachment": "Rimuovi allegato",
"Your browser does not support uploading encrypted files. Please use a newer browser.":
@@ -142,10 +143,13 @@
"%s requires the PATH to end in a \"%s\". Please update the PATH in your index.php.":
"%s necessita che PATH termini con \"%s\". Aggiorna la variabile PATH nel tuo index.php.",
"Decrypt":
- "Decrypt",
+ "Decifra",
"Enter password":
"Inserisci la password",
- "Loading…": "Loading…",
+ "Loading…": "Carico…",
+ "Decrypting paste…": "Decifro il messaggio…",
+ "Preparing new paste…": "Preparo il nuovo messaggio…",
"In case this message never disappears please have a look at this FAQ for information to troubleshoot.":
- "In case this message never disappears please have a look at this FAQ for information to troubleshoot (in English)."
+ "Nel caso questo messaggio non scompaia, controlla questa FAQ per trovare informazioni su come risolvere il problema (in Inglese).",
+ "+++ no paste text +++": "+++ nessun testo nel messaggio +++"
}
diff --git a/i18n/no.json b/i18n/no.json
index 1408b811..8292e104 100644
--- a/i18n/no.json
+++ b/i18n/no.json
@@ -7,8 +7,8 @@
"en": "no",
"Paste does not exist, has expired or has been deleted.":
"Innlegget eksisterer ikke, er utløpt eller har blitt slettet.",
- "%s requires php 5.3.0 or above to work. Sorry.":
- "Beklager, %s krever php 5.3.0 eller nyere for å kjøre.",
+ "%s requires php %s or above to work. Sorry.":
+ "Beklager, %s krever php %s eller nyere for å kjøre.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s krever konfigurasjonsdel [%s] å være til stede i konfigurasjonsfilen .",
"Please wait %d seconds between each post.":
@@ -26,13 +26,13 @@
"Invalid paste ID.":
"Feil innlegg ID.",
"Paste is not of burn-after-reading type.":
- "Innlegg er ikke av type slett-etter-lesing.",
+ "Innlegg er ikke av typen slett etter lesing.",
"Wrong deletion token. Paste was not deleted.":
"Feil slettingsnøkkel. Innlegg ble ikke fjernet.",
"Paste was properly deleted.":
"Innlegget er slettet.",
"JavaScript is required for %s to work. Sorry for the inconvenience.":
- "Javascript kreves for at %s skal fungere Beklager ulempene.",
+ "Javascript kreves for at %s skal fungere Beklager.",
"%s requires a modern browser to work.":
"%s krever en moderne nettleser for å fungere.",
"Still using Internet Explorer? Do yourself a favor, switch to a modern browser:":
@@ -83,7 +83,7 @@
"Could not decrypt data (Wrong key?)":
"Kunne ikke dekryptere data (Feil nøkkel?)",
"Could not delete the paste, it was not stored in burn after reading mode.":
- "Kan ikke slette innlegget, det ble ikke lagret i slett-etter-les modus.",
+ "Kan ikke slette innlegget, det ble ikke lagret som 'slett etter les' type.",
"FOR YOUR EYES ONLY. Don't close this window, this message can't be displayed again.":
"KUN FOR DINE ØYNE. Ikke lukk dette vinduet, denne meldingen kan ikke bli vist igjen.",
"Could not decrypt comment; Wrong key?":
@@ -92,30 +92,30 @@
"Svar",
"Anonymous":
"Anonym",
- "Anonymous avatar (Vizhash of the IP address)":
- "Anonym avatar (Vizhash av IP adressen)",
+ "Avatar generated from IP address":
+ "Anonym avatar generert med data fra IP adressen)",
"Add comment":
"Legg til kommentar",
- "Optional nickname...":
- "Valgfritt kallenavn...",
+ "Optional nickname…":
+ "Valgfritt kallenavn…",
"Post comment":
"Send kommentar",
- "Sending comment...":
- "Sender Kommentar...",
+ "Sending comment…":
+ "Sender Kommentar…",
"Comment posted.":
"Kommentar sendt.",
"Could not refresh display: %s":
- "Kunne ikke oppdatere skjermen: %s",
+ "Kunne ikke oppdatere bildet: %s",
"unknown status":
"ukjent status",
"server error or not responding":
- "server feilet eller svarer ikke",
+ "tjener feilet eller svarer ikke",
"Could not post comment: %s":
"Kunne ikke sende kommentar: %s",
- "Sending paste (Please move your mouse for more entropy)...":
- "Sender innlegg (Flytt musen for mere entropi)...",
- "Sending paste...":
- "Sender innlegg...",
+ "Please move your mouse for more entropy…":
+ "Flytt musen for mer entropi…",
+ "Sending paste…":
+ "Sender innlegg…",
"Your paste is %s(Hit [Ctrl]+[c] to copy)":
"Ditt innlegg er %s(Trykk [Ctrl]+[c] for å kopiere)",
"Delete data":
@@ -129,14 +129,15 @@
"Source Code": "Kildekode",
"Markdown": "Oppmerket",
"Download attachment": "Last ned vedlegg",
- "Cloned file attached.": "Kopier vedlegg.",
+ "Cloned: '%s'": "Kopiert: '%s'",
+ "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
"Attach a file": "Legg til fil",
"Remove attachment": "Slett vedlegg",
"Your browser does not support uploading encrypted files. Please use a newer browser.":
"Nettleseren din støtter ikke å laste opp krypterte filer. Vennligst bruk en nyere nettleser.",
"Invalid attachment.": "Ugyldig vedlegg.",
"Options": "Alternativer",
- "Shorten URL": "Adresse-forkorter",
+ "Shorten URL": "Adresse forkorter",
"Editor": "Rediger",
"Preview": "Forhåndsvis",
"%s requires the PATH to end in a \"%s\". Please update the PATH in your index.php.":
@@ -146,6 +147,9 @@
"Enter password":
"Skriv inn passord",
"Loading…": "Laster…",
+ "Decrypting paste…": "Dekrypterer innlegg…",
+ "Preparing new paste…": "Klargjør nytt innlegg…",
"In case this message never disappears please have a look at this FAQ for information to troubleshoot.":
- "Hvis denne meldingen ikke forsvinner kan du ta en titt på siden med ofte stilte spørsmål for informasjon om feilsøking."
+ "Hvis denne meldingen ikke forsvinner kan du ta en titt på siden med ofte stilte spørsmål for informasjon om feilsøking.",
+ "+++ no paste text +++": "+++ ingen innleggstekst +++"
}
diff --git a/i18n/oc.json b/i18n/oc.json
index efbb9b21..90478768 100644
--- a/i18n/oc.json
+++ b/i18n/oc.json
@@ -7,8 +7,8 @@
"en": "oc",
"Paste does not exist, has expired or has been deleted.":
"Lo tèxte existís pas, a expirat, o es estat suprimit.",
- "%s requires php 5.3.0 or above to work. Sorry.":
- "O planhèm, %s necessita php 5.3.0 o superior per foncionar.",
+ "%s requires php %s or above to work. Sorry.":
+ "O planhèm, %s necessita php %s o superior per foncionar.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s fa besonh de la seccion de configuracion [%s] dins lo fichièr de configuracion per foncionar.",
"Please wait %d seconds between each post.":
@@ -92,16 +92,16 @@
"Respondre",
"Anonymous":
"Anonime",
- "Anonymous avatar (Vizhash of the IP address)":
+ "Avatar generated from IP address":
"Avatar anonime (Vizhash de l'adreça IP)",
"Add comment":
"Apondre un comentari",
- "Optional nickname...":
- "Escais opcional...",
+ "Optional nickname…":
+ "Escais opcional…",
"Post comment":
"Mandar lo comentari",
- "Sending comment...":
- "Mandadís del comentari...",
+ "Sending comment…":
+ "Mandadís del comentari…",
"Comment posted.":
"Comentari mandat.",
"Could not refresh display: %s":
@@ -112,10 +112,10 @@
"Lo servidor respond pas o a rencontrat una error",
"Could not post comment: %s":
"Impossible de mandar lo comentari : %s",
- "Sending paste (Please move your mouse for more entropy)...":
- "Mandadís del tèxte (Mercés de bolegar vòstra mirga per mai entropia)...",
- "Sending paste...":
- "Mandadís del tèxte...",
+ "Please move your mouse for more entropy…":
+ "Mercés de bolegar vòstra mirga per mai entropia…",
+ "Sending paste…":
+ "Mandadís del tèxte…",
"Your paste is %s(Hit [Ctrl]+[c] to copy)":
"Vòstre tèxte es disponible a l'adreça %s(Picatz sus [Ctrl]+[c] per copiar)",
"Delete data":
@@ -138,7 +138,8 @@
"Source Code": "Còdi font",
"Markdown": "Markdown",
"Download attachment": "Telecargar la pèça junta",
- "Cloned file attached.": "Clonar lo fichièr junt.",
+ "Cloned: '%s'": "Clonar: '%s'",
+ "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
"Attach a file": "Juntar un fichièr ",
"Remove attachment": "Levar la pèca junta",
"Your browser does not support uploading encrypted files. Please use a newer browser.":
@@ -155,6 +156,9 @@
"Enter password":
"Picatz lo senhal",
"Loading…": "Cargament…",
+ "Decrypting paste…": "Decrypting paste…",
+ "Preparing new paste…": "Preparing new paste…",
"In case this message never disappears please have a look at this FAQ for information to troubleshoot.":
- "Se per cas aqueste messatge quita pas de s'afichar mercés de gaitar aquesta FAQ per las solucions (en Anglés)."
+ "Se per cas aqueste messatge quita pas de s'afichar mercés de gaitar aquesta FAQ per las solucions (en Anglés).",
+ "+++ no paste text +++": "+++ no paste text +++"
}
diff --git a/i18n/pl.json b/i18n/pl.json
index 2757439b..82d9b579 100644
--- a/i18n/pl.json
+++ b/i18n/pl.json
@@ -7,8 +7,8 @@
"en": "pl",
"Paste does not exist, has expired or has been deleted.":
"Wklejka nie istnieje, wygasła albo została usunięta.",
- "%s requires php 5.3.0 or above to work. Sorry.":
- "%s wymaga PHP w wersji 5.3.0 lub nowszej, sorry.",
+ "%s requires php %s or above to work. Sorry.":
+ "%s wymaga PHP w wersji %s lub nowszej, sorry.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s wymaga obecności sekcji [%s] w pliku konfiguracyjnym.",
"Please wait %d seconds between each post.":
@@ -92,16 +92,16 @@
"Odpowiedz",
"Anonymous":
"Anonim",
- "Anonymous avatar (Vizhash of the IP address)":
+ "Avatar generated from IP address":
"Anonimowy avatar (Vizhash z adresu IP)",
"Add comment":
"Dodaj komentarz",
- "Optional nickname...":
- "Opcjonalny nick...",
+ "Optional nickname…":
+ "Opcjonalny nick…",
"Post comment":
"Wyślij komentarz",
- "Sending comment...":
- "Wysyłanie komentarza...",
+ "Sending comment…":
+ "Wysyłanie komentarza…",
"Comment posted.":
"Wysłano komentarz.",
"Could not refresh display: %s":
@@ -112,10 +112,10 @@
"bląd serwera lub brak odpowiedzi",
"Could not post comment: %s":
"Nie udało się wysłać komentarza: %s",
- "Sending paste (Please move your mouse for more entropy)...":
- "Wysyłanie wklejki (proszę poruszać myszą aby uzyskać większą entropię)...",
- "Sending paste...":
- "Wysyłanie wklejki...",
+ "Please move your mouse for more entropy…":
+ "Proszę poruszać myszą aby uzyskać większą entropię…",
+ "Sending paste…":
+ "Wysyłanie wklejki…",
"Your paste is %s(Hit [Ctrl]+[c] to copy)":
"Twoja wklejka to %s(wciśnij [Ctrl]+[c] aby skopiować)",
"Delete data":
@@ -129,7 +129,8 @@
"Source Code": "Kod źródłowy",
"Markdown": "Markdown",
"Download attachment": "Pobierz załącznik",
- "Cloned file attached.": "Sklonowano załączony plik.",
+ "Cloned: '%s'": "Sklonowano: '%s'",
+ "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
"Attach a file": "Załącz plik",
"Remove attachment": "Usuń załącznik",
"Your browser does not support uploading encrypted files. Please use a newer browser.":
@@ -146,6 +147,9 @@
"Enter password":
"Wpisz hasło",
"Loading…": "Loading…",
+ "Decrypting paste…": "Decrypting paste…",
+ "Preparing new paste…": "Preparing new paste…",
"In case this message never disappears please have a look at this FAQ for information to troubleshoot.":
- "In case this message never disappears please have a look at this FAQ for information to troubleshoot (in English)."
+ "In case this message never disappears please have a look at this FAQ for information to troubleshoot (in English).",
+ "+++ no paste text +++": "+++ no paste text +++"
}
diff --git a/i18n/pt.json b/i18n/pt.json
new file mode 100644
index 00000000..05ce23d1
--- /dev/null
+++ b/i18n/pt.json
@@ -0,0 +1,155 @@
+{
+ "PrivateBin": "PrivateBin",
+ "%s 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 bits AES. More information on the project page.":
+ "%s é um serviço minimalista e de código aberto do tipo \"pastebin\", em que o servidor tem zero conhecimento dos dados copiados. Os dados são cifrados e decifrados no navegador usando 256 bits AES. Mais informações na página do projeto.",
+ "Because ignorance is bliss":
+ "Porque a ignorância é uma benção",
+ "en": "pt",
+ "Paste does not exist, has expired or has been deleted.":
+ "A cópia não existe, expirou ou já foi excluída.",
+ "%s requires php %s or above to work. Sorry.":
+ "%s requer php %s ou superior para funcionar. Desculpa.",
+ "%s requires configuration section [%s] to be present in configuration file.":
+ "%s requer que a seção de configuração [% s] esteja no arquivo de configuração.",
+ "Please wait %d seconds between each post.":
+ "Por favor espere %d segundos entre cada publicação.",
+ "Paste is limited to %s of encrypted data.":
+ "A cópia está limitada a %s de dados cifrados.",
+ "Invalid data.":
+ "Dados inválidos.",
+ "You are unlucky. Try again.":
+ "Você é azarado. Tente novamente",
+ "Error saving comment. Sorry.":
+ "Erro ao salvar comentário. Desculpa.",
+ "Error saving paste. Sorry.":
+ "Erro ao salvar cópia. Desculpa.",
+ "Invalid paste ID.":
+ "ID de cópia inválido.",
+ "Paste is not of burn-after-reading type.":
+ "Cópia não é do tipo \"queime após ler\".",
+ "Wrong deletion token. Paste was not deleted.":
+ "Token de remoção inválido. A cópia não foi excluída.",
+ "Paste was properly deleted.":
+ "A cópia foi devidamente excluída.",
+ "JavaScript is required for %s to work. Sorry for the inconvenience.":
+ "JavaScript é necessário para que %s funcione. Pedimos desculpas pela inconveniência.",
+ "%s requires a modern browser to work.":
+ "%s requer um navegador moderno para funcionar.",
+ "Still using Internet Explorer? Do yourself a favor, switch to a modern browser:":
+ "Ainda usando Internet Explorer? Faça-se um favor, mude para um navegador moderno:",
+ "New":
+ "Novo",
+ "Send":
+ "Enviar",
+ "Clone":
+ "Clonar",
+ "Raw text":
+ "Texto sem formato",
+ "Expires":
+ "Expirar em",
+ "Burn after reading":
+ "Queime após ler",
+ "Open discussion":
+ "Discussão aberta",
+ "Password (recommended)":
+ "Senha (recomendada)",
+ "Discussion":
+ "Discussão",
+ "Toggle navigation":
+ "Mudar navegação",
+ "%d seconds": ["%d segundo", "%d segundos"],
+ "%d minutes": ["%d minuto", "%d minutos"],
+ "%d hours": ["%d hora", "%d horas"],
+ "%d days": ["%d dia", "%d dias"],
+ "%d weeks": ["%d semana", "%d semanas"],
+ "%d months": ["%d mês", "%d meses"],
+ "%d years": ["%d ano", "%d anos"],
+ "Never":
+ "Nunca",
+ "Note: This is a test service: Data may be deleted anytime. Kittens will die if you abuse this service.":
+ "Nota: Este é um serviço de teste. Dados podem ser perdidos a qualquer momento. Gatinhos morrerão se você abusar desse serviço.",
+ "This document will expire in %d seconds.":
+ ["Este documento irá expirar em um segundo.", "Este documento irá expirar em %d segundos."],
+ "This document will expire in %d minutes.":
+ ["Este documento irá expirar em um minuto.", "Este documento irá expirar em %d minutos."],
+ "This document will expire in %d hours.":
+ ["Este documento irá expirar em uma hora.", "Este documento irá expirar em %d horas."],
+ "This document will expire in %d days.":
+ ["Este documento irá expirar em um dia.", "Este documento irá expirar em %d dias."],
+ "This document will expire in %d months.":
+ ["Este documento irá expirar em um mês.", "Este documento irá expirar em %d meses."],
+ "Please enter the password for this paste:":
+ "Por favor, digite a senha para essa cópia:",
+ "Could not decrypt data (Wrong key?)":
+ "Não foi possível decifrar os dados (Chave errada?)",
+ "Could not delete the paste, it was not stored in burn after reading mode.":
+ "Não foi possível excluir a cópia, ela não foi salva no modo de \"queime após ler\".",
+ "FOR YOUR EYES ONLY. Don't close this window, this message can't be displayed again.":
+ "APENAS PARA SEUS OLHOS. Não feche essa janela, essa mensagem não pode ser exibida novamente.",
+ "Could not decrypt comment; Wrong key?":
+ "Não foi possível decifrar o comentário; Chave errada?",
+ "Reply":
+ "Responder",
+ "Anonymous":
+ "Anônimo",
+ "Avatar generated from IP address":
+ "Avatar gerado à partir do endereço IP",
+ "Add comment":
+ "Adicionar comentário",
+ "Optional nickname…":
+ "Apelido opcional…",
+ "Post comment":
+ "Publicar comentário",
+ "Sending comment…":
+ "Enviando comentário…",
+ "Comment posted.":
+ "Comentário publicado.",
+ "Could not refresh display: %s":
+ "Não foi possível atualizar a tela: %s",
+ "unknown status":
+ "Estado desconhecido",
+ "server error or not responding":
+ "Servidor em erro ou não responsivo",
+ "Could not post comment: %s":
+ "Não foi possível publicar o comentário: %s",
+ "Please move your mouse for more entropy…":
+ "Por favor, mova o mouse para maior entropia…",
+ "Sending paste…":
+ "Enviando cópia…",
+ "Your paste is %s(Hit [Ctrl]+[c] to copy)":
+ "Sua cópia é %s(Pressione [Ctrl]+[c] para copiar)",
+ "Delete data":
+ "Excluir dados",
+ "Could not create paste: %s":
+ "Não foi possível criar cópia: %s",
+ "Cannot decrypt paste: Decryption key missing in URL (Did you use a redirector or an URL shortener which strips part of the URL?)":
+ "Não foi possível decifrar a cópia: chave de decriptografia ausente na URL (Você utilizou um redirecionador ou encurtador de URL que removeu parte dela?)",
+ "Format": "Formato",
+ "Plain Text": "Texto sem formato",
+ "Source Code": "Código fonte",
+ "Markdown": "Markdown",
+ "Download attachment": "Baixar anexo",
+ "Cloned: '%s'": "Clonado: '%s'",
+ "The cloned file '%s' was attached to this paste.": "O arquivo clonado '%s' foi anexado a essa cópia.",
+ "Attach a file": "Anexar um arquivo",
+ "Remove attachment": "Remover anexo",
+ "Your browser does not support uploading encrypted files. Please use a newer browser.":
+ "Seu navegador não permite subir arquivos cifrados. Por favor, utilize um navegador mais recente.",
+ "Invalid attachment.": "Anexo inválido.",
+ "Options": "Opções",
+ "Shorten URL": "Encurtar URL",
+ "Editor": "Editor",
+ "Preview": "Visualizar",
+ "%s requires the PATH to end in a \"%s\". Please update the PATH in your index.php.":
+ "%s requer que o PATH termine em \"%s\". Por favor, atualize o PATH em seu index.php.",
+ "Decrypt":
+ "Decifrar",
+ "Enter password":
+ "Digite a senha",
+ "Loading…": "Carregando…",
+ "Decrypting paste…": "Decifrando cópia…",
+ "Preparing new paste…": "Preparando nova cópia…",
+ "In case this message never disappears please have a look at this FAQ for information to troubleshoot.":
+ "Caso essa mensagem nunca desapareça, por favor veja este FAQ para saber como resolver os problemas.",
+ "+++ no paste text +++": "+++ sem texto de cópia +++"
+}
diff --git a/i18n/ru.json b/i18n/ru.json
index de7ad051..da462c38 100644
--- a/i18n/ru.json
+++ b/i18n/ru.json
@@ -7,8 +7,8 @@
"en": "ru",
"Paste does not exist, has expired or has been deleted.":
"Запись не существует, просрочена или была удалена.",
- "%s requires php 5.3.0 or above to work. Sorry.":
- "Для работы %s требуется PHP 5.3.0 или выше. Извините.",
+ "%s requires php %s or above to work. Sorry.":
+ "Для работы %s требуется php %s или выше. Извините.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s необходимо наличие секции [%s] в конфигурационном файле.",
"Please wait %d seconds between each post.":
@@ -32,7 +32,7 @@
"Paste was properly deleted.":
"Запись была успешно удалена.",
"JavaScript is required for %s to work. Sorry for the inconvenience.":
- "Для работы %s требуется включенный JavaScript. Приносим извинения за неудобства..",
+ "Для работы %s требуется включенный JavaScript. Приносим извинения за неудобства.",
"%s requires a modern browser to work.":
"Для работы %s требуется более современный браузер.",
"Still using Internet Explorer? Do yourself a favor, switch to a modern browser:":
@@ -92,30 +92,30 @@
"Ответить",
"Anonymous":
"Аноним",
- "Anonymous avatar (Vizhash of the IP address)":
- "Анонимный аватар (Vizhash IP адреса)",
+ "Avatar generated from IP address":
+ "Аватар, сгенерированный из IP-адреса",
"Add comment":
"Добавить комментарий",
- "Optional nickname...":
- "Опциональный никнейм...",
+ "Optional nickname…":
+ "Опциональный никнейм…",
"Post comment":
"Отправить комментарий",
- "Sending comment...":
- "Отправка комментария...",
+ "Sending comment…":
+ "Отправка комментария…",
"Comment posted.":
"Комментарий опубликован.",
"Could not refresh display: %s":
- "Невозможно обновить данные: %s",
+ "Не удалось обновить отображение: %s",
"unknown status":
"неизвестная причина",
"server error or not responding":
"ошибка сервера или нет ответа",
"Could not post comment: %s":
"Не удалось опубликовать комментарий: %s",
- "Sending paste (Please move your mouse for more entropy)...":
- "Отправка записи (Пожалуйста двигайте мышкой для большей энтропии)...",
- "Sending paste...":
- "Отправка записи...",
+ "Please move your mouse for more entropy…":
+ "Пожалуйста двигайте мышкой для большей энтропии…",
+ "Sending paste…":
+ "Отправка записи…",
"Your paste is %s(Hit [Ctrl]+[c] to copy)":
"Ссылка на запись %s(Нажмите [Ctrl]+[c] чтобы скопировать ссылку)",
"Delete data":
@@ -138,7 +138,9 @@
"Source Code": "Исходный код",
"Markdown": "Язык разметки",
"Download attachment": "Скачать прикрепленный файл",
- "Cloned file attached.": "Дубль файла прикреплен.",
+ "Cloned: '%s'": "Дублировано: '%s'",
+ "The cloned file '%s' was attached to this paste.":
+ "Дубликат файла '%s' был прикреплен к этой записи.",
"Attach a file": "Прикрепить файл",
"Remove attachment": "Удалить вложение",
"Your browser does not support uploading encrypted files. Please use a newer browser.":
@@ -154,6 +156,10 @@
"Расшифровать",
"Enter password":
"Введите пароль",
- "Uploading paste… Please wait.":
- "Отправка записи... Пожалуйста подождите."
+ "Loading…": "Загрузка…",
+ "Decrypting paste…": "Расшифровка записи…",
+ "Preparing new paste…": "Подготовка новой записи…",
+ "In case this message never disappears please have a look at this FAQ for information to troubleshoot.":
+ "Если данное сообщение не исчезает длительное время, посмотрите этот FAQ с информацией о возможном решении проблемы (на английском).",
+ "+++ no paste text +++": "+++ в записи нет текста +++"
}
diff --git a/i18n/sl.json b/i18n/sl.json
index 4cf3d5a1..21db8c1d 100644
--- a/i18n/sl.json
+++ b/i18n/sl.json
@@ -7,8 +7,8 @@
"en": "sl",
"Paste does not exist, has expired or has been deleted.":
"Prilepek ne obstaja, mu je potekla življenjska doba, ali pa je izbrisan.",
- "%s requires php 5.3.0 or above to work. Sorry.":
- "Oprosti, %s za delovanje potrebuje vsaj php 5.3.0.",
+ "%s requires php %s or above to work. Sorry.":
+ "Oprosti, %s za delovanje potrebuje vsaj php %s.",
"%s requires configuration section [%s] to be present in configuration file.":
"%s potrebuje sekcijo konfiguracij [%s] v konfiguracijski datoteki.",
"Please wait %d seconds between each post.":
@@ -92,16 +92,16 @@
"Odgovori",
"Anonymous":
"Aninomno",
- "Anonymous avatar (Vizhash of the IP address)":
+ "Avatar generated from IP address":
"Anonimen avatar (Vizhash IP naslova)",
"Add comment":
"Dodaj komentar",
- "Optional nickname...":
+ "Optional nickname…":
"Uporabniško ime (lahko izpustiš)",
"Post comment":
"Objavi komentar",
- "Sending comment...":
- "Pošiljam komentar ...",
+ "Sending comment…":
+ "Pošiljam komentar …",
"Comment posted.":
"Komentar poslan.",
"Could not refresh display: %s":
@@ -112,10 +112,10 @@
"napaka na strežniku, ali pa se strežnik ne odziva",
"Could not post comment: %s":
"Komentarja ni bilo mogoče objaviti : %s",
- "Sending paste (Please move your mouse for more entropy)...":
- "Pošiljam prilepek (prosim premakni svojo miško za več entropije) ...",
- "Sending paste...":
- "Pošiljam prilepek...",
+ "Please move your mouse for more entropy…":
+ "Prosim premakni svojo miško za več entropije…",
+ "Sending paste…":
+ "Pošiljam prilepek…",
"Your paste is %s(Hit [Ctrl]+[c] to copy)":
"Tvoj prilepek je dostopen na naslovu: %s(Pritisni [Ctrl]+[c] ali [Cmd] + [c] in skopiraj)",
"Delete data":
@@ -138,7 +138,8 @@
"Source Code": "Odprta koda",
"Markdown": "Markdown",
"Download attachment": "Pretoči priponko",
- "Cloned file attached.": "Pripeta datoteka klonirana",
+ "Cloned: '%s'": "'%s' klonirana",
+ "The cloned file '%s' was attached to this paste.": "The cloned file '%s' was attached to this paste.",
"Attach a file": "Pripni datoteko",
"Remove attachment": "Odstrani priponko",
"Your browser does not support uploading encrypted files. Please use a newer browser.":
@@ -155,6 +156,9 @@
"Enter password":
"Prosim vnesi geslo",
"Loading…": "Loading…",
+ "Decrypting paste…": "Decrypting paste…",
+ "Preparing new paste…": "Preparing new paste…",
"In case this message never disappears please have a look at this FAQ for information to troubleshoot.":
- "In case this message never disappears please have a look at this FAQ for information to troubleshoot (in English)."
+ "In case this message never disappears please have a look at this FAQ for information to troubleshoot (in English).",
+ "+++ no paste text +++": "+++ no paste text +++"
}
diff --git a/i18n/zh.json b/i18n/zh.json
index a1a9b960..5fcaf3db 100644
--- a/i18n/zh.json
+++ b/i18n/zh.json
@@ -7,8 +7,8 @@
"en": "zh",
"Paste does not exist, has expired or has been deleted.":
"粘贴不存在,已过期或者已被删除。",
- "%s requires php 5.3.0 or above to work. Sorry.":
- "%s需要工作于PHP 5.3.0及以上版本,抱歉。",
+ "%s requires php %s or above to work. Sorry.":
+ "%s需要工作于PHP %s及以上版本,抱歉。",
"%s requires configuration section [%s] to be present in configuration file.":
"%s需要设置配置文件中 [%s] 的部分。",
"Please wait %d seconds between each post.":
@@ -92,16 +92,16 @@
"回复",
"Anonymous":
"匿名",
- "Anonymous avatar (Vizhash of the IP address)":
- "匿名头像 (由IP地址生成Vizhash)",
+ "Avatar generated from IP address":
+ "由IP生成的头像",
"Add comment":
"添加评论",
- "Optional nickname...":
- "可选昵称...",
+ "Optional nickname…":
+ "可选昵称…",
"Post comment":
"评论",
- "Sending comment...":
- "评论发送中...",
+ "Sending comment…":
+ "评论发送中…",
"Comment posted.":
"评论已发送。",
"Could not refresh display: %s":
@@ -112,10 +112,10 @@
"服务器错误或无回应",
"Could not post comment: %s":
"无法发送评论: %s",
- "Sending paste (Please move your mouse for more entropy)...":
- "粘贴提交中 (请移动鼠标以产生更多熵)...",
- "Sending paste...":
- "粘贴提交中...",
+ "Please move your mouse for more entropy…":
+ "请移动鼠标增加随机性…",
+ "Sending paste…":
+ "粘贴提交中…",
"Your paste is %s(Hit [Ctrl]+[c] to copy)":
"您的粘贴的链接是%s(按下 [Ctrl]+[c] 以复制)",
"Delete data":
@@ -129,7 +129,8 @@
"Source Code": "源代码",
"Markdown": "Markdown",
"Download attachment": "下载附件",
- "Cloned file attached.": "已附加克隆的文件",
+ "Cloned: '%s'": "克隆: '%s'",
+ "The cloned file '%s' was attached to this paste.": "克隆文件 '%s' 已附加到此粘贴。",
"Attach a file": "添加一个附件",
"Remove attachment": "移除附件",
"Your browser does not support uploading encrypted files. Please use a newer browser.":
@@ -137,15 +138,18 @@
"Invalid attachment.": "无效的附件",
"Options": "选项",
"Shorten URL": "缩短链接",
- "Editor": "編輯",
- "Preview": "預習",
+ "Editor": "编辑",
+ "Preview": "预览",
"%s requires the PATH to end in a \"%s\". Please update the PATH in your index.php.":
- "%s requires the PATH to end in a \"%s\". Please update the PATH in your index.php.",
+ "%s 的 PATH 变量必须结束于 \"%s\"。 请修改你的 index.php 中的 PATH 变量。",
"Decrypt":
- "Decrypt",
+ "解密",
"Enter password":
- "Enter password",
- "Loading…": "Loading…",
+ "输入密码",
+ "Loading…": "载入中…",
+ "Decrypting paste…": "正在解密",
+ "Preparing new paste…": "正在准备新的粘贴",
"In case this message never disappears please have a look at this FAQ for information to troubleshoot.":
- "In case this message never disappears please have a look at this FAQ for information to troubleshoot (in English)."
+ "如果这个消息一直不消失,请参考 这里的 FAQ 进行故障排除 (英文版)。",
+ "+++ no paste text +++": "+++ 没有粘贴内容 +++"
}
diff --git a/js/privatebin.js b/js/privatebin.js
index 8533f737..65d81878 100644
--- a/js/privatebin.js
+++ b/js/privatebin.js
@@ -11,7 +11,6 @@
* @namespace
*/
-'use strict';
/** global: Base64 */
/** global: FileReader */
/** global: RawDeflate */
@@ -25,23 +24,62 @@
// Immediately start random number generator collector.
sjcl.random.startCollectors();
+// main application start, called when DOM is fully loaded
+jQuery(document).ready(function() {
+ // run main controller
+ $.PrivateBin.Controller.init();
+});
+
jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
+ 'use strict';
+
/**
- * static helper methods
+ * static Helper methods
*
- * @name helper
+ * @name Helper
* @class
*/
- var helper = {
+ var Helper = (function () {
+ var me = {};
+
+ /**
+ * character to HTML entity lookup table
+ *
+ * @see {@link https://github.com/janl/mustache.js/blob/master/mustache.js#L60}
+ * @name Helper.entityMap
+ * @private
+ * @enum {Object}
+ * @readonly
+ */
+ var entityMap = {
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ "'": ''',
+ '/': '/',
+ '`': '`',
+ '=': '='
+ };
+
+ /**
+ * cache for script location
+ *
+ * @name Helper.baseUri
+ * @private
+ * @enum {string|null}
+ */
+ var baseUri = null;
+
/**
* converts a duration (in seconds) into human friendly approximation
*
- * @name helper.secondsToHuman
+ * @name Helper.secondsToHuman
* @function
* @param {number} seconds
* @return {Array}
*/
- secondsToHuman: function(seconds)
+ me.secondsToHuman = function(seconds)
{
var v;
if (seconds < 60)
@@ -67,84 +105,68 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
}
v = Math.floor(seconds / (60 * 60 * 24 * 30));
return [v, 'month'];
- },
+ }
+
+ /**
+ * checks if a string is valid text (and not onyl whitespace)
+ *
+ * @name Helper.isValidText
+ * @function
+ * @param {string} string
+ * @return {bool}
+ */
+ me.isValidText = function(string)
+ {
+ return (string.length > 0 && $.trim(string) !== '')
+ }
/**
* text range selection
*
* @see {@link https://stackoverflow.com/questions/985272/jquery-selecting-text-in-an-element-akin-to-highlighting-with-your-mouse}
- * @name helper.selectText
+ * @name Helper.selectText
* @function
- * @param {string} element - Indentifier of the element to select (id="")
+ * @param {HTMLElement} element
*/
- selectText: function(element)
+ me.selectText = function(element)
{
- var doc = document,
- text = doc.getElementById(element),
- range,
- selection;
+ var range, selection;
// MS
- if (doc.body.createTextRange)
- {
- range = doc.body.createTextRange();
- range.moveToElementText(text);
+ if (document.body.createTextRange) {
+ range = document.body.createTextRange();
+ range.moveToElementText(element);
range.select();
- }
- // all others
- else if (window.getSelection)
- {
+ } else if (window.getSelection){
selection = window.getSelection();
- range = doc.createRange();
- range.selectNodeContents(text);
+ range = document.createRange();
+ range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);
}
- },
+ }
/**
- * set text of a DOM element (required for IE),
- * this is equivalent to element.text(text)
+ * set text of a jQuery element (required for IE),
*
- * @name helper.setElementText
+ * @name Helper.setElementText
* @function
- * @param {Object} element - a DOM element
+ * @param {jQuery} $element - a jQuery element
* @param {string} text - the text to enter
*/
- setElementText: function(element, text)
+ me.setElementText = function($element, text)
{
// For IE<10: Doesn't support white-space:pre-wrap; so we have to do this...
if ($('#oldienotice').is(':visible')) {
- var html = this.htmlEntities(text).replace(/\n/ig, '\r\n ');
- element.html('
' + html + '
');
+ var html = me.htmlEntities(text).replace(/\n/ig, '\r\n ');
+ $element.html('
' + html + '
');
}
// for other (sane) browsers:
else
{
- element.text(text);
+ $element.text(text);
}
- },
-
- /**
- * replace last child of element with message
- *
- * @name helper.setMessage
- * @function
- * @param {Object} element - a jQuery wrapped DOM element
- * @param {string} message - the message to append
- */
- setMessage: function(element, message)
- {
- var content = element.contents();
- if (content.length > 0)
- {
- content[content.length - 1].nodeValue = ' ' + message;
- }
- else
- {
- this.setElementText(element, message);
- }
- },
+ }
/**
* convert URLs to clickable links.
@@ -155,81 +177,75 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
* http://user:example.com@localhost:8800/zero/?6f09182b8ea51997#WtLEUO5Epj9UHAV9JFs+6pUQZp13TuspAUjnF+iM+dM=
*
*
- * @name helper.urls2links
+ * @name Helper.urls2links
* @function
- * @param {Object} element - a jQuery DOM element
+ * @param {Object} $element - a jQuery DOM element
*/
- urls2links: function(element)
+ me.urls2links = function($element)
{
var markup = '$1';
- element.html(
- element.html().replace(
- /((http|https|ftp):\/\/[\w?=&.\/-;#@~%+-]+(?![\w\s?&.\/;#~%"=-]*>))/ig,
+ $element.html(
+ $element.html().replace(
+ /((http|https|ftp):\/\/[\w?=&.\/-;#@~%+*-]+(?![\w\s?&.\/;#~%"=-]*>))/ig,
markup
)
);
- element.html(
- element.html().replace(
- /((magnet):[\w?=&.\/-;#@~%+-]+)/ig,
+ $element.html(
+ $element.html().replace(
+ /((magnet):[\w?=&.\/-;#@~%+*-]+)/ig,
markup
)
);
- },
+ }
/**
* minimal sprintf emulation for %s and %d formats
*
+ * Note that this function needs the parameters in the same order as the
+ * format strings appear in the string, contrary to the original.
+ *
* @see {@link https://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format#4795914}
- * @name helper.sprintf
+ * @name Helper.sprintf
* @function
* @param {string} format
* @param {...*} args - one or multiple parameters injected into format string
* @return {string}
*/
- sprintf: function()
+ me.sprintf = function()
{
- var args = arguments;
- if (typeof arguments[0] === 'object')
- {
- args = arguments[0];
- }
+ var args = Array.prototype.slice.call(arguments);
var format = args[0],
i = 1;
- return format.replace(/%((%)|s|d)/g, function (m) {
+ return format.replace(/%(s|d)/g, function (m) {
// m is the matched format, e.g. %s, %d
- var val;
- if (m[2]) {
- val = m[2];
- } else {
- val = args[i];
- // A switch statement so that the formatter can be extended.
- switch (m)
- {
- case '%d':
- val = parseFloat(val);
- if (isNaN(val)) {
- val = 0;
- }
- break;
- default:
- // Default is %s
- }
- ++i;
+ var val = args[i];
+ // A switch statement so that the formatter can be extended.
+ switch (m)
+ {
+ case '%d':
+ val = parseFloat(val);
+ if (isNaN(val)) {
+ val = 0;
+ }
+ break;
+ default:
+ // Default is %s
}
+ ++i;
return val;
});
- },
+ }
/**
* get value of cookie, if it was set, empty string otherwise
*
* @see {@link http://www.w3schools.com/js/js_cookies.asp}
- * @name helper.getCookie
+ * @name Helper.getCookie
* @function
- * @param {string} cname
+ * @param {string} cname - may not be empty
* @return {string}
*/
- getCookie: function(cname) {
+ me.getCookie = function(cname) {
var name = cname + '=',
ca = document.cookie.split(';');
for (var i = 0; i < ca.length; ++i) {
@@ -244,375 +260,236 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
}
}
return '';
- },
+ }
/**
- * get the current script location (without search or hash part of the URL),
+ * get the current location (without search or hash part of the URL),
* eg. http://example.com/path/?aaaa#bbbb --> http://example.com/path/
*
- * @name helper.scriptLocation
+ * @name Helper.baseUri
* @function
- * @return {string} current script location
+ * @return {string}
*/
- scriptLocation: function()
+ me.baseUri = function()
{
- var scriptLocation = window.location.href.substring(
- 0,
- window.location.href.length - window.location.search.length - window.location.hash.length
- ),
- hashIndex = scriptLocation.indexOf('?');
- if (hashIndex !== -1)
- {
- scriptLocation = scriptLocation.substring(0, hashIndex);
- }
- return scriptLocation;
- },
-
- /**
- * get the pastes unique identifier from the URL,
- * eg. http://example.com/path/?c05354954c49a487#c05354954c49a487 returns c05354954c49a487
- *
- * @name helper.pasteId
- * @function
- * @return {string} unique identifier
- */
- pasteId: function()
- {
- return window.location.search.substring(1);
- },
-
- /**
- * return the deciphering key stored in anchor part of the URL
- *
- * @name helper.pageKey
- * @function
- * @return {string} key
- */
- pageKey: function()
- {
- var key = window.location.hash.substring(1),
- i = key.indexOf('&');
-
- // Some web 2.0 services and redirectors add data AFTER the anchor
- // (such as &utm_source=...). We will strip any additional data.
- if (i > -1)
- {
- key = key.substring(0, i);
+ // check for cached version
+ if (baseUri !== null) {
+ return baseUri;
}
- return key;
- },
+ baseUri = window.location.origin + window.location.pathname;
+ return baseUri;
+ }
/**
* convert all applicable characters to HTML entities
*
* @see {@link https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content}
- * @name helper.htmlEntities
+ * @name Helper.htmlEntities
* @function
* @param {string} str
* @return {string} escaped HTML
*/
- htmlEntities: function(str) {
+ me.htmlEntities = function(str) {
return String(str).replace(
/[&<>"'`=\/]/g, function(s) {
- return helper.entityMap[s];
+ return entityMap[s];
});
- },
+ }
/**
- * character to HTML entity lookup table
+ * resets state, used for unit testing
*
- * @see {@link https://github.com/janl/mustache.js/blob/master/mustache.js#L60}
- * @name helper.entityMap
- * @enum {Object}
+ * @name Helper.reset
+ * @function
+ */
+ me.reset = function()
+ {
+ baseUri = null;
+ }
+
+ return me;
+ })();
+
+ /**
+ * internationalization module
+ *
+ * @name I18n
+ * @param {object} window
+ * @param {object} document
+ * @class
+ */
+ var I18n = (function (window, document) {
+ var me = {};
+
+ /**
+ * const for string of loaded language
+ *
+ * @name I18n.languageLoadedEvent
+ * @private
+ * @prop {string}
* @readonly
*/
- entityMap: {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": ''',
- '/': '/',
- '`': '`',
- '=': '='
- }
- };
+ var languageLoadedEvent = 'languageLoaded';
- /**
- * static attachment helper methods
- *
- * @name helper
- * @class
- */
- var attachmentHelpers = {
- attachmentData: undefined,
- file: undefined,
-
- /*
- * Read file data as dataURL using the FileReader API
- * https://developer.mozilla.org/en-US/docs/Web/API/FileReader#readAsDataURL()
- */
- readFileData: function (file) {
- if (typeof FileReader === undefined) {
- // revert loading status…
- this.stateNewPaste();
- this.showError(i18n._('Your browser does not support uploading encrypted files. Please use a newer browser.'));
- return;
- }
-
- var fileReader = new FileReader();
- if (file === undefined) {
- file = controller.fileInput[0].files[0];
- $('#dragAndDropFileName').text('');
- } else {
- $('#dragAndDropFileName').text(file.name);
- }
-
- attachmentHelpers.file = file;
-
- fileReader.onload = function (event) {
- var dataURL = event.target.result;
- attachmentHelpers.attachmentData = dataURL;
-
- if (controller.messagePreview.parent().hasClass('active')) {
- attachmentHelpers.handleFilePreviews(controller.attachmentPreview, dataURL);
- }
- };
- fileReader.readAsDataURL(file);
- },
-
- /**
- * Handle the preview of files.
- * @argument {DOM Element} targetElement where the preview should be appended.
- * @argument {File Data} data of the file to be displayed.
- */
- handleFilePreviews: function (targetElement, data) {
- if (data) {
- var mimeType = this.getMimeTypeFromDataURL(data);
-
- if (mimeType.match(/image\//i)) {
- this.showImagePreview(targetElement, data);
- } else if (mimeType.match(/video\//i)) {
- this.showVideoPreview(targetElement, data, mimeType);
- } else if (mimeType.match(/audio\//i)) {
- this.showAudioPreview(targetElement, data, mimeType);
- } else if (mimeType.match(/\/pdf/i)) {
- this.showPDFPreview(targetElement, data);
- }
- //else {
- //console.log("file but no image/video/audio/pdf");
- //}
- }
- },
-
- /**
- * Get Mime Type from a DataURL
- *
- * @param {type} dataURL
- * @returns Mime Type from a dataURL as obtained for a file using the FileReader API https://developer.mozilla.org/en-US/docs/Web/API/FileReader#readAsDataURL()
- */
- getMimeTypeFromDataURL: function (dataURL) {
- return dataURL.slice(dataURL.indexOf('data:') + 5, dataURL.indexOf(';base64,'));
- },
-
- showImagePreview: function (targetElement, image) {
- targetElement.html(
- $(document.createElement('img'))
- .attr('src', image)
- .attr('class', 'img-thumbnail')
- );
- targetElement.removeClass('hidden');
- },
-
- showVideoPreview: function (targetElement, video, mimeType) {
- var videoPlayer = $(document.createElement('video'))
- .attr('controls', 'true')
- .attr('autoplay', 'true')
- .attr('loop', 'true')
- .attr('class', 'img-thumbnail');
-
- videoPlayer.append($(document.createElement('source'))
- .attr('type', mimeType)
- .attr('src', video));
- targetElement.html(videoPlayer);
- targetElement.removeClass('hidden');
- },
-
- showAudioPreview: function (targetElement, audio, mimeType) {
- var audioPlayer = $(document.createElement('audio'))
- .attr('controls', 'true')
- .attr('autoplay', 'true');
-
- audioPlayer.append($(document.createElement('source'))
- .attr('type', mimeType)
- .attr('src', audio));
- targetElement.html(audioPlayer);
- targetElement.removeClass('hidden');
- },
-
- showPDFPreview: function (targetElement, pdf) {
- //PDFs are only displayed if the filesize is smaller than about 1MB (after base64 encoding).
- //Bigger filesizes currently cause crashes in various browsers.
- //See also: https://code.google.com/p/chromium/issues/detail?id=69227
-
- //Firefox crashes with files that are about 1.5MB
- //The performance with 1MB files is bareable
- if (pdf.length < 1398488) {
-
- //Fallback for browsers, that don't support the vh unit
- var clientHeight = $(window).height();
-
- targetElement.html(
- $(document.createElement('embed'))
- .attr('src', pdf)
- .attr('type', 'application/pdf')
- .attr('class', 'pdfPreview')
- .css('height', clientHeight)
- );
- targetElement.removeClass('hidden');
- } else {
- controller.showError(i18n._('File too large, to display a preview. Please download the attachment.'));
- }
- },
-
- addDragDropHandler: function () {
- var fileInput = controller.fileInput;
-
- if (fileInput.length === 0) {
- return;
- }
-
- function ignoreDragDrop(event) {
- event.stopPropagation();
- event.preventDefault();
- }
-
- function drop(event) {
- event.stopPropagation();
- event.preventDefault();
-
- if (fileInput) {
- var file = event.dataTransfer.files[0];
- //Clear the file input:
- fileInput.wrap('').html(html);
+ ids.forEach(function(item, i) {
+ var id = item.join(''),
+ element = elements.find('#' + id).first();
+ $.PrivateBin.Helper.setElementText(element, replacingContent);
+ result *= replacingContent === element.text();
+ });
+ return Boolean(result);
+ }
+ );
+ });
+
+ describe('urls2links', function () {
+ after(function () {
+ cleanup();
+ });
+
+ jsc.property(
+ 'ignores non-URL content',
+ 'string',
+ function (content) {
+ var element = $('
]*id="errormessage"[^>]*>.*Paste does not exist[^<]*
#',
+ '#
]*id="errormessage"[^>]*>.*Paste does not exist, has expired or has been deleted\.#s',
$content,
'outputs error correctly'
);
@@ -798,7 +795,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
- '#
]*id="errormessage"[^>]*>.*Paste does not exist[^<]*
#',
+ '#
]*id="errormessage"[^>]*>.*Paste does not exist, has expired or has been deleted\.#s',
$content,
'outputs error correctly'
);
@@ -818,10 +815,10 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
unset($burnPaste['meta']['salt']);
- $this->assertContains(
- '
]*id="errormessage"[^>]*>.*Paste does not exist[^<]*
#',
+ '#
]*id="errormessage"[^>]*>.*Paste does not exist, has expired or has been deleted\.#s',
$content,
'outputs delete error correctly'
);
@@ -1000,7 +997,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
- '#
]*id="errormessage"[^>]*>.*Paste does not exist[^<]*
#',
+ '#
]*id="errormessage"[^>]*>.*Paste does not exist, has expired or has been deleted\.#s',
$content,
'outputs error correctly'
);
@@ -1091,7 +1088,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
- '#
]*id="status"[^>]*>.*Paste was properly deleted[^<]*
#s',
+ '#
]*id="status"[^>]*>.*Paste was properly deleted\.#s',
$content,
'outputs deleted status correctly'
);
diff --git a/tst/RequestTest.php b/tst/RequestTest.php
index f20209f5..29b0dade 100644
--- a/tst/RequestTest.php
+++ b/tst/RequestTest.php
@@ -63,6 +63,7 @@ class RequestTest extends PHPUnit_Framework_TestCase
file_put_contents($file, 'data=foo');
Request::setInputStream($file);
$request = new Request;
+ unlink($file);
$this->assertTrue($request->isJsonApiCall(), 'is JSON Api call');
$this->assertEquals('create', $request->getOperation());
$this->assertEquals('foo', $request->getParam('data'));
diff --git a/tst/SjclTest.php b/tst/SjclTest.php
index 54cc30fc..a9d947ec 100644
--- a/tst/SjclTest.php
+++ b/tst/SjclTest.php
@@ -1,11 +1,13 @@
assertTrue(Sjcl::isValid($paste['data']), 'valid sjcl');
$this->assertTrue(Sjcl::isValid($paste['attachment']), 'valid sjcl');
diff --git a/tst/ViewTest.php b/tst/ViewTest.php
index 7d3c727a..e2e014b4 100644
--- a/tst/ViewTest.php
+++ b/tst/ViewTest.php
@@ -96,15 +96,15 @@ class ViewTest extends PHPUnit_Framework_TestCase
public function testTemplateRendersCorrectly()
{
foreach ($this->_content as $template => $content) {
- $this->assertContains(
- '