diff options
author | Andreas Fischer <bantu@owncloud.com> | 2014-04-15 15:44:44 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2014-04-15 15:44:44 +0200 |
commit | bd37010f354b8bfcba578b44558fca2035df1923 (patch) | |
tree | f7c2177bd9587281b2238868cd056b12db14d367 /lib | |
parent | 9cc41a24603b250b9c657edfc7007bf10e795899 (diff) | |
parent | 2eeab60378a3e22e19c4f435aa2bf65cc9da7c2a (diff) | |
download | nextcloud-server-bd37010f354b8bfcba578b44558fca2035df1923.tar.gz nextcloud-server-bd37010f354b8bfcba578b44558fca2035df1923.zip |
Merge remote-tracking branch 'owncloud/master' into db-convert-tool
* owncloud/master: (61 commits)
[tx-robot] updated from transifex
Make email display name change translatable again
Ignore jquery.multiselect.js - it's 3rdparty
javascript code cleanup + fixing syntax errors
Revert "close-button for share_dropdown"
close-button for share_dropdown
[tx-robot] updated from transifex
The latest developer manual link
The latest developer manual link
p() and print_unescaped() also take arrays as parameter
Check whether the user has permissions to add personal storage backends
[tx-robot] updated from transifex
Fix a wrong WebDAV Warning with self-signed-certs
fix translation link
upda mailinglist address
fix contribute link
default to GET request when no method is set to fix unittests, also set parsed json parameters on the post attribute
Correctly process request parameters other than GET or POST, dont use globals in the class but inject it
[tx-robot] updated from transifex
use references for middleware to fix problems on 5.3
...
Diffstat (limited to 'lib')
66 files changed, 485 insertions, 230 deletions
diff --git a/lib/l10n/ar.php b/lib/l10n/ar.php index 6287a53d619..c8b51a3bb7e 100644 --- a/lib/l10n/ar.php +++ b/lib/l10n/ar.php @@ -56,6 +56,8 @@ $TRANSLATIONS = array( "last month" => "الشهر الماضي", "_%n month ago_::_%n months ago_" => array("","","","","",""), "last year" => "السنةالماضية", -"years ago" => "سنة مضت" +"years ago" => "سنة مضت", +"A valid username must be provided" => "يجب ادخال اسم مستخدم صحيح", +"A valid password must be provided" => "يجب ادخال كلمة مرور صحيحة" ); $PLURAL_FORMS = "nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;"; diff --git a/lib/l10n/ast.php b/lib/l10n/ast.php index 6b76d8126ee..93a20beb5d4 100644 --- a/lib/l10n/ast.php +++ b/lib/l10n/ast.php @@ -2,8 +2,16 @@ $TRANSLATIONS = array( "Personal" => "Personal", "Settings" => "Axustes", +"Users" => "Usuarios", +"Failed to upgrade \"%s\"." => "Fallu al anovar \"%s\".", +"Invalid image" => "Imaxe inválida", +"Application is not enabled" => "L'aplicación nun ta habilitada", "Files" => "Ficheros", "Text" => "Testu", +"Images" => "Imaxes", +"Set an admin username." => "Afitar nome d'usuariu p'almin", +"Set an admin password." => "Afitar contraseña p'almin", +"Could not find category \"%s\"" => "Nun pudo alcontrase la estaya \"%s.\"", "seconds ago" => "fai segundos", "_%n minute ago_::_%n minutes ago_" => array("","fai %n minutos"), "_%n hour ago_::_%n hours ago_" => array("","fai %n hores"), diff --git a/lib/l10n/ca.php b/lib/l10n/ca.php index 88bb8ec9eee..477cdf2925b 100644 --- a/lib/l10n/ca.php +++ b/lib/l10n/ca.php @@ -66,6 +66,9 @@ $TRANSLATIONS = array( "last month" => "el mes passat", "_%n month ago_::_%n months ago_" => array("fa %n mes","fa %n mesos"), "last year" => "l'any passat", -"years ago" => "anys enrere" +"years ago" => "anys enrere", +"A valid username must be provided" => "Heu de facilitar un nom d'usuari vàlid", +"A valid password must be provided" => "Heu de facilitar una contrasenya vàlida", +"The username is already being used" => "El nom d'usuari ja està en ús" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/cs_CZ.php b/lib/l10n/cs_CZ.php index 6b5c8441ca1..d535b97f631 100644 --- a/lib/l10n/cs_CZ.php +++ b/lib/l10n/cs_CZ.php @@ -66,6 +66,9 @@ $TRANSLATIONS = array( "last month" => "minulý měsíc", "_%n month ago_::_%n months ago_" => array("před %n měsícem","před %n měsíci","před %n měsíci"), "last year" => "minulý rok", -"years ago" => "před lety" +"years ago" => "před lety", +"A valid username must be provided" => "Musíte zadat platné uživatelské jméno", +"A valid password must be provided" => "Musíte zadat platné heslo", +"The username is already being used" => "Uživatelské jméno je již využíváno" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/lib/l10n/da.php b/lib/l10n/da.php index c3166000727..3be45001030 100644 --- a/lib/l10n/da.php +++ b/lib/l10n/da.php @@ -66,6 +66,8 @@ $TRANSLATIONS = array( "last month" => "sidste måned", "_%n month ago_::_%n months ago_" => array("%n måned siden","%n måneder siden"), "last year" => "sidste år", -"years ago" => "år siden" +"years ago" => "år siden", +"A valid username must be provided" => "Et gyldigt brugernavn skal angives", +"A valid password must be provided" => "En gyldig adgangskode skal angives" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/de.php b/lib/l10n/de.php index d644582b91e..297cc57bde7 100644 --- a/lib/l10n/de.php +++ b/lib/l10n/de.php @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "Letzten Monat", "_%n month ago_::_%n months ago_" => array("Vor %n Monat","Vor %n Monaten"), "last year" => "Letztes Jahr", -"years ago" => "Vor Jahren" +"years ago" => "Vor Jahren", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Folgende Zeichen sind im Benutzernamen erlaubt: \"a-z\", \"A-Z\", \"0-9\" und \"_.@-\"", +"A valid username must be provided" => "Es muss ein gültiger Benutzername angegeben werden", +"A valid password must be provided" => "Es muss ein gültiges Passwort angegeben werden", +"The username is already being used" => "Dieser Benutzername existiert bereits" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/de_CH.php b/lib/l10n/de_CH.php index fe1a519ccf7..e034cc3c209 100644 --- a/lib/l10n/de_CH.php +++ b/lib/l10n/de_CH.php @@ -47,6 +47,8 @@ $TRANSLATIONS = array( "last month" => "Letzten Monat", "_%n month ago_::_%n months ago_" => array("","Vor %n Monaten"), "last year" => "Letztes Jahr", -"years ago" => "Vor Jahren" +"years ago" => "Vor Jahren", +"A valid username must be provided" => "Es muss ein gültiger Benutzername angegeben werden", +"A valid password must be provided" => "Es muss ein gültiges Passwort angegeben werden" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/de_DE.php b/lib/l10n/de_DE.php index 85ed7e5c80a..d0a4a9b1c6e 100644 --- a/lib/l10n/de_DE.php +++ b/lib/l10n/de_DE.php @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "Letzten Monat", "_%n month ago_::_%n months ago_" => array("Vor %n Monat","Vor %n Monaten"), "last year" => "Letztes Jahr", -"years ago" => "Vor Jahren" +"years ago" => "Vor Jahren", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Folgende Zeichen sind im Benutzernamen erlaubt: \"a-z\", \"A-Z\", \"0-9\" und \"_.@-\"", +"A valid username must be provided" => "Es muss ein gültiger Benutzername angegeben werden", +"A valid password must be provided" => "Es muss ein gültiges Passwort angegeben werden", +"The username is already being used" => "Der Benutzername existiert bereits" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/el.php b/lib/l10n/el.php index a169ae38649..244cc50b847 100644 --- a/lib/l10n/el.php +++ b/lib/l10n/el.php @@ -66,6 +66,8 @@ $TRANSLATIONS = array( "last month" => "τελευταίο μήνα", "_%n month ago_::_%n months ago_" => array("","%n μήνες πριν"), "last year" => "τελευταίο χρόνο", -"years ago" => "χρόνια πριν" +"years ago" => "χρόνια πριν", +"A valid username must be provided" => "Πρέπει να δοθεί έγκυρο όνομα χρήστη", +"A valid password must be provided" => "Πρέπει να δοθεί έγκυρο συνθηματικό" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/en_GB.php b/lib/l10n/en_GB.php index 7d2246eb66b..e1c49392bd8 100644 --- a/lib/l10n/en_GB.php +++ b/lib/l10n/en_GB.php @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "last month", "_%n month ago_::_%n months ago_" => array("%n month ago","%n months ago"), "last year" => "last year", -"years ago" => "years ago" +"years ago" => "years ago", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"", +"A valid username must be provided" => "A valid username must be provided", +"A valid password must be provided" => "A valid password must be provided", +"The username is already being used" => "The username is already being used" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/es.php b/lib/l10n/es.php index 14d6435c891..c01239cca7a 100644 --- a/lib/l10n/es.php +++ b/lib/l10n/es.php @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "mes pasado", "_%n month ago_::_%n months ago_" => array("Hace %n mes","Hace %n meses"), "last year" => "año pasado", -"years ago" => "hace años" +"years ago" => "hace años", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Solo los siguientes caracteres están permitidos en un nombre de usuario: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"", +"A valid username must be provided" => "Se debe proporcionar un nombre de usuario válido", +"A valid password must be provided" => "Se debe proporcionar una contraseña válida", +"The username is already being used" => "El nombre de usuario ya está en uso" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/es_AR.php b/lib/l10n/es_AR.php index a925e22ba88..34775b16b22 100644 --- a/lib/l10n/es_AR.php +++ b/lib/l10n/es_AR.php @@ -60,6 +60,8 @@ $TRANSLATIONS = array( "last month" => "el mes pasado", "_%n month ago_::_%n months ago_" => array("Hace %n mes","Hace %n meses"), "last year" => "el año pasado", -"years ago" => "años atrás" +"years ago" => "años atrás", +"A valid username must be provided" => "Debe ingresar un nombre de usuario válido", +"A valid password must be provided" => "Debe ingresar una contraseña válida" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/es_MX.php b/lib/l10n/es_MX.php index 2f0ed33f6b3..befb076b7de 100644 --- a/lib/l10n/es_MX.php +++ b/lib/l10n/es_MX.php @@ -60,6 +60,8 @@ $TRANSLATIONS = array( "last month" => "mes pasado", "_%n month ago_::_%n months ago_" => array("Hace %n mes","Hace %n meses"), "last year" => "año pasado", -"years ago" => "hace años" +"years ago" => "hace años", +"A valid username must be provided" => "Se debe proporcionar un nombre de usuario válido", +"A valid password must be provided" => "Se debe proporcionar una contraseña válida" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/et_EE.php b/lib/l10n/et_EE.php index 7d8cc0f4b49..883c7323c0c 100644 --- a/lib/l10n/et_EE.php +++ b/lib/l10n/et_EE.php @@ -66,6 +66,9 @@ $TRANSLATIONS = array( "last month" => "viimasel kuul", "_%n month ago_::_%n months ago_" => array("","%n kuud tagasi"), "last year" => "viimasel aastal", -"years ago" => "aastat tagasi" +"years ago" => "aastat tagasi", +"A valid username must be provided" => "Sisesta nõuetele vastav kasutajatunnus", +"A valid password must be provided" => "Sisesta nõuetele vastav parool", +"The username is already being used" => "Kasutajanimi on juba kasutuses" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/eu.php b/lib/l10n/eu.php index 58c198cff14..7a8a11f5b32 100644 --- a/lib/l10n/eu.php +++ b/lib/l10n/eu.php @@ -60,6 +60,9 @@ $TRANSLATIONS = array( "last month" => "joan den hilabetean", "_%n month ago_::_%n months ago_" => array("orain dela hilabete %n","orain dela %n hilabete"), "last year" => "joan den urtean", -"years ago" => "urte" +"years ago" => "urte", +"A valid username must be provided" => "Baliozko erabiltzaile izena eman behar da", +"A valid password must be provided" => "Baliozko pasahitza eman behar da", +"The username is already being used" => "Erabiltzaile izena dagoeneko erabiltzen ari da" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/fa.php b/lib/l10n/fa.php index 7323ffe1918..c1c16cf94b4 100644 --- a/lib/l10n/fa.php +++ b/lib/l10n/fa.php @@ -42,6 +42,8 @@ $TRANSLATIONS = array( "last month" => "ماه قبل", "_%n month ago_::_%n months ago_" => array(""), "last year" => "سال قبل", -"years ago" => "سالهای قبل" +"years ago" => "سالهای قبل", +"A valid username must be provided" => "نام کاربری صحیح باید وارد شود", +"A valid password must be provided" => "رمز عبور صحیح باید وارد شود" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/fi_FI.php b/lib/l10n/fi_FI.php index 018e4c04c4f..13e97e1b677 100644 --- a/lib/l10n/fi_FI.php +++ b/lib/l10n/fi_FI.php @@ -59,6 +59,10 @@ $TRANSLATIONS = array( "last month" => "viime kuussa", "_%n month ago_::_%n months ago_" => array("%n kuukausi sitten","%n kuukautta sitten"), "last year" => "viime vuonna", -"years ago" => "vuotta sitten" +"years ago" => "vuotta sitten", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Vain seuraavat merkit ovat sallittuja käyttäjätunnuksessa: \"a-z\", \"A-Z\", \"0-9\" ja \"_.@-\"", +"A valid username must be provided" => "Anna kelvollinen käyttäjätunnus", +"A valid password must be provided" => "Anna kelvollinen salasana", +"The username is already being used" => "Käyttäjätunnus on jo käytössä" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/fr.php b/lib/l10n/fr.php index d866fb664ee..b13970c610d 100644 --- a/lib/l10n/fr.php +++ b/lib/l10n/fr.php @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "le mois dernier", "_%n month ago_::_%n months ago_" => array("","Il y a %n mois"), "last year" => "l'année dernière", -"years ago" => "il y a plusieurs années" +"years ago" => "il y a plusieurs années", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Seuls les caractères suivants sont autorisés dans un nom d'utilisateur : \"a-z\", \"A-Z\", \"0-9\", et \"_.@-\"", +"A valid username must be provided" => "Un nom d'utilisateur valide doit être saisi", +"A valid password must be provided" => "Un mot de passe valide doit être saisi", +"The username is already being used" => "Le nom d'utilisateur est déjà utilisé" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/lib/l10n/gl.php b/lib/l10n/gl.php index cc1351c2f15..0da1695e37f 100644 --- a/lib/l10n/gl.php +++ b/lib/l10n/gl.php @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "último mes", "_%n month ago_::_%n months ago_" => array("hai %n mes","hai %n meses"), "last year" => "último ano", -"years ago" => "anos atrás" +"years ago" => "anos atrás", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Só se permiten os seguintes caracteres no nome de usuario: «a-z», «A-Z», «0-9», e «_.@-»", +"A valid username must be provided" => "Debe fornecer un nome de usuario", +"A valid password must be provided" => "Debe fornecer un contrasinal", +"The username is already being used" => "Este nome de usuario xa está a ser usado" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/he.php b/lib/l10n/he.php index 6a9020009e9..27267c2e34d 100644 --- a/lib/l10n/he.php +++ b/lib/l10n/he.php @@ -29,6 +29,8 @@ $TRANSLATIONS = array( "last month" => "חודש שעבר", "_%n month ago_::_%n months ago_" => array("","לפני %n חודשים"), "last year" => "שנה שעברה", -"years ago" => "שנים" +"years ago" => "שנים", +"A valid username must be provided" => "יש לספק שם משתמש תקני", +"A valid password must be provided" => "יש לספק ססמה תקנית" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/hu_HU.php b/lib/l10n/hu_HU.php index 2a03f72a51e..0637773d17c 100644 --- a/lib/l10n/hu_HU.php +++ b/lib/l10n/hu_HU.php @@ -60,6 +60,9 @@ $TRANSLATIONS = array( "last month" => "múlt hónapban", "_%n month ago_::_%n months ago_" => array("%n hónappal ezelőtt","%n hónappal ezelőtt"), "last year" => "tavaly", -"years ago" => "több éve" +"years ago" => "több éve", +"A valid username must be provided" => "Érvényes felhasználónevet kell megadnia", +"A valid password must be provided" => "Érvényes jelszót kell megadnia", +"The username is already being used" => "Ez a bejelentkezési név már foglalt" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/id.php b/lib/l10n/id.php index 76dda80cf70..d694967cd42 100644 --- a/lib/l10n/id.php +++ b/lib/l10n/id.php @@ -60,6 +60,8 @@ $TRANSLATIONS = array( "last month" => "bulan kemarin", "_%n month ago_::_%n months ago_" => array("%n bulan yang lalu"), "last year" => "tahun kemarin", -"years ago" => "beberapa tahun lalu" +"years ago" => "beberapa tahun lalu", +"A valid username must be provided" => "Tuliskan nama pengguna yang valid", +"A valid password must be provided" => "Tuliskan sandi yang valid" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/it.php b/lib/l10n/it.php index ed1cbc2e31a..b76b5060a4d 100644 --- a/lib/l10n/it.php +++ b/lib/l10n/it.php @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "mese scorso", "_%n month ago_::_%n months ago_" => array("%n mese fa","%n mesi fa"), "last year" => "anno scorso", -"years ago" => "anni fa" +"years ago" => "anni fa", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Solo i seguenti caratteri sono ammessi in un nome utente: \"a-z\", \"A-Z\", \"0-9\", e \"_.@-\"", +"A valid username must be provided" => "Deve essere fornito un nome utente valido", +"A valid password must be provided" => "Deve essere fornita una password valida", +"The username is already being used" => "Il nome utente è già utilizzato" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/ja.php b/lib/l10n/ja.php index 015c885904e..6d72836f775 100644 --- a/lib/l10n/ja.php +++ b/lib/l10n/ja.php @@ -66,6 +66,9 @@ $TRANSLATIONS = array( "last month" => "1ヶ月前", "_%n month ago_::_%n months ago_" => array("%nヶ月前"), "last year" => "1年前", -"years ago" => "年前" +"years ago" => "年前", +"A valid username must be provided" => "有効なユーザー名を指定する必要があります", +"A valid password must be provided" => "有効なパスワードを指定する必要があります", +"The username is already being used" => "ユーザ名はすでに使われています" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/ka_GE.php b/lib/l10n/ka_GE.php index e2a719d0746..f15563c297d 100644 --- a/lib/l10n/ka_GE.php +++ b/lib/l10n/ka_GE.php @@ -40,6 +40,8 @@ $TRANSLATIONS = array( "last month" => "გასულ თვეში", "_%n month ago_::_%n months ago_" => array(""), "last year" => "ბოლო წელს", -"years ago" => "წლის წინ" +"years ago" => "წლის წინ", +"A valid username must be provided" => "უნდა მიუთითოთ არსებული მომხმარებლის სახელი", +"A valid password must be provided" => "უნდა მიუთითოთ არსებული პაროლი" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/km.php b/lib/l10n/km.php index 51dd4f33a7e..d5fdc025760 100644 --- a/lib/l10n/km.php +++ b/lib/l10n/km.php @@ -39,6 +39,8 @@ $TRANSLATIONS = array( "last month" => "ខែមុន", "_%n month ago_::_%n months ago_" => array("%n ខែមុន"), "last year" => "ឆ្នាំមុន", -"years ago" => "ឆ្នាំមុន" +"years ago" => "ឆ្នាំមុន", +"A valid username must be provided" => "ត្រូវផ្ដល់ឈ្មោះអ្នកប្រើឲ្យបានត្រឹមត្រូវ", +"A valid password must be provided" => "ត្រូវផ្ដល់ពាក្យសម្ងាត់ឲ្យបានត្រឹមត្រូវ" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/ko.php b/lib/l10n/ko.php index 833476f6464..2c94ebdcc22 100644 --- a/lib/l10n/ko.php +++ b/lib/l10n/ko.php @@ -60,6 +60,8 @@ $TRANSLATIONS = array( "last month" => "지난 달", "_%n month ago_::_%n months ago_" => array("%n달 전 "), "last year" => "작년", -"years ago" => "년 전" +"years ago" => "년 전", +"A valid username must be provided" => "올바른 사용자 이름을 입력해야 함", +"A valid password must be provided" => "올바른 암호를 입력해야 함" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/lt_LT.php b/lib/l10n/lt_LT.php index dac8eed7633..88aca7aba46 100644 --- a/lib/l10n/lt_LT.php +++ b/lib/l10n/lt_LT.php @@ -60,6 +60,8 @@ $TRANSLATIONS = array( "last month" => "praeitą mėnesį", "_%n month ago_::_%n months ago_" => array("Prieš %n mėnesį","Prieš %n mėnesius","Prieš %n mėnesių"), "last year" => "praeitais metais", -"years ago" => "prieš metus" +"years ago" => "prieš metus", +"A valid username must be provided" => "Vartotojo vardas turi būti tinkamas", +"A valid password must be provided" => "Slaptažodis turi būti tinkamas" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/lib/l10n/lv.php b/lib/l10n/lv.php index 5461e077ec9..1c8a31aff2f 100644 --- a/lib/l10n/lv.php +++ b/lib/l10n/lv.php @@ -43,6 +43,9 @@ $TRANSLATIONS = array( "last month" => "pagājušajā mēnesī", "_%n month ago_::_%n months ago_" => array("","","Pirms %n mēnešiem"), "last year" => "gājušajā gadā", -"years ago" => "gadus atpakaļ" +"years ago" => "gadus atpakaļ", +"A valid username must be provided" => "Jānorāda derīgs lietotājvārds", +"A valid password must be provided" => "Jānorāda derīga parole", +"The username is already being used" => "Šāds lietotājvārds jau tiek izmantots" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"; diff --git a/lib/l10n/mk.php b/lib/l10n/mk.php index deaf1bc8d05..a0b3c39865a 100644 --- a/lib/l10n/mk.php +++ b/lib/l10n/mk.php @@ -28,6 +28,8 @@ $TRANSLATIONS = array( "last month" => "минатиот месец", "_%n month ago_::_%n months ago_" => array("",""), "last year" => "минатата година", -"years ago" => "пред години" +"years ago" => "пред години", +"A valid username must be provided" => "Мора да се обезбеди валидно корисничко име ", +"A valid password must be provided" => "Мора да се обезбеди валидна лозинка" ); $PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"; diff --git a/lib/l10n/nb_NO.php b/lib/l10n/nb_NO.php index 4b41e54ef44..fd9b631f23c 100644 --- a/lib/l10n/nb_NO.php +++ b/lib/l10n/nb_NO.php @@ -60,6 +60,8 @@ $TRANSLATIONS = array( "last month" => "forrige måned", "_%n month ago_::_%n months ago_" => array("","%n dager siden"), "last year" => "forrige år", -"years ago" => "år siden" +"years ago" => "år siden", +"A valid username must be provided" => "Oppgi et gyldig brukernavn", +"A valid password must be provided" => "Oppgi et gyldig passord" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/nl.php b/lib/l10n/nl.php index dcf893af630..c43703c504e 100644 --- a/lib/l10n/nl.php +++ b/lib/l10n/nl.php @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "vorige maand", "_%n month ago_::_%n months ago_" => array("%n maand geleden","%n maanden geleden"), "last year" => "vorig jaar", -"years ago" => "jaar geleden" +"years ago" => "jaar geleden", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Alleen de volgende tekens zijn toegestaan in een gebruikersnaam: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"", +"A valid username must be provided" => "Er moet een geldige gebruikersnaam worden opgegeven", +"A valid password must be provided" => "Er moet een geldig wachtwoord worden opgegeven", +"The username is already being used" => "De gebruikersnaam bestaat al" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/nn_NO.php b/lib/l10n/nn_NO.php index db257f35dce..77aebb26ffa 100644 --- a/lib/l10n/nn_NO.php +++ b/lib/l10n/nn_NO.php @@ -23,6 +23,8 @@ $TRANSLATIONS = array( "last month" => "førre månad", "_%n month ago_::_%n months ago_" => array("","%n månadar sidan"), "last year" => "i fjor", -"years ago" => "år sidan" +"years ago" => "år sidan", +"A valid username must be provided" => "Du må oppgje eit gyldig brukarnamn", +"A valid password must be provided" => "Du må oppgje eit gyldig passord" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/pl.php b/lib/l10n/pl.php index bc5e4a947c7..f786e1832a2 100644 --- a/lib/l10n/pl.php +++ b/lib/l10n/pl.php @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "w zeszłym miesiącu", "_%n month ago_::_%n months ago_" => array("%n miesiąc temu","%n miesięcy temu","%n miesięcy temu"), "last year" => "w zeszłym roku", -"years ago" => "lat temu" +"years ago" => "lat temu", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "W nazwach użytkowników dozwolone są wyłącznie następujące znaki: \"a-z\", \"A-Z\", \"0-9\", oraz \"_.@-\"", +"A valid username must be provided" => "Należy podać prawidłową nazwę użytkownika", +"A valid password must be provided" => "Należy podać prawidłowe hasło", +"The username is already being used" => "Ta nazwa użytkownika jest już używana" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/lib/l10n/pt_BR.php b/lib/l10n/pt_BR.php index 6c8ea586de8..3cc02f76524 100644 --- a/lib/l10n/pt_BR.php +++ b/lib/l10n/pt_BR.php @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "último mês", "_%n month ago_::_%n months ago_" => array("","ha %n meses"), "last year" => "último ano", -"years ago" => "anos atrás" +"years ago" => "anos atrás", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Somente os seguintes caracteres são permitidos no nome do usuário: \"a-z\", \"A-Z\", \"0-9\", e \"_.@-\"", +"A valid username must be provided" => "Forneça um nome de usuário válido", +"A valid password must be provided" => "Forneça uma senha válida", +"The username is already being used" => "Este nome de usuário já está sendo usado" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/lib/l10n/pt_PT.php b/lib/l10n/pt_PT.php index e6dd459a7e1..8b3c003678d 100644 --- a/lib/l10n/pt_PT.php +++ b/lib/l10n/pt_PT.php @@ -61,6 +61,8 @@ $TRANSLATIONS = array( "last month" => "ultímo mês", "_%n month ago_::_%n months ago_" => array("","%n meses atrás"), "last year" => "ano passado", -"years ago" => "anos atrás" +"years ago" => "anos atrás", +"A valid username must be provided" => "Um nome de utilizador válido deve ser fornecido", +"A valid password must be provided" => "Uma password válida deve ser fornecida" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/ro.php b/lib/l10n/ro.php index 6bff105a61f..87e9a92c464 100644 --- a/lib/l10n/ro.php +++ b/lib/l10n/ro.php @@ -31,6 +31,8 @@ $TRANSLATIONS = array( "last month" => "ultima lună", "_%n month ago_::_%n months ago_" => array("","",""), "last year" => "ultimul an", -"years ago" => "ani în urmă" +"years ago" => "ani în urmă", +"A valid username must be provided" => "Trebuie să furnizaţi un nume de utilizator valid", +"A valid password must be provided" => "Trebuie să furnizaţi o parolă validă" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"; diff --git a/lib/l10n/ru.php b/lib/l10n/ru.php index 214849721da..2611fcf7a6b 100644 --- a/lib/l10n/ru.php +++ b/lib/l10n/ru.php @@ -60,6 +60,8 @@ $TRANSLATIONS = array( "last month" => "в прошлом месяце", "_%n month ago_::_%n months ago_" => array("%n месяц назад","%n месяца назад","%n месяцев назад"), "last year" => "в прошлом году", -"years ago" => "несколько лет назад" +"years ago" => "несколько лет назад", +"A valid username must be provided" => "Укажите правильное имя пользователя", +"A valid password must be provided" => "Укажите валидный пароль" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/lib/l10n/sk_SK.php b/lib/l10n/sk_SK.php index 424f0f5bd8c..17108d4bdf6 100644 --- a/lib/l10n/sk_SK.php +++ b/lib/l10n/sk_SK.php @@ -61,6 +61,8 @@ $TRANSLATIONS = array( "last month" => "minulý mesiac", "_%n month ago_::_%n months ago_" => array("pred %n mesiacom","pred %n mesiacmi","pred %n mesiacmi"), "last year" => "minulý rok", -"years ago" => "pred rokmi" +"years ago" => "pred rokmi", +"A valid username must be provided" => "Musíte zadať platné používateľské meno", +"A valid password must be provided" => "Musíte zadať platné heslo" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/lib/l10n/sl.php b/lib/l10n/sl.php index 411a14370ee..6f9470401ed 100644 --- a/lib/l10n/sl.php +++ b/lib/l10n/sl.php @@ -66,6 +66,8 @@ $TRANSLATIONS = array( "last month" => "zadnji mesec", "_%n month ago_::_%n months ago_" => array("pred %n mesecem","pred %n mesecema","pred %n meseci","pred %n meseci"), "last year" => "lansko leto", -"years ago" => "let nazaj" +"years ago" => "let nazaj", +"A valid username must be provided" => "Navedeno mora biti veljavno uporabniško ime", +"A valid password must be provided" => "Navedeno mora biti veljavno geslo" ); $PLURAL_FORMS = "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);"; diff --git a/lib/l10n/sq.php b/lib/l10n/sq.php index b22663f76df..e29fa2cee53 100644 --- a/lib/l10n/sq.php +++ b/lib/l10n/sq.php @@ -41,6 +41,8 @@ $TRANSLATIONS = array( "last month" => "muajin e shkuar", "_%n month ago_::_%n months ago_" => array("","%n muaj më parë"), "last year" => "vitin e shkuar", -"years ago" => "vite më parë" +"years ago" => "vite më parë", +"A valid username must be provided" => "Duhet të jepni një emër të vlefshëm përdoruesi", +"A valid password must be provided" => "Duhet të jepni një fjalëkalim te vlefshëm" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/sr.php b/lib/l10n/sr.php index 47a84803683..f9155bfd575 100644 --- a/lib/l10n/sr.php +++ b/lib/l10n/sr.php @@ -28,6 +28,8 @@ $TRANSLATIONS = array( "last month" => "прошлог месеца", "_%n month ago_::_%n months ago_" => array("","",""), "last year" => "прошле године", -"years ago" => "година раније" +"years ago" => "година раније", +"A valid username must be provided" => "Морате унети исправно корисничко име", +"A valid password must be provided" => "Морате унети исправну лозинку" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/lib/l10n/sv.php b/lib/l10n/sv.php index 7053e09624d..70ca0bed383 100644 --- a/lib/l10n/sv.php +++ b/lib/l10n/sv.php @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "förra månaden", "_%n month ago_::_%n months ago_" => array("%n månad sedan","%n månader sedan"), "last year" => "förra året", -"years ago" => "år sedan" +"years ago" => "år sedan", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Endast följande tecken är tillåtna i ett användarnamn: \"az\", \"AZ\", \"0-9\", och \"_ @ -.\"", +"A valid username must be provided" => "Ett giltigt användarnamn måste anges", +"A valid password must be provided" => "Ett giltigt lösenord måste anges", +"The username is already being used" => "Användarnamnet används redan" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/tr.php b/lib/l10n/tr.php index 80f1ade9950..0be1c4b186a 100644 --- a/lib/l10n/tr.php +++ b/lib/l10n/tr.php @@ -39,20 +39,20 @@ $TRANSLATIONS = array( "%s enter the database name." => "%s veritabanı adını girin.", "%s you may not use dots in the database name" => "%s veritabanı adında nokta kullanamayabilirsiniz", "MS SQL username and/or password not valid: %s" => "MS SQL kullanıcı adı ve/veya parolası geçersiz: %s", -"You need to enter either an existing account or the administrator." => "Bir konto veya kullanici birlemek ihtiyacin. ", +"You need to enter either an existing account or the administrator." => "Siz veya yönetici mevcut bir hesap girmeli.", "MySQL/MariaDB username and/or password not valid" => "MySQL/MariaDB kullanıcı adı ve/veya parolası geçersiz", -"DB Error: \"%s\"" => "DB Hata: ''%s''", -"Offending command was: \"%s\"" => "Komut rahasiz ''%s''. ", +"DB Error: \"%s\"" => "VT Hatası: \"%s\"", +"Offending command was: \"%s\"" => "Saldırgan komut: \"%s\"", "MySQL/MariaDB user '%s'@'localhost' exists already." => "MySQL/MariaDB kullanıcı '%s'@'localhost' zaten mevcut.", "Drop this user from MySQL/MariaDB" => "Bu kullanıcıyı MySQL/MariaDB'dan at (drop)", "MySQL/MariaDB user '%s'@'%%' already exists" => "MySQL/MariaDB kullanıcısı '%s'@'%%' zaten mevcut", "Drop this user from MySQL/MariaDB." => "Bu kullanıcıyı MySQL/MariaDB'dan at (drop)", "Oracle connection could not be established" => "Oracle bağlantısı kurulamadı", -"Oracle username and/or password not valid" => "Adi klullanici ve/veya parola Oracle mantikli değildir. ", +"Oracle username and/or password not valid" => "Oracle kullanıcı adı ve/veya parolası geçerli değil", "Offending command was: \"%s\", name: %s, password: %s" => "Hatalı komut: \"%s\", ad: %s, parola: %s", -"PostgreSQL username and/or password not valid" => "PostgreSQL adi kullanici ve/veya parola yasal degildir. ", -"Set an admin username." => "Bir adi kullanici vermek. ", -"Set an admin password." => "Parola yonetici birlemek. ", +"PostgreSQL username and/or password not valid" => "PostgreSQL kullanıcı adı ve/veya parolası geçerli değil", +"Set an admin username." => "Bir yönetici kullanıcı adı ayarlayın.", +"Set an admin password." => "Bir yönetici kullanıcı parolası ayarlayın.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Web sunucunuz dosya aktarımı için düzgün bir şekilde yapılandırılmamış. WevDAV arayüzü sorunlu görünüyor.", "Please double check the <a href='%s'>installation guides</a>." => "Lütfen <a href='%s'>kurulum kılavuzlarını</a> iki kez kontrol edin.", "%s shared »%s« with you" => "%s sizinle »%s« paylaşımında bulundu", @@ -66,6 +66,10 @@ $TRANSLATIONS = array( "last month" => "geçen ay", "_%n month ago_::_%n months ago_" => array("","%n ay önce"), "last year" => "geçen yıl", -"years ago" => "yıl önce" +"years ago" => "yıl önce", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Kullanıcı adında sadece bu karakterlere izin verilmektedir: \"a-z\", \"A-Z\", \"0-9\", ve \"_.@-\"", +"A valid username must be provided" => "Geçerli bir kullanıcı adı mutlaka sağlanmalı", +"A valid password must be provided" => "Geçerli bir parola mutlaka sağlanmalı", +"The username is already being used" => "Bu kullanıcı adı zaten kullanımda" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/lib/l10n/ug.php b/lib/l10n/ug.php index e2cf38ecc8c..8cfa99732ab 100644 --- a/lib/l10n/ug.php +++ b/lib/l10n/ug.php @@ -14,6 +14,8 @@ $TRANSLATIONS = array( "today" => "بۈگۈن", "yesterday" => "تۈنۈگۈن", "_%n day go_::_%n days ago_" => array(""), -"_%n month ago_::_%n months ago_" => array("") +"_%n month ago_::_%n months ago_" => array(""), +"A valid username must be provided" => "چوقۇم ئىناۋەتلىك ئىشلەتكۈچى ئىسمىدىن بىرنى تەمىنلەش كېرەك", +"A valid password must be provided" => "چوقۇم ئىناۋەتلىك ئىم تەمىنلەش كېرەك" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/uk.php b/lib/l10n/uk.php index 94163f0b6f5..fed6277fdd8 100644 --- a/lib/l10n/uk.php +++ b/lib/l10n/uk.php @@ -43,6 +43,8 @@ $TRANSLATIONS = array( "last month" => "минулого місяця", "_%n month ago_::_%n months ago_" => array("","","%n місяців тому"), "last year" => "минулого року", -"years ago" => "роки тому" +"years ago" => "роки тому", +"A valid username must be provided" => "Потрібно задати вірне ім'я користувача", +"A valid password must be provided" => "Потрібно задати вірний пароль" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/lib/l10n/zh_CN.php b/lib/l10n/zh_CN.php index 684ee17f98e..8fca52f3dbd 100644 --- a/lib/l10n/zh_CN.php +++ b/lib/l10n/zh_CN.php @@ -48,6 +48,8 @@ $TRANSLATIONS = array( "last month" => "上月", "_%n month ago_::_%n months ago_" => array("%n 月前"), "last year" => "去年", -"years ago" => "年前" +"years ago" => "年前", +"A valid username must be provided" => "必须提供合法的用户名", +"A valid password must be provided" => "必须提供合法的密码" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/zh_TW.php b/lib/l10n/zh_TW.php index 1fbae6e2355..83616cf6a42 100644 --- a/lib/l10n/zh_TW.php +++ b/lib/l10n/zh_TW.php @@ -60,6 +60,8 @@ $TRANSLATIONS = array( "last month" => "上個月", "_%n month ago_::_%n months ago_" => array("%n 個月前"), "last year" => "去年", -"years ago" => "幾年前" +"years ago" => "幾年前", +"A valid username must be provided" => "必須提供一個有效的用戶名", +"A valid password must be provided" => "一定要提供一個有效的密碼" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/private/appframework/dependencyinjection/dicontainer.php b/lib/private/appframework/dependencyinjection/dicontainer.php index 4821ecaf67b..e478225a53d 100644 --- a/lib/private/appframework/dependencyinjection/dicontainer.php +++ b/lib/private/appframework/dependencyinjection/dicontainer.php @@ -92,13 +92,13 @@ class DIContainer extends SimpleContainer implements IAppContainer{ return new SecurityMiddleware($app, $c['Request']); }); - $middleWares = $this->middleWares; - $this['MiddlewareDispatcher'] = $this->share(function($c) use ($middleWares) { + $middleWares = &$this->middleWares; + $this['MiddlewareDispatcher'] = $this->share(function($c) use (&$middleWares) { $dispatcher = new MiddlewareDispatcher(); $dispatcher->registerMiddleware($c['SecurityMiddleware']); foreach($middleWares as $middleWare) { - $dispatcher->registerMiddleware($middleWare); + $dispatcher->registerMiddleware($c[$middleWare]); } return $dispatcher; @@ -133,10 +133,10 @@ class DIContainer extends SimpleContainer implements IAppContainer{ } /** - * @param Middleware $middleWare + * @param string $middleWare * @return boolean|null */ - function registerMiddleWare(Middleware $middleWare) { + function registerMiddleWare($middleWare) { array_push($this->middleWares, $middleWare); } diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php index 40f47a7bd2f..643fa685adc 100644 --- a/lib/private/appframework/http/request.php +++ b/lib/private/appframework/http/request.php @@ -60,7 +60,14 @@ class Request implements \ArrayAccess, \Countable, IRequest { * @param string|false 'requesttoken' the requesttoken or false when not available * @see http://www.php.net/manual/en/reserved.variables.php */ - public function __construct(array $vars=array()) { + public function __construct(array $vars=array(), $stream='php://input') { + + $this->inputStream = $stream; + $this->items['params'] = array(); + + if(!array_key_exists('method', $vars)) { + $vars['method'] = 'GET'; + } foreach($this->allowedKeys as $name) { $this->items[$name] = isset($vars[$name]) @@ -68,25 +75,32 @@ class Request implements \ArrayAccess, \Countable, IRequest { : array(); } - if (defined('PHPUNIT_RUN') && PHPUNIT_RUN - && in_array('fakeinput', stream_get_wrappers())) { - $this->inputStream = 'fakeinput://data'; - } else { - $this->inputStream = 'php://input'; - } - - // Only 'application/x-www-form-urlencoded' requests are automatically - // transformed by PHP, 'application/json' must be decoded manually. - if ($this->method === 'POST' - && strpos($this->getHeader('Content-Type'), 'application/json') !== false - ) { - $this->items['params'] = $this->items['post'] = json_decode(file_get_contents($this->inputStream), true); - } + // 'application/json' must be decoded manually. + if (strpos($this->getHeader('Content-Type'), 'application/json') !== false) { + $params = json_decode(file_get_contents($this->inputStream), true); + if(count($params) > 0) { + $this->items['params'] = $params; + if($vars['method'] === 'POST') { + $this->items['post'] = $params; + } + } + // Handle application/x-www-form-urlencoded for methods other than GET + // or post correctly + } elseif($vars['method'] !== 'GET' + && $vars['method'] !== 'POST' + && strpos($this->getHeader('Content-Type'), 'application/x-www-form-urlencoded') !== false) { + + parse_str(file_get_contents($this->inputStream), $params); + if(is_array($params)) { + $this->items['params'] = $params; + } + } $this->items['parameters'] = array_merge( $this->items['get'], $this->items['post'], - $this->items['urlParams'] + $this->items['urlParams'], + $this->items['params'] ); } @@ -313,47 +327,22 @@ class Request implements \ArrayAccess, \Countable, IRequest { * @throws \LogicException */ protected function getContent() { - if ($this->content === false && $this->method === 'PUT') { - throw new \LogicException( - '"put" can only be accessed once if not ' - . 'application/x-www-form-urlencoded or application/json.' - ); - } - // If the content can't be parsed into an array then return a stream resource. if ($this->method === 'PUT' && strpos($this->getHeader('Content-Type'), 'application/x-www-form-urlencoded') === false && strpos($this->getHeader('Content-Type'), 'application/json') === false ) { + if ($this->content === false) { + throw new \LogicException( + '"put" can only be accessed once if not ' + . 'application/x-www-form-urlencoded or application/json.' + ); + } $this->content = false; return fopen($this->inputStream, 'rb'); + } else { + return $this->parameters; } - - if (is_null($this->content)) { - $this->content = file_get_contents($this->inputStream); - - /* - * Normal jquery ajax requests are sent as application/x-www-form-urlencoded - * and in $_GET and $_POST PHP transformes the data into an array. - * The first condition mimics this. - * The second condition allows for sending raw application/json data while - * still getting the result as an array. - * - */ - if (strpos($this->getHeader('Content-Type'), 'application/x-www-form-urlencoded') !== false) { - parse_str($this->content, $content); - if(is_array($content)) { - $this->content = $content; - } - } elseif (strpos($this->getHeader('Content-Type'), 'application/json') !== false) { - $content = json_decode($this->content, true); - if(is_array($content)) { - $this->content = $content; - } - } - } - - return $this->content; } /** diff --git a/lib/private/appframework/routing/routeconfig.php b/lib/private/appframework/routing/routeconfig.php index 35bee75cc4d..a3bbde6af53 100644 --- a/lib/private/appframework/routing/routeconfig.php +++ b/lib/private/appframework/routing/routeconfig.php @@ -84,7 +84,15 @@ class RouteConfig { // register the route $handler = new RouteActionHandler($this->container, $controllerName, $actionName); - $this->router->create($this->appName.'.'.$controller.'.'.$action, $url)->method($verb)->action($handler); + $router = $this->router->create($this->appName.'.'.$controller.'.'.$action, $url) + ->method($verb) + ->action($handler); + + // optionally register requirements for route. This is used to + // tell the route parser how url parameters should be matched + if(array_key_exists('requirements', $simpleRoute)) { + $router->requirements($simpleRoute['requirements']); + } } } diff --git a/lib/private/connector/sabre/node.php b/lib/private/connector/sabre/node.php index 5807c5c7f71..7ff9f50ca68 100644 --- a/lib/private/connector/sabre/node.php +++ b/lib/private/connector/sabre/node.php @@ -139,12 +139,15 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr /** * @brief Returns the last modification time, as a unix timestamp - * @return int + * @return int timestamp as integer */ public function getLastModified() { $this->getFileinfoCache(); - return $this->fileinfo_cache['mtime']; - + $timestamp = $this->fileinfo_cache['mtime']; + if (!empty($timestamp)) { + return (int)$timestamp; + } + return $timestamp; } /** diff --git a/lib/private/davclient.php b/lib/private/davclient.php index afa4e1103b4..916dc11d17a 100644 --- a/lib/private/davclient.php +++ b/lib/private/davclient.php @@ -29,6 +29,8 @@ class OC_DAVClient extends \Sabre_DAV_Client { protected $requestTimeout; + protected $verifyHost; + /** * @brief Sets the request timeout or 0 to disable timeout. * @param integer $timeout in seconds or 0 to disable @@ -37,10 +39,21 @@ class OC_DAVClient extends \Sabre_DAV_Client { $this->requestTimeout = (int)$timeout; } + /** + * @brief Sets the CURLOPT_SSL_VERIFYHOST setting + * @param integer $value value to set CURLOPT_SSL_VERIFYHOST to + */ + public function setVerifyHost($value) { + $this->verifyHost = $value; + } + protected function curlRequest($url, $settings) { if ($this->requestTimeout > 0) { $settings[CURLOPT_TIMEOUT] = $this->requestTimeout; } + if (!is_null($this->verifyHost)) { + $settings[CURLOPT_SSL_VERIFYHOST] = $this->verifyHost; + } return parent::curlRequest($url, $settings); } } diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index 0ce447a5a48..33b8549ff78 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -159,9 +159,11 @@ abstract class Common implements \OC\Files\Storage\Storage { } public function hash($type, $path, $raw = false) { - $tmpFile = $this->getLocalFile($path); - $hash = hash_file($type, $tmpFile, $raw); - return $hash; + $fh = $this->fopen($path, 'rb'); + $ctx = hash_init($type); + hash_update_stream($ctx, $fh); + fclose($fh); + return hash_final($ctx, $raw); } public function search($query) { diff --git a/lib/private/group/backend.php b/lib/private/group/backend.php index 2e17b5d0b7f..b0ed0d90d76 100644 --- a/lib/private/group/backend.php +++ b/lib/private/group/backend.php @@ -34,6 +34,7 @@ define('OC_GROUP_BACKEND_DELETE_GROUP', 0x00000010); define('OC_GROUP_BACKEND_ADD_TO_GROUP', 0x00000100); define('OC_GROUP_BACKEND_REMOVE_FROM_GOUP', 0x00001000); define('OC_GROUP_BACKEND_GET_DISPLAYNAME', 0x00010000); +define('OC_GROUP_BACKEND_COUNT_USERS', 0x00100000); /** * Abstract base class for user management @@ -45,6 +46,7 @@ abstract class OC_Group_Backend implements OC_Group_Interface { OC_GROUP_BACKEND_ADD_TO_GROUP => 'addToGroup', OC_GROUP_BACKEND_REMOVE_FROM_GOUP => 'removeFromGroup', OC_GROUP_BACKEND_GET_DISPLAYNAME => 'displayNamesInGroup', + OC_GROUP_BACKEND_COUNT_USERS => 'countUsersInGroup', ); /** diff --git a/lib/private/group/database.php b/lib/private/group/database.php index d0974685ff6..3815dcff2e5 100644 --- a/lib/private/group/database.php +++ b/lib/private/group/database.php @@ -212,6 +212,20 @@ class OC_Group_Database extends OC_Group_Backend { } /** + * @brief get the number of all users matching the search string in a group + * @param string $gid + * @param string $search + * @param int $limit + * @param int $offset + * @return int | false + */ + public function countUsersInGroup($gid, $search = '') { + $stmt = OC_DB::prepare('SELECT COUNT(`uid`) AS `count` FROM `*PREFIX*group_user` WHERE `gid` = ? AND `uid` LIKE ?'); + $result = $stmt->execute(array($gid, $search.'%')); + return $result->fetchOne(); + } + + /** * @brief get a list of all display names in a group * @param string $gid * @param string $search diff --git a/lib/private/group/dummy.php b/lib/private/group/dummy.php index da26e1b910e..94cbb607ad1 100644 --- a/lib/private/group/dummy.php +++ b/lib/private/group/dummy.php @@ -157,4 +157,14 @@ class OC_Group_Dummy extends OC_Group_Backend { } } + /** + * @brief get the number of all users in a group + * @returns int | bool + */ + public function countUsersInGroup($gid, $search = '', $limit = -1, $offset = 0) { + if(isset($this->groups[$gid])) { + return count($this->groups[$gid]); + } + } + } diff --git a/lib/private/group/group.php b/lib/private/group/group.php index 8d2aa87a788..a2b8a0dcbea 100644 --- a/lib/private/group/group.php +++ b/lib/private/group/group.php @@ -187,6 +187,27 @@ class Group { } /** + * returns the number of users matching the search string + * + * @param string $search + * @return int | bool + */ + public function count($search) { + $users = false; + foreach ($this->backends as $backend) { + if($backend->implementsActions(OC_GROUP_BACKEND_COUNT_USERS)) { + if($users === false) { + //we could directly add to a bool variable, but this would + //be ugly + $users = 0; + } + $users += $backend->countUsersInGroup($this->gid, $search); + } + } + return $users; + } + + /** * search for users in the group by displayname * * @param string $search diff --git a/lib/private/ocs/result.php b/lib/private/ocs/result.php index 9f14e8da7e8..0e3b85d5905 100644 --- a/lib/private/ocs/result.php +++ b/lib/private/ocs/result.php @@ -96,7 +96,7 @@ class OC_OCS_Result{ * @return bool */ public function succeeded() { - return (substr($this->statusCode, 0, 1) === '1'); + return ($this->statusCode == 100); } diff --git a/lib/private/preview.php b/lib/private/preview.php index 0c1af3c9588..0187b4aacbb 100755 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -13,6 +13,8 @@ */ namespace OC; +use OC\Preview\Provider; + require_once 'preview/image.php'; require_once 'preview/movies.php'; require_once 'preview/mp3.php'; @@ -39,15 +41,16 @@ class Preview { private $file; private $maxX; private $maxY; - private $scalingup; - private $mimetype; + private $scalingUp; + private $mimeType; //filemapper used for deleting previews // index is path, value is fileinfo static public $deleteFileMapper = array(); - //preview images object /** + * preview images object + * * @var \OC_Image */ private $preview; @@ -109,7 +112,7 @@ class Preview { * @brief returns the path of the file you want a thumbnail from * @return string */ - public function getFile() { + public function getFile() { return $this->file; } @@ -134,7 +137,7 @@ class Preview { * @return bool */ public function getScalingUp() { - return $this->scalingup; + return $this->scalingUp; } /** @@ -191,18 +194,18 @@ class Preview { if ($file !== '') { $this->getFileInfo(); if($this->info !== null && $this->info !== false) { - $this->mimetype = $this->info->getMimetype(); + $this->mimeType = $this->info->getMimetype(); } } return $this; } /** - * @brief set mimetype explicitely - * @param string $mimetype + * @brief set mime type explicitly + * @param string $mimeType */ - public function setMimetype($mimetype) { - $this->mimetype = $mimetype; + public function setMimetype($mimeType) { + $this->mimeType = $mimeType; } /** @@ -254,7 +257,7 @@ class Preview { if ($this->getMaxScaleFactor() === 1) { $scalingUp = false; } - $this->scalingup = $scalingUp; + $this->scalingUp = $scalingUp; return $this; } @@ -314,35 +317,68 @@ class Preview { /** * @brief check if thumbnail or bigger version of thumbnail of file is cached - * @return mixed (bool / string) - * false if thumbnail does not exist - * path to thumbnail if thumbnail exists + * @param int $fileId fileId of the original image + * @return string|false path to thumbnail if it exists or false */ - private function isCached() { - $file = $this->getFile(); + public function isCached($fileId) { + if (is_null($fileId)) { + return false; + } + $maxX = $this->getMaxX(); $maxY = $this->getMaxY(); - $scalingUp = $this->getScalingUp(); - $maxScaleFactor = $this->getMaxScaleFactor(); - $fileInfo = $this->getFileInfo($file); - $fileId = $fileInfo->getId(); + $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/'; + + //does a preview with the wanted height and width already exist? + if ($this->userView->file_exists($previewPath . $maxX . '-' . $maxY . '.png')) { + return $previewPath . $maxX . '-' . $maxY . '.png'; + } + + return $this->isCachedBigger($fileId); + } + + /** + * @brief check if a bigger version of thumbnail of file is cached + * @param int $fileId fileId of the original image + * @return string|false path to bigger thumbnail if it exists or false + */ + private function isCachedBigger($fileId) { if (is_null($fileId)) { return false; } - $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/'; - if (!$this->userView->is_dir($previewPath)) { - return false; + $maxX = $this->getMaxX(); + + //array for usable cached thumbnails + $possibleThumbnails = $this->getPossibleThumbnails($fileId); + + foreach ($possibleThumbnails as $width => $path) { + if ($width < $maxX) { + continue; + } else { + return $path; + } } - //does a preview with the wanted height and width already exist? - if ($this->userView->file_exists($previewPath . $maxX . '-' . $maxY . '.png')) { - return $previewPath . $maxX . '-' . $maxY . '.png'; + return false; + } + + /** + * @brief get possible bigger thumbnails of the given image + * @param int $fileId fileId of the original image + * @return array of paths to bigger thumbnails + */ + private function getPossibleThumbnails($fileId) { + + if (is_null($fileId)) { + return array(); } - $wantedAspectRatio = (float)($maxX / $maxY); + $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/'; + + $wantedAspectRatio = (float) ($this->getMaxX() / $this->getMaxY()); //array for usable cached thumbnails $possibleThumbnails = array(); @@ -350,53 +386,47 @@ class Preview { $allThumbnails = $this->userView->getDirectoryContent($previewPath); foreach ($allThumbnails as $thumbnail) { $name = rtrim($thumbnail['name'], '.png'); - $size = explode('-', $name); - $x = (int)$size[0]; - $y = (int)$size[1]; + list($x, $y, $aspectRatio) = $this->getDimensionsFromFilename($name); - $aspectRatio = (float)($x / $y); - if ($aspectRatio !== $wantedAspectRatio) { + if (abs($aspectRatio - $wantedAspectRatio) >= 0.000001 + || $this->unscalable($x, $y) + ) { continue; } - - if ($x < $maxX || $y < $maxY) { - if ($scalingUp) { - $scalefactor = $maxX / $x; - if ($scalefactor > $maxScaleFactor) { - continue; - } - } else { - continue; - } - } $possibleThumbnails[$x] = $thumbnail['path']; } - if (count($possibleThumbnails) === 0) { - return false; - } - - if (count($possibleThumbnails) === 1) { - return current($possibleThumbnails); - } - ksort($possibleThumbnails); - if (key(reset($possibleThumbnails)) > $maxX) { - return current(reset($possibleThumbnails)); - } + return $possibleThumbnails; + } - if (key(end($possibleThumbnails)) < $maxX) { - return current(end($possibleThumbnails)); - } + private function getDimensionsFromFilename($name) { + $size = explode('-', $name); + $x = (int) $size[0]; + $y = (int) $size[1]; + $aspectRatio = (float) ($x / $y); + return array($x, $y, $aspectRatio); + } - foreach ($possibleThumbnails as $width => $path) { - if ($width < $maxX) { - continue; + private function unscalable($x, $y) { + + $maxX = $this->getMaxX(); + $maxY = $this->getMaxY(); + $scalingUp = $this->getScalingUp(); + $maxScaleFactor = $this->getMaxScaleFactor(); + + if ($x < $maxX || $y < $maxY) { + if ($scalingUp) { + $scalefactor = $maxX / $x; + if ($scalefactor > $maxScaleFactor) { + return true; + } } else { - return $path; + return true; } } + return false; } /** @@ -420,7 +450,7 @@ class Preview { } $fileId = $fileInfo->getId(); - $cached = $this->isCached(); + $cached = $this->isCached($fileId); if ($cached) { $stream = $this->userView->fopen($cached, 'r'); @@ -434,13 +464,14 @@ class Preview { if (is_null($this->preview)) { $preview = null; - foreach (self::$providers as $supportedMimetype => $provider) { - if (!preg_match($supportedMimetype, $this->mimetype)) { + foreach (self::$providers as $supportedMimeType => $provider) { + if (!preg_match($supportedMimeType, $this->mimeType)) { continue; } \OC_Log::write('core', 'Generating preview for "' . $file . '" with "' . get_class($provider) . '"', \OC_Log::DEBUG); + /** @var $provider Provider */ $preview = $provider->getThumbnail($file, $maxX, $maxY, $scalingUp, $this->fileView); if (!($preview instanceof \OC_Image)) { @@ -484,7 +515,6 @@ class Preview { $this->getPreview(); } $this->preview->show('image/png'); - return; } /** @@ -493,7 +523,6 @@ class Preview { */ public function show() { $this->showPreview(); - return; } /** @@ -505,7 +534,7 @@ class Preview { $x = $this->getMaxX(); $y = $this->getMaxY(); $scalingUp = $this->getScalingUp(); - $maxscalefactor = $this->getMaxScaleFactor(); + $maxScaleFactor = $this->getMaxScaleFactor(); if (!($image instanceof \OC_Image)) { \OC_Log::write('core', '$this->preview is not an instance of OC_Image', \OC_Log::DEBUG); @@ -514,16 +543,16 @@ class Preview { $image->fixOrientation(); - $realx = (int)$image->width(); - $realy = (int)$image->height(); + $realX = (int)$image->width(); + $realY = (int)$image->height(); - if ($x === $realx && $y === $realy) { + if ($x === $realX && $y === $realY) { $this->preview = $image; return; } - $factorX = $x / $realx; - $factorY = $y / $realy; + $factorX = $x / $realX; + $factorY = $y / $realY; if ($factorX >= $factorY) { $factor = $factorX; @@ -537,25 +566,25 @@ class Preview { } } - if (!is_null($maxscalefactor)) { - if ($factor > $maxscalefactor) { - \OC_Log::write('core', 'scalefactor reduced from ' . $factor . ' to ' . $maxscalefactor, \OC_Log::DEBUG); - $factor = $maxscalefactor; + if (!is_null($maxScaleFactor)) { + if ($factor > $maxScaleFactor) { + \OC_Log::write('core', 'scale factor reduced from ' . $factor . ' to ' . $maxScaleFactor, \OC_Log::DEBUG); + $factor = $maxScaleFactor; } } - $newXsize = (int)($realx * $factor); - $newYsize = (int)($realy * $factor); + $newXSize = (int)($realX * $factor); + $newYSize = (int)($realY * $factor); - $image->preciseResize($newXsize, $newYsize); + $image->preciseResize($newXSize, $newYSize); - if ($newXsize === $x && $newYsize === $y) { + if ($newXSize === $x && $newYSize === $y) { $this->preview = $image; return; } - if ($newXsize >= $x && $newYsize >= $y) { - $cropX = floor(abs($x - $newXsize) * 0.5); + if ($newXSize >= $x && $newYSize >= $y) { + $cropX = floor(abs($x - $newXSize) * 0.5); //don't crop previews on the Y axis, this sucks if it's a document. //$cropY = floor(abs($y - $newYsize) * 0.5); $cropY = 0; @@ -566,36 +595,36 @@ class Preview { return; } - if ($newXsize < $x || $newYsize < $y) { - if ($newXsize > $x) { - $cropX = floor(($newXsize - $x) * 0.5); - $image->crop($cropX, 0, $x, $newYsize); + if ($newXSize < $x || $newYSize < $y) { + if ($newXSize > $x) { + $cropX = floor(($newXSize - $x) * 0.5); + $image->crop($cropX, 0, $x, $newYSize); } - if ($newYsize > $y) { - $cropY = floor(($newYsize - $y) * 0.5); - $image->crop(0, $cropY, $newXsize, $y); + if ($newYSize > $y) { + $cropY = floor(($newYSize - $y) * 0.5); + $image->crop(0, $cropY, $newXSize, $y); } - $newXsize = (int)$image->width(); - $newYsize = (int)$image->height(); + $newXSize = (int)$image->width(); + $newYSize = (int)$image->height(); //create transparent background layer - $backgroundlayer = imagecreatetruecolor($x, $y); - $white = imagecolorallocate($backgroundlayer, 255, 255, 255); - imagefill($backgroundlayer, 0, 0, $white); + $backgroundLayer = imagecreatetruecolor($x, $y); + $white = imagecolorallocate($backgroundLayer, 255, 255, 255); + imagefill($backgroundLayer, 0, 0, $white); $image = $image->resource(); - $mergeX = floor(abs($x - $newXsize) * 0.5); - $mergeY = floor(abs($y - $newYsize) * 0.5); + $mergeX = floor(abs($x - $newXSize) * 0.5); + $mergeY = floor(abs($y - $newYSize) * 0.5); - imagecopy($backgroundlayer, $image, $mergeX, $mergeY, 0, 0, $newXsize, $newYsize); + imagecopy($backgroundLayer, $image, $mergeX, $mergeY, 0, 0, $newXSize, $newYSize); //$black = imagecolorallocate(0,0,0); //imagecolortransparent($transparentlayer, $black); - $image = new \OC_Image($backgroundlayer); + $image = new \OC_Image($backgroundLayer); $this->preview = $image; return; @@ -630,6 +659,7 @@ class Preview { $class = $provider['class']; $options = $provider['options']; + /** @var $object Provider */ $object = new $class($options); self::$providers[$object->getMimeType()] = $object; @@ -640,7 +670,7 @@ class Preview { } public static function post_write($args) { - self::post_delete($args); + self::post_delete($args, 'files/'); } public static function prepare_delete_files($args) { @@ -676,9 +706,9 @@ class Preview { } /** - * @param string $mimetype + * @param string $mimeType */ - public static function isMimeSupported($mimetype) { + public static function isMimeSupported($mimeType) { if (!\OC_Config::getValue('enable_previews', true)) { return false; } @@ -690,8 +720,8 @@ class Preview { //remove last element because it has the mimetype * $providers = array_slice(self::$providers, 0, -1); - foreach ($providers as $supportedMimetype => $provider) { - if (preg_match($supportedMimetype, $mimetype)) { + foreach ($providers as $supportedMimeType => $provider) { + if (preg_match($supportedMimeType, $mimeType)) { return true; } } diff --git a/lib/private/route/router.php b/lib/private/route/router.php index 1f0a23ee124..fa0ad6ab95b 100644 --- a/lib/private/route/router.php +++ b/lib/private/route/router.php @@ -117,7 +117,7 @@ class Router implements IRouter { if (!isset($this->loadedApps[$app])) { $this->loadedApps[$app] = true; $this->useCollection($app); - require_once $file; + $this->requireRouteFile($file); $collection = $this->getCollection($app); $collection->addPrefix('/apps/' . $app); $this->root->addCollection($collection); @@ -183,7 +183,7 @@ class Router implements IRouter { // empty string / 'apps' / $app / rest of the route list(, , $app,) = explode('/', $url, 4); $this->loadRoutes($app); - } else if (substr($url, 0, 6) === '/core/' or substr($url, 0, 5) === '/ocs/' or substr($url, 0, 10) === '/settings/') { + } else if (substr($url, 0, 6) === '/core/' or substr($url, 0, 10) === '/settings/') { $this->loadRoutes('core'); } else { $this->loadRoutes(); @@ -230,4 +230,12 @@ class Router implements IRouter { return $this->getGenerator()->generate($name, $parameters, $absolute); } + /** + * To isolate the variable scope used inside the $file it is required in it's own method + * @param $file + */ + private function requireRouteFile($file) { + require_once $file; + } + } diff --git a/lib/private/server.php b/lib/private/server.php index 3517d7b3548..5d90a0b19fc 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -35,6 +35,13 @@ class Server extends SimpleContainer implements IServerContainer { $requesttoken = false; } + if (defined('PHPUNIT_RUN') && PHPUNIT_RUN + && in_array('fakeinput', stream_get_wrappers())) { + $stream = 'fakeinput://data'; + } else { + $stream = 'php://input'; + } + return new Request( array( 'get' => $_GET, @@ -48,7 +55,7 @@ class Server extends SimpleContainer implements IServerContainer { : null, 'urlParams' => $urlParams, 'requesttoken' => $requesttoken, - ) + ), $stream ); }); $this->registerService('PreviewManager', function($c) { diff --git a/lib/private/share/share.php b/lib/private/share/share.php index 7bab98b00bf..d4f08e8e016 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -431,6 +431,16 @@ class Share extends \OC\Share\Constants { $itemSourceName = $itemSource; } + // verify that the file exists before we try to share it + if ($itemType === 'file' or $itemType === 'folder') { + $path = \OC\Files\Filesystem::getPath($itemSource); + if (!$path) { + $message = 'Sharing ' . $itemSourceName . ' failed, because the file does not exist'; + \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); + throw new \Exception($message); + } + } + // Verify share type and sharing conditions are met if ($shareType === self::SHARE_TYPE_USER) { if ($shareWith == $uidOwner) { @@ -1523,7 +1533,7 @@ class Share extends \OC\Share\Constants { $select = '*'; if ($format == self::FORMAT_STATUSES) { if ($fileDependent) { - $select = '`*PREFIX*share`.`id`, `*PREFIX*share`.`parent`, `share_type`, `path`, `share_with`, `uid_owner` , `file_source`'; + $select = '`*PREFIX*share`.`id`, `*PREFIX*share`.`parent`, `share_type`, `path`, `storage`, `share_with`, `uid_owner` , `file_source`'; } else { $select = '`id`, `parent`, `share_type`, `share_with`, `uid_owner`, `item_source`'; } diff --git a/lib/private/template/functions.php b/lib/private/template/functions.php index a72d41f72da..3c42d441efa 100644 --- a/lib/private/template/functions.php +++ b/lib/private/template/functions.php @@ -7,16 +7,17 @@ */ /** - * Prints an XSS escaped string - * @param string $string the string which will be escaped and printed + * Prints a sanitized string + * @param string|array $string the string which will be escaped and printed */ function p($string) { print(OC_Util::sanitizeHTML($string)); } /** - * Prints an unescaped string - * @param string $string the string which will be printed as it is + * Prints an unsanitized string - usage of this function may result into XSS. + * Consider using p() instead. + * @param string|array $string the string which will be printed as it is */ function print_unescaped($string) { print($string); diff --git a/lib/private/util.php b/lib/private/util.php index 731b7c97503..e20de308e87 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -805,7 +805,7 @@ class OC_Util { array_walk_recursive($value, 'OC_Util::sanitizeHTML'); } else { //Specify encoding for PHP<5.4 - $value = htmlentities((string)$value, ENT_QUOTES, 'UTF-8'); + $value = htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8'); } return $value; } @@ -902,6 +902,8 @@ class OC_Util { // for this self test we don't care if the ssl certificate is self signed and the peer cannot be verified. $client->setVerifyPeer(false); + // also don't care if the host can't be verified + $client->setVerifyHost(0); $return = true; try { diff --git a/lib/public/appframework/iappcontainer.php b/lib/public/appframework/iappcontainer.php index e4f5f37cad2..a0b0c06881a 100644 --- a/lib/public/appframework/iappcontainer.php +++ b/lib/public/appframework/iappcontainer.php @@ -50,10 +50,10 @@ interface IAppContainer extends IContainer{ function getServer(); /** - * @param Middleware $middleWare + * @param string $middleWare * @return boolean */ - function registerMiddleWare(Middleware $middleWare); + function registerMiddleWare($middleWare); /** * @return boolean |