1

This is an exception that is thrown when a wrong L parameter is present in the URL. It pollutes the typo3_log in /typo3temp/logs/ folder.
This exception seems to be introduced with the version 2.3.0 of realurl. If I downgrade to version 2.2.1, the error will not be logged anymore. With version 2.3.1 I also get a huge stack dump which contains the whole TypoScript configuration array.

Examples of URLs which trigger this error are:

  • non integer values:
    • https://www.example.org/index.php?uid=1&L=a
  • integers that don't match the TypoScript setup:
    • config.linkVars = L(0-1)
    • https://www.example.org/index.php?uid=1&L=5
  • integers that match the TypoScript setup but don't correspond to a setup in the realurl_config.php file
    • config.linkVars = L(0-6)
    • 'preVars' => array ( 0 => array ( 'GETvar' => 'L', 'valueMap' => array ( 'en' => '1', 'fr' => '2', 'es' => '3', 'it' => '4', ), 'noMatch' => 'bypass', ), )
    • https://www.example.org/index.php?uid=1&L=6
  • integers that don't match an existing language defined in the sys_language database table

The error messages are like this

component="DmitryDulepov.Realurl.Encoder.UrlEncoder": Bad "L" parameter ("X") was detected by realurl. Page caching is disabled to prevent spreading of wrong "L" value - "<long dump here>"

where X is the wrong parameter

The long dump is not there with version 2.3.2 of realurl but with version 2.3.1

I have a totally normal setup that worked well with version 2.2.x of realurl like this

TypoScript

config.linkVars = L(0-1)
page.config.linkVars < config.linkVars
config.uniqueLinkVars = 1
config.language = de
config.locale_all = de_DE
config.htmlTag_langKey = de
config.sys_language_uid = 0

[globalVar = GP:L = 1]
config.language = en
config.locale_all = en_SUS
config.htmlTag_langKey = en
config.sys_language_uid = 1
[global]

realurl_conf.php

'preVars' => array (
    0 => array (
        'GETvar' => 'L',
        'valueMap' => array (
            'en' => '1',
        ),
        'noMatch' => 'bypass',
    ),
),

Activated languages English: id=1, Default Language German

I searched for the error message but all I found were some forum replies of Dimitri (the author of realurl) who claims that the configuration is wrong, but with no hint on what is being wrong.

Note

The error is not triggered, because some links on my site have the wrong L parameter. The access log shows that those links with wrong parameters come from bots or with no referrer or from external links

yunzen
  • 32,854
  • 11
  • 73
  • 106

1 Answers1

1

I did this patch some times ago wich seems to resolve the issue :

index 1ce3874..c7004ea 100644
--- a/Classes/Encoder/UrlEncoder.php
+++ b/Classes/Encoder/UrlEncoder.php
@@ -1605,10 +1605,10 @@ class UrlEncoder extends EncodeDecoderBase {
                addslashes($sysLanguageUid)
            );
            $this->tsfe->set_no_cache($message);
-           $this->logger->error($message);
-           if (version_compare(TYPO3_version, '7.6.0', '>=')) {
-               $this->logger->debug($message, debug_backtrace());
-           }
+           //$this->logger->error($message);
+           //if (version_compare(TYPO3_version, '7.6.0', '>=')) {
+           //  $this->logger->debug($message, debug_backtrace());
+           //}

            throw new InvalidLanguageParameterException($sysLanguageUid);
        }

I think there is nothing in the realurl configuration to fix it. So you have to apply this patch. I personally use cweagans/composer-patches which is fine if you use composer to manage dependencies of your site.

StatiX
  • 854
  • 6
  • 21
  • This would only be a last resort – yunzen Apr 04 '19 at 08:09
  • Otherwise, you will need to configure the Logger of TYPO3 (https://docs.typo3.org/typo3cms/CoreApiReference/7.6/ApiOverview/Logging/Configuration/Index.html) to avoid writing of "debug" level message in production environment. – StatiX Apr 04 '19 at 08:23