Yoast / Yoast-SEO-for-TYPO3

Yoast SEO plugin for TYPO3
Other
51 stars 56 forks source link

Additional get vars must be decoded #469

Closed georgringer closed 2 years ago

georgringer commented 2 years ago

Please give us a description of what happened.

Using a TsConfig like this

TCEMAIN.preview {
    tx_news_domain_model_news {
        useCacheHash = 1
        previewPageId = {$pages.blogPreview}
        useDefaultLanguageRecord = 0
        fieldToParameterMap {
            uid = tx_news_pi1[news_preview]
        }
        additionalGetParameters {
            tx_news_pi1.controller = News
            tx_news_pi1.action = detail
        }
    }
}

will create a wrong URL for the snippet preview in TYPO3 10.4 and yoast_seo:dev-master

The additionalGetVars in UrlService::generateUri will be

%26tx_news_pi1%255Bnews_preview%255D%3D5%26tx_news_pi1%255Bcontroller%255D%3DNews%26tx_news_pi1%255Baction%255D%3Ddetail%26cHash%3Db84155cf8281d18175d4567c8514cba9

by using $additionalGetVars = rawurldecode($additionalGetVars); it will be

&tx_news_pi1%5Bnews_preview%5D=5&tx_news_pi1%5Bcontroller%5D=News&tx_news_pi1%5Baction%5D=detail&cHash=b84155cf8281d18175d4567c8514cba9

which will end up after parse_str with Bildschirmfoto 2021-11-22 um 15 21 20

How can we reproduce this behavior?

  1. Use TsConfig as mentioned
  2. Check generated URL

Technical info