[BUGFIX] Use correct implode(string, array) syntax 41/62741/3
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 18 Dec 2019 13:56:41 +0000 (14:56 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 18 Dec 2019 15:36:34 +0000 (16:36 +0100)
The usage of implode(array, string) has been marked as
deprecated by PHP and triggers PHP Deprecation warnings
by using PHP 7.4.

Resolves: #89987
Releases: master, 9.5
Change-Id: I4094744bd067203856dc305bb7e1651797d0c959
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62741
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Markus Klösges <mkloesges@gmx.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/TimeTracker/TimeTracker.php
typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php
typo3/sysext/indexed_search/Classes/Indexer.php
typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateConstantEditorModuleFunctionController.php

index e92d607..06d9787 100644 (file)
@@ -425,7 +425,7 @@ class TimeTracker implements SingletonInterface
                 $temp = array_reverse($temp);
                 array_pop($temp);
                 if (!empty($temp)) {
-                    $keyLabel = '<br /><span style="color:#999999;">' . implode($temp, '<br />') . '</span>';
+                    $keyLabel = '<br /><span style="color:#999999;">' . implode('<br />', $temp) . '</span>';
                 }
             }
             if ($flag_tree) {
@@ -469,7 +469,7 @@ class TimeTracker implements SingletonInterface
                 $msgArr[] = nl2br($data['content']);
             }
             if (!empty($msgArr)) {
-                $msg = implode($msgArr, '<hr />');
+                $msg = implode('<hr />', $msgArr);
             }
             $item .= '<td class="typo3-adminPanel-table-cell-content">' . $this->fw($msg) . '</td>';
             $out .= '<tr>' . $item . '</tr>';
index 7034085..df5b4bb 100644 (file)
@@ -769,7 +769,7 @@ class ExtendedTemplateService extends TemplateService
                 }
             }
         }
-        $output = implode($cArr, '<br />') . '<br />';
+        $output = implode('<br />', $cArr) . '<br />';
         return $output;
     }
 
@@ -1254,7 +1254,7 @@ class ExtendedTemplateService extends TemplateService
             if (count($parts) === 2) {
                 $parts[1] = $theValue;
             }
-            $this->raw[$lineNum] = implode($parts, '=');
+            $this->raw[$lineNum] = implode('=', $parts);
         } else {
             $this->raw[] = $key . ' =' . $theValue;
         }
index e2ed9f9..f84d90a 100644 (file)
@@ -1102,7 +1102,7 @@ class Indexer
                             $this->log_pull();
                             if (is_array($contentParts)) {
                                 // Calculating a hash over what is to be the actual content. (see indexTypo3PageContent())
-                                $content_md5h = IndexedSearchUtility::md5inthash(implode($contentParts, ''));
+                                $content_md5h = IndexedSearchUtility::md5inthash(implode('', $contentParts));
                                 if ($this->checkExternalDocContentHash($phash_arr['phash_grouping'], $content_md5h) || $force) {
                                     // Increment counter:
                                     $this->externalFileCounter++;
index c9718a6..af69833 100644 (file)
@@ -148,12 +148,12 @@ class TemplateAnalyzerModuleFunctionController
         $this->templateService->clearList_setup_temp = array_flip($this->templateService->clearList_setup);
         $pointer = count($this->templateService->hierarchyInfo);
         $hierarchyInfo = $this->templateService->ext_process_hierarchyInfo([], $pointer);
-        $assigns['hierarchy'] = implode(array_reverse($this->templateService->ext_getTemplateHierarchyArr(
+        $assigns['hierarchy'] = implode('', array_reverse($this->templateService->ext_getTemplateHierarchyArr(
             $hierarchyInfo,
             '',
             [],
             1
-        )), '');
+        )));
 
         $urlParameters = [
             'id' => $this->id,
index 414d4a0..974d444 100644 (file)
@@ -144,7 +144,7 @@ class TypoScriptTemplateConstantEditorModuleFunctionController
                 if ($this->templateService->changed) {
                     // Set the data to be saved
                     $recData = [];
-                    $recData['sys_template'][$saveId]['constants'] = implode($this->templateService->raw, LF);
+                    $recData['sys_template'][$saveId]['constants'] = implode(LF, $this->templateService->raw);
                     // Create new  tce-object
                     $tce = GeneralUtility::makeInstance(DataHandler::class);
                     $tce->start($recData, []);