Replace `StringUtil::startsWith()` by `\str_starts_with()`
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 22 Sep 2021 13:52:34 +0000 (15:52 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 22 Sep 2021 13:52:34 +0000 (15:52 +0200)
files/lib/system/exporter/Kunena3xExporter.class.php
files/lib/system/exporter/MyBB16xExporter.class.php
files/lib/system/exporter/PhpBB31xExporter.class.php
files/lib/system/exporter/VB3or4xExporter.class.php
files/lib/system/exporter/VB5xExporter.class.php

index eeea5f3961b636c0951891b08b31cef566803937..4912915477ecac22152f1068c0bbc80d1087b199 100644 (file)
@@ -263,11 +263,11 @@ class Kunena3xExporter extends AbstractExporter
             // update password hash
             if ($newUserID) {
                 $password = 'joomla3:' . $row['password'];
-                if (StringUtil::startsWith($row['password'], '$1')) {
+                if (\str_starts_with($row['password'], '$1')) {
                     $password = 'cryptMD5:' . $row['password'];
-                } elseif (StringUtil::startsWith($row['password'], '$2')) {
+                } elseif (\str_starts_with($row['password'], '$2')) {
                     $password = 'Bcrypt:' . $row['password'];
-                } elseif (StringUtil::startsWith($row['password'], '$P')) {
+                } elseif (\str_starts_with($row['password'], '$P')) {
                     $password = 'phpass:' . $row['password'];
                 }
 
index 1d0e8d98a6af10bdaf568b2ed73dcac85f9df361..9a4bf3927a133c547a339e9dc194512249a9df31 100644 (file)
@@ -1008,7 +1008,7 @@ class MyBB16xExporter extends AbstractExporter
             $statement->execute(['uploadspath']);
             $row = $statement->fetchArray();
             $uploadsPath = $row['value'];
-            if (!StringUtil::startsWith($uploadsPath, '/')) {
+            if (!\str_starts_with($uploadsPath, '/')) {
                 $uploadsPath = \realpath($this->fileSystemPath . $uploadsPath);
             }
         }
index 4d8c6c573e7a5e3f40272583bf444f2427406c90..34f5ecde5068ef62104a76a604935a39ef94b61d 100644 (file)
@@ -455,9 +455,9 @@ class PhpBB31xExporter extends AbstractExporter
 
             // update password hash
             if ($newUserID) {
-                if (StringUtil::startsWith($row['user_password'], '$2')) {
+                if (\str_starts_with($row['user_password'], '$2')) {
                     $password = 'Bcrypt:' . $row['user_password'];
-                } elseif (StringUtil::startsWith($row['user_password'], '$argon2')) {
+                } elseif (\str_starts_with($row['user_password'], '$argon2')) {
                     $password = 'argon2:' . $row['user_password'];
                 } else {
                     $password = 'phpbb3:' . $row['user_password'] . ':';
index b9bf335eece1279405d5cf0d6285a30c1e29246a..606aac9402be449edbef80cc64e547b4a1e0d716 100644 (file)
@@ -266,7 +266,7 @@ class VB3or4xExporter extends AbstractExporter
         ) {
             if ($this->readOption('attachfile') != self::ATTACHFILE_DATABASE) {
                 $path = $this->readOption('attachpath');
-                if (!StringUtil::startsWith($path, '/')) {
+                if (!\str_starts_with($path, '/')) {
                     $path = \realpath($this->fileSystemPath . $path);
                 }
                 if (!\is_dir($path)) {
@@ -278,7 +278,7 @@ class VB3or4xExporter extends AbstractExporter
         if (\in_array('com.woltlab.wcf.user.avatar', $this->selectedData)) {
             if ($this->readOption('usefileavatar')) {
                 $path = $this->readOption('avatarpath');
-                if (!StringUtil::startsWith($path, '/')) {
+                if (!\str_starts_with($path, '/')) {
                     $path = \realpath($this->fileSystemPath . $path);
                 }
                 if (!\is_dir($path)) {
@@ -766,7 +766,7 @@ class VB3or4xExporter extends AbstractExporter
             try {
                 if ($this->readOption('usefileavatar')) {
                     $file = $this->readOption('avatarpath');
-                    if (!StringUtil::startsWith($file, '/')) {
+                    if (!\str_starts_with($file, '/')) {
                         $file = \realpath($this->fileSystemPath . $file);
                     }
                     $file = FileUtil::addTrailingSlash($file) . 'avatar' . $row['userid'] . '_' . $row['avatarrevision'] . '.gif';
@@ -2014,7 +2014,7 @@ class VB3or4xExporter extends AbstractExporter
                             break;
                         case self::ATTACHFILE_FILESYSTEM:
                             $file = $this->readOption('attachpath');
-                            if (!StringUtil::startsWith($file, '/')) {
+                            if (!\str_starts_with($file, '/')) {
                                 $file = \realpath($this->fileSystemPath . $file);
                             }
                             $file = FileUtil::addTrailingSlash($file);
@@ -2022,7 +2022,7 @@ class VB3or4xExporter extends AbstractExporter
                             break;
                         case self::ATTACHFILE_FILESYSTEM_SUBFOLDER:
                             $file = $this->readOption('attachpath');
-                            if (!StringUtil::startsWith($file, '/')) {
+                            if (!\str_starts_with($file, '/')) {
                                 $file = \realpath($this->fileSystemPath . $file);
                             }
                             $file = FileUtil::addTrailingSlash($file);
@@ -2038,7 +2038,7 @@ class VB3or4xExporter extends AbstractExporter
                         case self::GALLERY_FILESYSTEM:
                         case self::GALLERY_FILESYSTEM_DIRECT_THUMBS:
                             $file = $this->readOption('album_picpath');
-                            if (!StringUtil::startsWith($file, '/')) {
+                            if (!\str_starts_with($file, '/')) {
                                 $file = \realpath($this->fileSystemPath . $file);
                             }
                             $file = FileUtil::addTrailingSlash($file);
@@ -2489,7 +2489,7 @@ class VB3or4xExporter extends AbstractExporter
                         break;
                     case self::ATTACHFILE_FILESYSTEM:
                         $file = $this->readOption('attachpath');
-                        if (!StringUtil::startsWith($file, '/')) {
+                        if (!\str_starts_with($file, '/')) {
                             $file = \realpath($this->fileSystemPath . $file);
                         }
                         $file = FileUtil::addTrailingSlash($file);
@@ -2497,7 +2497,7 @@ class VB3or4xExporter extends AbstractExporter
                         break;
                     case self::ATTACHFILE_FILESYSTEM_SUBFOLDER:
                         $file = $this->readOption('attachpath');
-                        if (!StringUtil::startsWith($file, '/')) {
+                        if (!\str_starts_with($file, '/')) {
                             $file = \realpath($this->fileSystemPath . $file);
                         }
                         $file = FileUtil::addTrailingSlash($file);
index 1973e2a7caed95969e55c38098a40932ca7842e0..d3506b6877dc2893905d25715feb82d2b358236c 100644 (file)
@@ -457,9 +457,9 @@ class VB5xExporter extends AbstractExporter
 
             // update password hash
             if ($newUserID) {
-                if (StringUtil::startsWith($row['scheme'], 'blowfish')) {
+                if (\str_starts_with($row['scheme'], 'blowfish')) {
                     $password = 'Bcrypt:' . $row['token'];
-                } elseif (StringUtil::startsWith($row['scheme'], 'argon2')) {
+                } elseif (\str_starts_with($row['scheme'], 'argon2')) {
                     $password = 'argon2:' . $row['token'];
                 } elseif ($row['scheme'] == 'legacy') {
                     $password = 'vb5:' . \implode(':', \explode(' ', $row['token'], 2));
@@ -504,7 +504,7 @@ class VB5xExporter extends AbstractExporter
                 // TODO: not yet supported
                 if (false && $this->readOption('usefileavatar')) {
                     $file = $this->readOption('avatarpath');
-                    if (!StringUtil::startsWith($file, '/')) {
+                    if (!\str_starts_with($file, '/')) {
                         $file = \realpath($this->fileSystemPath . $file);
                     }
                     $file = FileUtil::addTrailingSlash($file) . 'avatar' . $row['userid'] . '_' . $row['avatarrevision'] . '.gif';