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

Fix plugin need self declared mode in plxMotorDemarrageEnd hook #803

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions core/lib/class.plx.motor.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class plxMotor {
public $motif = false; # Motif de recherche
public $mode = false; # Mode de traitement
public $template = false; # Template d'affichage
public $cible = false; # Article, categorie ou page statique cible
public $cibleName = null; # Tag label
public $cible = false; # Article, categorie ou page statique cible
public $cibleName = null; # Tag label

public $activeCats = false; # Liste des categories actives sous la forme 001|002|003 etc
public $homepageCats = false; # Liste des categories à afficher sur la page d'accueil sous la forme 001|002|003 etc
Expand Down Expand Up @@ -163,7 +163,7 @@ public function prechauffage() {

# Hook plugins
if(eval($this->plxPlugins->callHook('plxMotorPreChauffageBegin'))) {
# En cas de succès, le hook doit gérer $this->mode et $this->template.
# En cas de succès, doit gérer $this->mode et $this->template. Appeler $this->error404() en cas d'erreur.
return;
}

Expand Down Expand Up @@ -459,22 +459,8 @@ public function demarrage() {
case 'static' :
case 'telechargement' :
case 'erreur' :
break;
default :
# rétro-compatibilité pour plugins orphelins qui ne gérent pas le hook plxMotorDemarrageBegin !!!
# Supprimer ce test dès que possible et appeler directement $this->erro404(...)
if(
!preg_match('#^(?:\.\./)*' . $this->aConf['racine_plugins'] . '([^/]+)#', $this->cible, $matches) or
!array_key_exists($matches[1], $this->plxPlugins->aPlugins) or
empty(array_filter(
$this->plxPlugins->aHooks['plxMotorPreChauffageBegin'],
function($value) use($matches) {
return ($value['class'] == $matches[1]);
}
))
) {
$this->error404(L_ERR_PAGE_NOT_FOUND);
}
break;
}

# Hook plugins
Expand Down