Verified Commit 067b544d authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3313342 by Rajeshreeputra, idimopoulos, claudiu.cristea, deepakkm,...

Issue #3313342 by Rajeshreeputra, idimopoulos, claudiu.cristea, deepakkm, saidatom, afsch, xjm, Bhanu951: [PHP 8.1] Deprecated function: strpos(): Passing null to parameter #1 LayoutBuilderUiCacheContext.php on line 28

(cherry picked from commit 9dd37aa3)
parent c29c2b4a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -25,7 +25,11 @@ public static function getLabel() {
   * {@inheritdoc}
   */
  public function getContext() {
    return 'is_layout_builder_ui.' . (int) (strpos($this->routeMatch->getRouteName(), 'layout_builder.') !== 0);
    $route_name = $this->routeMatch->getRouteName();
    if ($route_name && str_starts_with($route_name, 'layout_builder.')) {
      return 'is_layout_builder_ui.0';
    }
    return 'is_layout_builder_ui.1';
  }

}