Use `\str_starts_with()` instead of `\strpos()` in WBB4xExporter
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 4 Mar 2022 11:00:59 +0000 (12:00 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 4 Mar 2022 11:00:59 +0000 (12:00 +0100)
files/lib/system/exporter/WBB4xExporter.class.php

index 1fa503954052dbec27c4c76d81dcc0c0300b092a..69d0db3c288a72a9ebf7e813016c954df69f5abc 100644 (file)
@@ -526,10 +526,10 @@ class WBB4xExporter extends AbstractExporter
                 'showOnTeamPage' => !empty($row['showOnTeamPage']) ? $row['showOnTeamPage'] : 0,
             ];
 
-            if (\strpos($row['groupName'], 'wcf.acp.group.group') === 0) {
+            if (\str_starts_with($row['groupName'], 'wcf.acp.group.group')) {
                 $i18nValues[] = $row['groupName'];
             }
-            if (\strpos($row['groupDescription'], 'wcf.acp.group.groupDescription') === 0) {
+            if (\str_starts_with($row['groupDescription'], 'wcf.acp.group.groupDescription')) {
                 $i18nValues[] = $row['groupDescription'];
             }
         }
@@ -1185,10 +1185,10 @@ class WBB4xExporter extends AbstractExporter
 
             $this->boardCache[$row['parentID']][] = $row;
 
-            if (\strpos($row['title'], 'wbb.board.board') === 0) {
+            if (\str_starts_with($row['title'], 'wbb.board.board')) {
                 $i18nValues[] = $row['title'];
             }
-            if (\strpos($row['description'], 'wbb.board.board') === 0) {
+            if (\str_starts_with($row['description'], 'wbb.board.board')) {
                 $i18nValues[] = $row['description'];
             }
         }
@@ -4223,10 +4223,10 @@ class WBB4xExporter extends AbstractExporter
                 'isDisabled' => $row['isDisabled'],
             ];
 
-            if (\strpos($row['title'], 'wcf.category') === 0) {
+            if (\str_starts_with($row['title'], 'wcf.category')) {
                 $i18nValues[] = $row['title'];
             }
-            if (\strpos($row['description'], 'wcf.category') === 0) {
+            if (\str_starts_with($row['description'], 'wcf.category')) {
                 $i18nValues[] = $row['description'];
             }
         }