Completed
Push — master ( ca9035...17598f )
by Tim
15:18
created
Classes/Xclass/ContentObjectRenderer.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function typoLink($linktxt, $conf)
39 39
     {
40
-        $linktxt = (string)$linktxt;
40
+        $linktxt = (string) $linktxt;
41 41
         $tsfe = $this->getTypoScriptFrontendController();
42 42
 
43 43
         $LD = array();
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
                 }
217 217
                 // Link to page even if access is missing?
218 218
                 if (isset($conf['linkAccessRestrictedPages'])) {
219
-                    $disableGroupAccessCheck = (bool)$conf['linkAccessRestrictedPages'];
219
+                    $disableGroupAccessCheck = (bool) $conf['linkAccessRestrictedPages'];
220 220
                 } else {
221
-                    $disableGroupAccessCheck = (bool)$tsfe->config['config']['typolinkLinkAccessRestrictedPages'];
221
+                    $disableGroupAccessCheck = (bool) $tsfe->config['config']['typolinkLinkAccessRestrictedPages'];
222 222
                 }
223 223
                 // Looking up the page record to verify its existence:
224 224
                 $page = $tsfe->sys_page->getPage($linkParameter, $disableGroupAccessCheck);
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
                         unset($params);
277 277
                     }
278 278
                     $targetDomain = '';
279
-                    $currentDomain = (string)$this->getEnvironmentVariable('HTTP_HOST');
279
+                    $currentDomain = (string) $this->getEnvironmentVariable('HTTP_HOST');
280 280
                     // Mount pages are always local and never link to another domain
281 281
                     if (!empty($MPvarAcc)) {
282 282
                         // Add "&MP" var:
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
                         // If we link across domains and page is free type shortcut, we must resolve the shortcut first!
289 289
                         // If we do not do it, TYPO3 will fail to (1) link proper page in RealURL/CoolURI because
290 290
                         // they return relative links and (2) show proper page if no RealURL/CoolURI exists when link is clicked
291
-                        if ($enableLinksAcrossDomains && (int)$page['doktype'] === PageRepository::DOKTYPE_SHORTCUT && (int)$page['shortcut_mode'] === PageRepository::SHORTCUT_MODE_NONE) {
291
+                        if ($enableLinksAcrossDomains && (int) $page['doktype'] === PageRepository::DOKTYPE_SHORTCUT && (int) $page['shortcut_mode'] === PageRepository::SHORTCUT_MODE_NONE) {
292 292
                             // Save in case of broken destination or endless loop
293 293
                             $page2 = $page;
294 294
                             // Same as in RealURL, seems enough
295 295
                             $maxLoopCount = 20;
296
-                            while ($maxLoopCount && is_array($page) && (int)$page['doktype'] === PageRepository::DOKTYPE_SHORTCUT && (int)$page['shortcut_mode'] === PageRepository::SHORTCUT_MODE_NONE) {
296
+                            while ($maxLoopCount && is_array($page) && (int) $page['doktype'] === PageRepository::DOKTYPE_SHORTCUT && (int) $page['shortcut_mode'] === PageRepository::SHORTCUT_MODE_NONE) {
297 297
                                 $page = $tsfe->sys_page->getPage($page['shortcut'], $disableGroupAccessCheck);
298 298
                                 $maxLoopCount--;
299 299
                             }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
                         if (isset($conf['forceAbsoluteUrl.']['scheme']) && $conf['forceAbsoluteUrl.']['scheme']) {
317 317
                             $absoluteUrlScheme = $conf['forceAbsoluteUrl.']['scheme'];
318 318
                         } elseif ($page['url_scheme'] > 0) {
319
-                            $absoluteUrlScheme = (int)$page['url_scheme'] === HttpUtility::SCHEME_HTTP ? 'http' : 'https';
319
+                            $absoluteUrlScheme = (int) $page['url_scheme'] === HttpUtility::SCHEME_HTTP ? 'http' : 'https';
320 320
                         } elseif ($this->getEnvironmentVariable('TYPO3_SSL')) {
321 321
                             $absoluteUrlScheme = 'https';
322 322
                         }
@@ -374,14 +374,14 @@  discard block
 block discarded – undo
374 374
                     }
375 375
                     $this->lastTypoLinkTarget = $LD['target'];
376 376
                     // If sectionMark is set, there is no baseURL AND the current page is the page the link is to, check if there are any additional parameters or addQueryString parameters and if not, drop the url.
377
-                    if ($sectionMark && !$tsfe->config['config']['baseURL'] && (int)$page['uid'] === (int)$tsfe->id && !trim($addQueryParams) && (empty($conf['addQueryString']) || !isset($conf['addQueryString.']))) {
377
+                    if ($sectionMark && !$tsfe->config['config']['baseURL'] && (int) $page['uid'] === (int) $tsfe->id && !trim($addQueryParams) && (empty($conf['addQueryString']) || !isset($conf['addQueryString.']))) {
378 378
                         $currentQueryParams = $this->getQueryArguments(array());
379 379
                         if (!trim($currentQueryParams)) {
380 380
                             list(, $URLparams) = explode('?', $this->lastTypoLinkUrl);
381 381
                             list($URLparams) = explode('#', $URLparams);
382 382
                             parse_str($URLparams . $LD['orig_type'], $URLparamsArray);
383 383
                             // Type nums must match as well as page ids
384
-                            if ((int)$URLparamsArray['type'] === (int)$tsfe->type) {
384
+                            if ((int) $URLparamsArray['type'] === (int) $tsfe->type) {
385 385
                                 unset($URLparamsArray['id']);
386 386
                                 unset($URLparamsArray['type']);
387 387
                                 // If there are no parameters left.... set the new url.
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
                     }
410 410
                     // Rendering the tag.
411 411
                     $finalTagParts['url'] = $this->lastTypoLinkUrl;
412
-                    $finalTagParts['targetParams'] = (string)$LD['target'] !== '' ? ' target="' . htmlspecialchars($LD['target']) . '"' : '';
412
+                    $finalTagParts['targetParams'] = (string) $LD['target'] !== '' ? ' target="' . htmlspecialchars($LD['target']) . '"' : '';
413 413
                 } else {
414 414
                     $this->getTimeTracker()
415 415
                         ->setTSlogMessage('typolink(): Page id "' . $linkParameter . '" was not found, so "' . $linktxt . '" was not linked.',
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
                 $target = '';
436 436
             }
437 437
             $onClick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($tsfe->baseUrlWrap($finalTagParts['url'])) . ',\'FEopenLink\',' . GeneralUtility::quoteJSvalue($JSwindowParams) . ');vHWin.focus();return false;';
438
-            $finalAnchorTag = '<a href="' . htmlspecialchars($finalTagParts['url']) . '"' . $target . ' onclick="' . htmlspecialchars($onClick) . '"' . ((string)$title !== '' ? ' title="' . htmlspecialchars($title) . '"' : '') . ($linkClass !== '' ? ' class="' . $linkClass . '"' : '') . $finalTagParts['aTagParams'] . '>';
438
+            $finalAnchorTag = '<a href="' . htmlspecialchars($finalTagParts['url']) . '"' . $target . ' onclick="' . htmlspecialchars($onClick) . '"' . ((string) $title !== '' ? ' title="' . htmlspecialchars($title) . '"' : '') . ($linkClass !== '' ? ' class="' . $linkClass . '"' : '') . $finalTagParts['aTagParams'] . '>';
439 439
         } else {
440 440
             if ($tsfe->spamProtectEmailAddresses === 'ascii' && $linkType === 'mailto') {
441 441
                 $finalAnchorTag = '<a href="' . $finalTagParts['url'] . '"';
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
                 }
454 454
 
455 455
             }
456
-            $finalAnchorTag .= ((string)$title !== '' ? ' title="' . htmlspecialchars($title) . '"' : '') . $finalTagParts['targetParams'] . ($linkClass ? ' class="' . $linkClass . '"' : '') . $finalTagParts['aTagParams'] . '>';
456
+            $finalAnchorTag .= ((string) $title !== '' ? ' title="' . htmlspecialchars($title) . '"' : '') . $finalTagParts['targetParams'] . ($linkClass ? ' class="' . $linkClass . '"' : '') . $finalTagParts['aTagParams'] . '>';
457 457
         }
458 458
 
459 459
         // Call user function:
Please login to merge, or discard this patch.