Merge branch master into stable

This commit is contained in:
Guy Brand 2020-06-03 15:49:07 +02:00
commit 2268f30d0a
10 changed files with 592 additions and 479 deletions

1
.gitattributes vendored
View File

@ -6,6 +6,7 @@
*.xcf binary
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
.editorconfig export-ignore
.travis.yml export-ignore

View File

@ -110,6 +110,9 @@ while (false !== ($entry = $dh->read())) {
}
$dh->close();
// use no mbstring help during tests
if (!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING', 1);
// load dw
require_once(DOKU_INC.'inc/init.php');

View File

@ -1,23 +1,31 @@
<?php
// use no mbstring help here
if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1);
class utf8_strtolower_test extends DokuWikiTest {
class utf8_strtolower_test extends DokuWikiTest
{
function test_givens(){
$data = array(
'Αρχιτεκτονική Μελέτη' => 'αρχιτεκτονική μελέτη', // FS#2173
);
foreach($data as $input => $expected) {
$this->assertEquals($expected, \dokuwiki\Utf8\PhpString::strtolower($input));
}
/**
* @see testGivens
* @return array
*/
public function provideGivens()
{
return [
['Αρχιτεκτονική Μελέτη', 'αρχιτεκτονική μελέτη'], // FS#2173
['ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'],
['players:Bruce', 'players:bruce'],
['players:GERALD', 'players:gerald'],
];
}
/**
* @dataProvider provideGivens
* @param string $input
* @param string $expected
*/
public function testGivens($input, $expected)
{
$this->assertEquals($expected, \dokuwiki\Utf8\PhpString::strtolower($input));
// just make sure our data was correct
if(function_exists('mb_strtolower')) {
foreach($data as $input => $expected) {
$this->assertEquals($expected, mb_strtolower($input, 'utf-8'));
}
}
$this->assertEquals($expected, mb_strtolower($input, 'utf-8'), 'mbstring check');
}
}

View File

@ -11,7 +11,7 @@
// update message version - always use a string to avoid localized floats!
use dokuwiki\Extension\Event;
$updateVersion = "51";
$updateVersion = "51.1";
// xdebug_start_profiling();

File diff suppressed because it is too large Load Diff

View File

@ -235,16 +235,18 @@ function check(){
msg('Your current permission for this page is '.$INFO['perm'],0);
if(is_writable($INFO['filepath'])){
msg('The current page is writable by the webserver',0);
}else{
msg('The current page is not writable by the webserver',0);
if (file_exists($INFO['filepath']) && is_writable($INFO['filepath'])) {
msg('The current page is writable by the webserver', 1);
} elseif (!file_exists($INFO['filepath']) && is_writable(dirname($INFO['filepath']))) {
msg('The current page can be created by the webserver', 1);
} else {
msg('The current page is not writable by the webserver', -1);
}
if($INFO['writable']){
msg('The current page is writable by you',0);
}else{
msg('The current page is not writable by you',0);
if ($INFO['writable']) {
msg('The current page is writable by you', 1);
} else {
msg('The current page is not writable by you', -1);
}
// Check for corrupted search index
@ -338,15 +340,20 @@ define('MSG_ADMINS_ONLY',4);
*/
function msg($message,$lvl=0,$line='',$file='',$allow=MSG_PUBLIC){
global $MSG, $MSG_shown;
static $errors = array(-1=>'error', 0=>'info', 1=>'success', 2=>'notify');
static $errors = [
-1 => 'error',
0 => 'info',
1 => 'success',
2 => 'notify',
];
$msgdata = array(
$msgdata = [
'msg' => $message,
'lvl' => $lvl,
'lvl' => $errors[$lvl],
'allow' => $allow,
'line' => $line,
'file' => $file,
);
];
$evt = new \dokuwiki\Extension\Event('INFOUTIL_MSG_SHOW', $msgdata);
if ($evt->advise_before()) {

View File

@ -3,8 +3,8 @@
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Nicolas Friedli <nicolas@theologique.ch>
* @author Schplurtz le Déboulonné <Schplurtz@laposte.net>
* @author Nicolas Friedli <nicolas@theologique.ch>
* @author PaliPalo <palipalo@hotmail.fr>
* @author Laurent Ponthieu <contact@coopindus.fr>
* @author Damien Regad <dregad@mantisbt.org>
@ -185,7 +185,7 @@ $lang['resendpwd'] = 'Définir un nouveau mot de passe pour';
$lang['resendpwdmissing'] = 'Désolé, vous devez remplir tous les champs.';
$lang['resendpwdnouser'] = 'Désolé, cet utilisateur n\'existe pas dans notre base de données.';
$lang['resendpwdbadauth'] = 'Désolé, ce code d\'authentification est invalide. Assurez-vous d\'avoir utilisé le lien de confirmation intégral.';
$lang['resendpwdconfirm'] = 'Un lien de confirmation a été expédié par courriel.';
$lang['resendpwdconfirm'] = 'Un lien de confirmation vient de partir par courriel.';
$lang['resendpwdsuccess'] = 'Votre nouveau mot de passe vous a été expédié par courriel.';
$lang['license'] = 'Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante :';
$lang['licenseok'] = 'Note : En modifiant cette page, vous acceptez que le contenu soit placé sous les termes de la licence suivante :';
@ -330,7 +330,8 @@ $lang['i_superuser'] = 'Super-utilisateur';
$lang['i_problems'] = 'L\'installateur a détecté les problèmes indiqués ci-dessous. Vous ne pouvez pas poursuivre l\'installation tant qu\'ils n\'auront pas été corrigés.';
$lang['i_modified'] = 'Pour des raisons de sécurité, ce script ne fonctionne qu\'avec une installation neuve et non modifiée de DokuWiki. Vous devriez ré-extraire les fichiers depuis le paquet téléchargé ou consulter les <a href="http://dokuwiki.org/install">instructions d\'installation de DokuWiki</a>';
$lang['i_funcna'] = 'La fonction PHP <code>%s</code> n\'est pas disponible. Peut-être que votre hébergeur web l\'a désactivée ?';
$lang['i_disabled'] = 'A été désactivé par votre fournisseur daccès.';
$lang['i_disabled'] = 'Elle a été désactivée par votre fournisseur daccès.';
$lang['i_funcnmail'] = '<b>Note:</b> La fonction PHP mail n\'est pas disponible. %s Si vous ne pouvez pas l\'activer, vous pourriez installer le <a href="http://dokuwiki.org/plugins/smtp">greffon smtp</a>.';
$lang['i_phpver'] = 'Votre version de PHP (%s) est antérieure à la version requise (%s). Vous devez mettre à jour votre installation de PHP.';
$lang['i_mbfuncoverload'] = 'Il faut désactiver mbstring.func_overload dans php.ini pour DokuWiki';
$lang['i_urandom'] = 'DokuWiki ne peut créer de nombres cryptographiquement sûrs pour les cookies. Vous voudrez peut-être vérifier que le réglage open_basedir dans php.ini permet l\'accès à <code>/dev/urandom</code>.';
@ -384,7 +385,7 @@ $lang['media_perm_upload'] = 'Désolé, vous n\'avez pas l\'autorisation d\'
$lang['media_update'] = 'Envoyer une nouvelle version';
$lang['media_restore'] = 'Restaurer cette version';
$lang['media_acl_warning'] = 'En raison des restrictions dans les ACL et de pages cachées, cette liste peut ne pas être complète.';
$lang['email_fail'] = 'La fonction PHP mail() est absente ou désactivée. Le message suivant na pas été envoyé:';
$lang['email_fail'] = 'La fonction PHP mail() est absente ou désactivée. Le message suivant nest pas parti :';
$lang['currentns'] = 'Catégorie courante';
$lang['searchresult'] = 'Résultat de la recherche';
$lang['plainhtml'] = 'HTML brut';

View File

@ -213,9 +213,9 @@ function noNSorNS($id) {
global $conf;
$p = noNS($id);
if ($p === $conf['start'] || $p === false) {
if ($p === $conf['start'] || $p === false || $p === '') {
$p = curNS($id);
if ($p === false) {
if ($p === false || $p === '') {
return $conf['start'];
}
}

View File

@ -1680,7 +1680,8 @@ function tpl_flush() {
* @param string[] $search locations to look at
* @param bool $abs if to use absolute URL
* @param array &$imginfo filled with getimagesize()
* @param bool $fallback use fallback image if target isn't found or return 'false' if potential false result is required
* @param bool $fallback use fallback image if target isn't found or return 'false' if potential
* false result is required
* @return string
*
* @author Andreas Gohr <andi@splitbrain.org>
@ -1702,16 +1703,16 @@ function tpl_getMediaFile($search, $abs = false, &$imginfo = null, $fallback = t
if(file_exists($file)) break;
}
// manage non existing target
if(!file_exists($file)) {
// give result for fallback image
if ($fallback === true) {
$file = DOKU_INC.'lib/images/blank.gif';
// stop process if false result is required (if $fallback is false)
} else {
return false;
}
}
// manage non existing target
if (!file_exists($file)) {
// give result for fallback image
if ($fallback === true) {
$file = DOKU_INC . 'lib/images/blank.gif';
// stop process if false result is required (if $fallback is false)
} else {
return false;
}
}
// fetch image data if requested
if(!is_null($imginfo)) {

View File

@ -3,8 +3,8 @@
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Nicolas Friedli <nicolas@theologique.ch>
* @author Schplurtz le Déboulonné <Schplurtz@laposte.net>
* @author Nicolas Friedli <nicolas@theologique.ch>
* @author PaliPalo <palipalo@hotmail.fr>
* @author Laurent Ponthieu <contact@coopindus.fr>
* @author Damien Regad <dregad@mantisbt.org>