X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FRevision%2FMainSlotRoleHandler.php;h=013910346db6e67b9f528cd6d572c38c7567333d;hb=7afced64454ad30d688540f7626448ac2faefebb;hp=6c6fdd6d05e36d63731606b134a133de18f0a581;hpb=93350da7f1ab397b87c3ac3073ddfc1c857b272e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Revision/MainSlotRoleHandler.php b/includes/Revision/MainSlotRoleHandler.php index 6c6fdd6d05..013910346d 100644 --- a/includes/Revision/MainSlotRoleHandler.php +++ b/includes/Revision/MainSlotRoleHandler.php @@ -86,10 +86,8 @@ class MainSlotRoleHandler extends SlotRoleHandler { // Hook can determine default model $title = Title::newFromLinkTarget( $page ); - if ( !Hooks::run( 'ContentHandlerDefaultModelFor', [ $title, &$model ] ) ) { - if ( !is_null( $model ) ) { - return $model; - } + if ( !Hooks::run( 'ContentHandlerDefaultModelFor', [ $title, &$model ] ) && !is_null( $model ) ) { + return $model; } // Could this page contain code based on the title? @@ -120,7 +118,7 @@ class MainSlotRoleHandler extends SlotRoleHandler { case 'json': return CONTENT_MODEL_JSON; default: - return is_null( $model ) ? CONTENT_MODEL_TEXT : $model; + return $model ?? CONTENT_MODEL_TEXT; } }