[BUGFIX] Check $prefix in ActionTask 20/58320/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 18 Sep 2018 18:43:33 +0000 (20:43 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 18 Sep 2018 20:09:33 +0000 (22:09 +0200)
Check if the prefix is not an empty string to avoid a warning thrown by
strpos().

Resolves: #86300
Related: #85477
Releases: master
Change-Id: I68a1fc83745594524c088600258c2925eccf3015
Reviewed-on: https://review.typo3.org/58320
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/sys_action/Classes/ActionTask.php

index 824c9ba..524b83b 100644 (file)
@@ -621,7 +621,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
     protected function fixUsername($username, $prefix)
     {
         $prefix = trim($prefix);
-        if (strpos($username, $prefix) === 0) {
+        if ($prefix !== '' && strpos($username, $prefix) === 0) {
             $username = substr($username, strlen($prefix));
         }
         return $prefix . $username;