Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tentative de renommer le nom mal-formé d'un dossier de plugin (from Github for E.G.) #477

Merged
merged 22 commits into from Sep 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -2,10 +2,10 @@ PluXml
======
Créez un site web performant en toute simplicité et sans base de données.

[**Télécharger PluXml 5.8.3**](https://www.pluxml.org/download/pluxml-latest.zip) (zip)
[**Télécharger PluXml 5.8.4**](https://www.pluxml.org/download/pluxml-latest.zip) (zip)

* Stable version (5.8.3) : [v5.8.3](https://github.com/pluxml/PluXml/releases/tag/v5.8.3)
* Next version (5.8.3) : [master](https://github.com/pluxml/PluXml/tree/master)
* Stable version (5.8.4) : [v5.8.4](https://github.com/pluxml/PluXml/releases/tag/v5.8.4)
* Next version (6.0.0-dev) : [master](https://github.com/pluxml/PluXml/tree/master)

Principales caractéristiques
----------------------------
Expand Down
38 changes: 18 additions & 20 deletions core/admin/medias.php
Expand Up @@ -151,20 +151,18 @@
<div class="inline-form action-bar">
<h2><?= L_MEDIAS_TITLE ?></h2>
<p id="medias-breadcrumb">
<?= L_MEDIAS_DIRECTORY ?> : <a href="javascript:void(0)" data-folder=".">(<?= L_PLXMEDIAS_ROOT ?>)</a> /
<?php
if($curFolders) {
$path='';
foreach($curFolders as $id => $folder) {
if(!empty($folder) AND $id>1) {
$path .= $folder . '/';
?>
<a href="javascript:void(0)" data-folder="<?= $path ?>"><?= $folder ?></a> /
<?php
}
}
}
?>
<?php
echo L_MEDIAS_DIRECTORY.' : <a href="javascript:void(0)" onclick="document.forms[1].folder.value=\'.\';document.forms[1].submit();return true;" title="'.L_PLXMEDIAS_ROOT.'">('.L_PLXMEDIAS_ROOT.')</a> / ';
if($curFolders) {
$path='';
foreach($curFolders as $id => $folder) {
if(!empty($folder) AND $id>1) {
$path .= $folder.'/';
echo '<a href="javascript:void(0)" onclick="document.forms[1].folder.value=\''.$path.'\';document.forms[1].submit();return true;" title="'.$folder.'">'.$folder.'</a> / ';
}
}
}
?>
</p>
<?php plxUtils::printSelect('selection', $selectionList, '', false, 'no-margin', 'id_selection') ?>
<input type="submit" name="btn_ok" value="<?= L_OK ?>" onclick="return confirmAction(this.form, 'id_selection', 'delete', 'idFile[]', '<?= L_CONFIRM_DELETE ?>')" />
Expand Down Expand Up @@ -193,11 +191,11 @@
<tr>
<th class="checkbox"><input type="checkbox" onclick="checkAll(this.form, 'idFile[]')" /></th>
<th>&nbsp;</th>
<th class="sort"><?= L_MEDIAS_FILENAME ?></th>
<th class="sort"><?= L_MEDIAS_EXTENSION ?></th>
<th class="sort integer"><?= L_MEDIAS_FILESIZE ?></th>
<th class="sort integer"><?= L_MEDIAS_DIMENSIONS ?></th>
<th class="sort integer active"><?= L_DATE ?></th>
<th><a href="javascript:void(0)" class="hcolumn" onclick="document.forms[1].sort.value='<?= $sort_title ?>';document.forms[1].submit();return true;"><?= L_MEDIAS_FILENAME ?></a></th>
<th><?= L_MEDIAS_EXTENSION ?></th>
<th><?= L_MEDIAS_FILESIZE ?></th>
<th><?= L_MEDIAS_DIMENSIONS ?></th>
<th><a href="javascript:void(0)" class="hcolumn" onclick="document.forms[1].sort.value='<?= $sort_date ?>';document.forms[1].submit();return true;"><?= L_MEDIAS_DATE ?></a></th>
</tr>
</thead>
<tbody id="medias-table-tbody">
Expand Down Expand Up @@ -311,7 +309,7 @@
</p>

<div>
<input id="selector_0" type="file" multiple="multiple" name="selector_0[]" />
<input id="selector_0" type="file" multiple="multiple" name="selector_0[]" accept="image/*,audio/*,video/*,.pdf,.zip" />
<div class="files_list" id="files_list" style="margin: 1rem 0 1rem 0;"></div>
</div>

Expand Down
13 changes: 8 additions & 5 deletions core/admin/theme/css/theme.css
Expand Up @@ -621,6 +621,7 @@ a.hint:focus span {
top: -18rem;
right: 25rem;
left: 25rem;
width: 60%;
margin: 0;
padding: 0.5rem 0;
line-height: 1.6;
Expand Down Expand Up @@ -786,16 +787,18 @@ th.sort.active::after {
}

.modal__box {
position: relative;
text-align: center;
position: relative;
text-align: center;
border: 1px solid #666;
background-color: #fff;
}

.modal input {
position: absolute;
right: 100px;
top: 30px;
z-index: -10;
display: none;
z-index: -10;
}

.modal label {
Expand Down Expand Up @@ -830,8 +833,8 @@ th.sort.active::after {
}

.modal__box img {
max-height: 100vh;
max-width: 100vw;
max-height: calc(100vh - 1.25rem);
max-width: calc(100vw - 1.25rem);
}

.modal__overlay {
Expand Down
3 changes: 3 additions & 0 deletions core/lang/de/core.php
Expand Up @@ -104,6 +104,9 @@
const L_NEWCOMMENT_FIELDS_REQUIRED = 'Sie müssen alle Pflichtfelder ausfüllen';
const L_NEWCOMMENT_ERR_ANTISPAM = 'Anti-SPAM Überprüfung fehlgeschlagen';

# class.plx.plugins.php
const L_BAD_PLUGIN_FOLDER = 'Der %s Plugin-Ordner kann nicht umbenannt werden';

# class.plx.show.php

const L_HTTPENCODING = 'Datenkompression %s aktiviert';
Expand Down
3 changes: 3 additions & 0 deletions core/lang/en/core.php
Expand Up @@ -104,6 +104,9 @@
const L_NEWCOMMENT_FIELDS_REQUIRED = 'Please fill all the required fields';
const L_NEWCOMMENT_ERR_ANTISPAM = 'Antispam verification failed';

# class.plx.plugins.php
const L_BAD_PLUGIN_FOLDER = 'Unable to rename the folder for the %s plugin';

# class.plx.show.php

const L_HTTPENCODING = 'Compression %s activated';
Expand Down
3 changes: 3 additions & 0 deletions core/lang/es/core.php
Expand Up @@ -104,6 +104,9 @@
const L_NEWCOMMENT_FIELDS_REQUIRED = 'Ingrese todos los campos obligatorios';
const L_NEWCOMMENT_ERR_ANTISPAM = 'Falló La comprobación anti-spam';

# class.plx.plugins.php
const L_BAD_PLUGIN_FOLDER = 'no se puede cambiar el nombre de la carpeta para el complemento %s';

# class.plx.show.php

const L_HTTPENCODING = 'Compresión %s activada';
Expand Down
5 changes: 4 additions & 1 deletion core/lang/fr/core.php
Expand Up @@ -104,8 +104,10 @@
const L_NEWCOMMENT_FIELDS_REQUIRED = 'Merci de remplir tous les champs obligatoires';
const L_NEWCOMMENT_ERR_ANTISPAM = 'La vérification anti-spam a échoué';

# class.plx.show.php
# class.plx.plugins.php
const L_BAD_PLUGIN_FOLDER = 'Impossible de renommer le dossier du plugin %s';

# class.plx.show.php
const L_HTTPENCODING = 'Compression %s activée';
const L_ARCHIVES = 'Archives';
const L_TAG = 'Mot-clé';
Expand Down Expand Up @@ -155,4 +157,5 @@
const L_ART_NEXT = 'Suivant';
const L_ART_LAST = 'Dernier';
const L_ART_UP = 'Remonter';

?>
3 changes: 3 additions & 0 deletions core/lang/it/core.php
Expand Up @@ -104,6 +104,9 @@
const L_NEWCOMMENT_FIELDS_REQUIRED = 'Compilare tutti i campi obbligatori';
const L_NEWCOMMENT_ERR_ANTISPAM = 'Verifica anti-spam fallita';

# class.plx.plugins.php
const L_BAD_PLUGIN_FOLDER = 'impossibile rinominare la cartella per il plugin %s';

# class.plx.show.php

const L_HTTPENCODING = 'Compressione %s attivata';
Expand Down
3 changes: 3 additions & 0 deletions core/lang/nl/core.php
Expand Up @@ -103,6 +103,9 @@
const L_NEWCOMMENT_FIELDS_REQUIRED = 'Gelieve alle verplichte velden in te vullen a.u.b.';
const L_NEWCOMMENT_ERR_ANTISPAM = 'La vérification anti-spam a échoué';

# class.plx.plugins.php
const L_BAD_PLUGIN_FOLDER = 'kan de map voor de %s plug-in niet hernoemen';

# class.plx.show.php

const L_HTTPENCODING = '%s compressie is geactiveerd';
Expand Down
3 changes: 3 additions & 0 deletions core/lang/oc/core.php
Expand Up @@ -104,6 +104,9 @@
const L_NEWCOMMENT_FIELDS_REQUIRED = 'Mercés d\'emplir totes los camps obligatòris requesits';
const L_NEWCOMMENT_ERR_ANTISPAM = 'La verificacion anti-spam s\'es abocada';

# class.plx.plugins.php
const L_BAD_PLUGIN_FOLDER = 'Unable to rename the folder for the %s plugin';

# class.plx.show.php

const L_HTTPENCODING = 'Compression %s activada';
Expand Down
3 changes: 3 additions & 0 deletions core/lang/pl/core.php
Expand Up @@ -104,6 +104,9 @@
const L_NEWCOMMENT_FIELDS_REQUIRED = 'Proszę wypełnić wszystkie wymagane pola';
const L_NEWCOMMENT_ERR_ANTISPAM = 'Błędna weryfikacja antyspamowa';

# class.plx.plugins.php
const L_BAD_PLUGIN_FOLDER = 'nie można zmienić nazwy folderu dla wtyczki %s';

# class.plx.show.php

const L_HTTPENCODING = 'Kompresja %s aktywna';
Expand Down
3 changes: 3 additions & 0 deletions core/lang/pt/core.php
Expand Up @@ -104,6 +104,9 @@
const L_NEWCOMMENT_FIELDS_REQUIRED = 'Queira por favor preenchêr todos os campos obrigatórios';
const L_NEWCOMMENT_ERR_ANTISPAM = 'A verificação anti-spam está incorrecta, tente novamente;';

# class.plx.plugins.php
const L_BAD_PLUGIN_FOLDER = 'incapaz de renomear a pasta para o plugin %s';

# class.plx.show.php

const L_HTTPENCODING = 'Compressão %s activada';
Expand Down
3 changes: 3 additions & 0 deletions core/lang/ro/core.php
Expand Up @@ -104,6 +104,9 @@
const L_NEWCOMMENT_FIELDS_REQUIRED = 'Va multumim completati toate campurile obligatorii';
const L_NEWCOMMENT_ERR_ANTISPAM = 'SPAM de verificare a esuat';

# class.plx.plugins.php
const L_BAD_PLUGIN_FOLDER = 'incapabil să redenumească folderul pentru pluginul %s';

# class.plx.show.php

const L_HTTPENCODING = 'Compresie %s activata';
Expand Down
3 changes: 3 additions & 0 deletions core/lang/ru/core.php
Expand Up @@ -104,6 +104,9 @@
const L_NEWCOMMENT_FIELDS_REQUIRED = 'Пожалуйста, заполните все необходимые поля';
const L_NEWCOMMENT_ERR_ANTISPAM = 'Ошибка проверки Антиспам';

# class.plx.plugins.php
const L_BAD_PLUGIN_FOLDER = 'Не удается переименовать папку плагина %s';

# class.plx.show.php

const L_HTTPENCODING = 'Сжатие %s активированно';
Expand Down
2 changes: 1 addition & 1 deletion core/lib/class.plx.admin.php
Expand Up @@ -28,7 +28,7 @@ class plxAdmin extends plxMotor {
* @return self return une instance de la classe plxAdmin
* @author Stephane F, Jean-Pierre Pourerz "Bazooka07"
**/
public static function getInstance(){
public static function getInstance() {
if (empty(parent::$instance))
parent::$instance = new plxAdmin(path('XMLFILE_PARAMETERS'));
return parent::$instance;
Expand Down
1 change: 1 addition & 0 deletions core/lib/class.plx.feed.php
Expand Up @@ -10,6 +10,7 @@
const PLX_FEED = true;

class plxFeed extends plxMotor {

const FORMAT_DATE = 'YmdHi';

/**
Expand Down
6 changes: 5 additions & 1 deletion core/lib/class.plx.medias.php
Expand Up @@ -136,13 +136,17 @@ function($item) { return !preg_match('@\.tb\.\w+$@', $item); } # On rejette les
$imgSize = false;
}
$stats = stat($filename);
$extension = '.' . strtolower(pathinfo($filename, PATHINFO_EXTENSION));
if($extension == '.svg') {
$defaultSample = $filename;
}
$files[basename($filename)] = array(
'.thumb' => (!empty($sampleOk)) ? $sample : $defaultSample,
'name' => basename($filename),
'path' => $filename,
'date' => $stats['mtime'],
'filesize' => $stats['size'],
'extension' => '.' . strtolower(pathinfo($filename, PATHINFO_EXTENSION)),
'extension' => $extension,
'infos' => $imgSize,
'thumb' => $thumbInfos
);
Expand Down
4 changes: 3 additions & 1 deletion core/lib/class.plx.motor.php
Expand Up @@ -110,7 +110,7 @@ class plxMotor {
public $plxErreur = null; # Objet plxErreur
public $plxPlugins = null; # Objet plxPlugins

protected static $instance = null; // protected is required by plxAdmin
protected static $instance = null;

/**
* Méthode qui se charger de créer le Singleton plxMotor
Expand Down Expand Up @@ -217,6 +217,8 @@ public function prechauffage() {
# Hook plugins
if(eval($this->plxPlugins->callHook('plxMotorPreChauffageBegin'))) return;

if(!empty($this->get) and !preg_match('#^(?:blog|article\d|static\d|categorie\d|archives\d{4}|tag\w|preview|telechargement|download)#', $this->get)) { $this->get = ''; }

if(!$this->get AND $this->aConf['homestatic']!='' AND isset($this->aStats[$this->aConf['homestatic']]) AND $this->aStats[$this->aConf['homestatic']]['active']) {
$this->mode = 'static'; # Mode static
$this->cible = $this->aConf['homestatic'];
Expand Down
16 changes: 13 additions & 3 deletions core/lib/class.plx.plugins.php
Expand Up @@ -7,6 +7,8 @@
**/
class plxPlugins {

const VERSION_PATTERN = '@-\d+\.\d+(?:\.\d+)?@';

public $aHooks=array(); # tableau de tous les hooks des plugins à executer
public $aPlugins=array(); #tableau contenant les plugins
public $default_lang; # langue par defaut utilisée par PluXml
Expand Down Expand Up @@ -162,9 +164,17 @@ public function getInactivePlugins() {

$aPlugins = array();
$dirs = plxGlob::getInstance(PLX_PLUGINS, true);
if(sizeof($dirs->aFiles)>0) {
foreach($dirs->aFiles as $plugName) {
if(!isset($this->aPlugins[$plugName]) AND $plugInstance=$this->getInstance($plugName)) {
if(sizeof($dirs->aFiles) > 0) {
foreach($dirs->aFiles as $dirName) {
$plugName = preg_replace(self::VERSION_PATTERN, '', $dirName);
if($plugName != $dirName) {
if(is_dir(PLX_PLUGINS . $plugName) || !rename(PLX_PLUGINS . $dirName, PLX_PLUGINS . $plugName)) {
plxMsg::Error(sprintf(L_BAD_PLUGIN_FOLDER, $dirName));
continue;
}
}

if(!isset($this->aPlugins[$plugName]) AND $plugInstance = $this->getInstance($dirName)) {
$plugInstance->getInfos();
$aPlugins[$plugName] = $plugInstance;
}
Expand Down
3 changes: 2 additions & 1 deletion core/lib/class.plx.updater.php
Expand Up @@ -39,7 +39,8 @@ class plxUpdater {
'5.8',
'5.8.1',
'5.8.2',
'5.8.3'
'5.8.3',
'5.8.4'
);

public $newVersion = false;
Expand Down
25 changes: 13 additions & 12 deletions core/lib/class.plx.utils.php
Expand Up @@ -515,20 +515,19 @@ public static function translitterate($str, $reverse=false) {
}

/**
* Method to transform a string in a valid URL using translitteration
* @param string $strchaine de caractères à contrôler
* @param boolean $remove retire les mots sans valeur sémantique
* @param string $replace
* @param boolean $lower
* Transform a string in a valid URL using transliteration
*
* @param string $url characters string to clean
* @param boolean $remove set true to remove non-semantic word
* @param string $replace the character used to clean the URL
* @param boolean $lower set true to lower characters
* @return string valid URL
* @author J.P. Pourrez (bazooka07)
* @author J.P. Pourrez (bazooka07), Pedro (P3ter) CADETE
* */
public static function urlify($url, $replace='-', $lower=true) {

$scheme = parse_url($url, PHP_URL_SCHEME);
if(!empty($scheme)) {
if($scheme == 'data') { return $url; }
$url = substr($url, strlen($scheme) + 3); // http://
if(!empty(parse_url($url, PHP_URL_SCHEME))) {
return $url;
}

$clean_url = self::translitterate(trim(html_entity_decode($url)));
Expand All @@ -546,9 +545,11 @@ public static function urlify($url, $replace='-', $lower=true) {
// remove non-alphanumeric character
$clean_url = trim(preg_replace('@[^\w\.-]+@', '', $clean_url), '-');

if($lower) { $clean_url = strtolower($clean_url); }
if($lower) {
$clean_url = strtolower($clean_url);
}

return (empty($scheme)) ? $clean_url : $scheme . '://' . $clean_url;
return $clean_url;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions core/lib/config.php
Expand Up @@ -2,10 +2,10 @@

if(!defined('PLX_ROOT')) { exit('Missing PLX_ROOT'); }

const PHP_VERSION_MIN = '5.6.0';
const PHP_VERSION_MIN = '7.2.0';

const PLX_DEBUG = false;
const PLX_VERSION = '5.8.3';
const PLX_VERSION = '6.0.0-dev';
const PLX_URL_REPO = 'https://www.pluxml.org';
const PLX_URL_RESSOURCES = 'https://ressources.pluxml.org';
const PLX_URL_VERSION = PLX_URL_REPO.'/download/latest-version.txt';
Expand Down
4 changes: 2 additions & 2 deletions install.php
Expand Up @@ -218,8 +218,8 @@ function install($content, $config) {
<meta charset="<?= strtolower(PLX_CHARSET) ?>" />
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
<title><?= L_PLUXML_INSTALLATION . ' ' . L_VERSION . ' ' . PLX_VERSION ?></title>
<link rel="stylesheet" type="text/css" href="<?= PLX_ADMIN_PATH ?>theme/plucss.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?= PLX_ADMIN_PATH ?>theme/theme.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?= PLX_ADMIN_PATH ?>theme/css/plucss.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?= PLX_ADMIN_PATH ?>theme/css/theme.css" media="screen" />
<script src="<?= PLX_CORE ?>lib/visual.js"></script>
</head>
<body>
Expand Down