Skip to content

Commit

Permalink
Function create_function() is deprecated #326
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrocadete committed Sep 13, 2019
1 parent 751a42e commit 9f60351
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/admin/article.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
if(isset($_POST['draft']) AND !in_array('draft',$_POST['catId'])) array_unshift($_POST['catId'], 'draft');
# si aucune catégorie sélectionnée on place l'article dans la catégorie "non classé"
if(sizeof($_POST['catId'])==1 AND $_POST['catId'][0]=='draft') $_POST['catId'][]='000';
else $_POST['catId'] = array_filter($_POST['catId'], create_function('$a', 'return $a!="000";'));
else $_POST['catId'] = array_filter($_POST['catId'], function($a){return $a!="000";});
# Si demande de publication ou demande de validation, on supprime la catégorie draft si elle existe
if((isset($_POST['update']) OR isset($_POST['publish']) OR isset($_POST['moderate'])) AND isset($_POST['catId'])) $_POST['catId'] = array_filter($_POST['catId'], create_function('$a', 'return $a!="draft";'));
if((isset($_POST['update']) OR isset($_POST['publish']) OR isset($_POST['moderate'])) AND isset($_POST['catId'])) $_POST['catId'] = array_filter($_POST['catId'], function($a){return $a!="draft";});
# Si profil PROFIL_WRITER on vérifie l'id du rédacteur connecté et celui de l'article
if($_SESSION['profil']==PROFIL_WRITER AND isset($_POST['author']) AND $_SESSION['user']!=$_POST['author']) $_POST['author']=$_SESSION['user'];
# Si profil PROFIL_WRITER on vérifie que l'article n'est pas celui d'un autre utilisateur
Expand Down
4 changes: 2 additions & 2 deletions core/lib/class.plx.admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ public function editCategories($content, $action=false) {
}
}
# On va trier les clés selon l'ordre choisi
if(sizeof($this->aCats)>0) uasort($this->aCats, create_function('$a, $b', 'return $a["ordre"]>$b["ordre"];'));
if(sizeof($this->aCats)>0) uasort($this->aCats, function($a, $b){return $a["ordre"]>$b["ordre"];});
}
# sauvegarde
if($action) {
Expand Down Expand Up @@ -721,7 +721,7 @@ public function editStatiques($content, $action=false) {
}
}
# On va trier les clés selon l'ordre choisi
if(sizeof($this->aStats)>0) uasort($this->aStats, create_function('$a, $b', 'return $a["ordre"]>$b["ordre"];'));
if(sizeof($this->aStats)>0) uasort($this->aStats, function($a, $b){return $a["ordre"]>$b["ordre"];});
}
# sauvegarde
if($action) {
Expand Down
1 change: 1 addition & 0 deletions readme/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ FIX #318 L_NEW_CATEGORY en doublon pour certaines langues (P3ter)
FIX #322 plxDate::getCalendar() ne retourne jamais L_SUNDAY (jerrywham, P3ter)
FIX #323 La fonction plxUtils::printSelect ne fonctione pas avec un "selected" de type numérique (Philippe-M)
FIX #324 Correction couleur des selecteurs si le theme du navigateur est inversé (sudwebdesign)
FIX #326 Remplacement de "create_function()" déprécié depuis PHP 5.3 (faille et dégradation des performances) (P3ter)

## PLUXML 5.7 (sortie : 11/12/2018) ##

Expand Down

0 comments on commit 9f60351

Please sign in to comment.