[BUGFIX] Initialize $currentR in analyseTypoLinks
authorBjoern Pedersen <bjoern.pedersen@frm2.tum.de>
Sat, 24 Sep 2011 13:41:21 +0000 (15:41 +0200)
committerPhilipp Gampe <forge.typo3.org@philippgampe.info>
Sat, 24 Sep 2011 13:41:21 +0000 (15:41 +0200)
There are pathes through analyseTypoLinks where currentR is
not set, it can happen that the fetchType hook gets
called with currentR=null.

This throws an API error as the fetchType interface
requires the first arg to be an array.

Change-Id: Ic124938c8744c8ef412013499ad368e5b7966d9f
Resolves: #30043
Releases: 4.6
Reviewed-on: http://review.typo3.org/5097
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processor.php

index aa038c8..2a7ae59 100644 (file)
@@ -314,6 +314,7 @@ class tx_linkvalidator_Processor {
         * @return void
         */
        private function analyseTypoLinks(array $resultArray, array &$results, $htmlParser, array $record, $field, $table) {
+               $currentR = array();
                $linkTags = $htmlParser->splitIntoBlock('link', $resultArray['content']);
                $idRecord = $record['uid'];
                for ($i = 1; $i < count($linkTags); $i += 2) {