Coder Social home page Coder Social logo

realurl's Introduction

TYPO3 Extension realurl

This is an unofficial fork of the TYPO3 CMS Extension RealURL It aims for no backwards compatibility with TYPO3 versions lower than 6.2 thus no messages in the deprecation log.

As the class names changed the configuration needs some slight change, too:

'userFunc' => 'Tx\\Realurl\\UriGeneratorAndResolver->main'

Other than that, configuration and behaviour (including potential bugs) are the same.

This fork comes with no support. If you find bugs or have questions, you may want to use the original version: https://github.com/dmitryd/typo3-realurl

realurl's People

Contributors

abeutel avatar bmack avatar bnf avatar dfeyer avatar dmitryd avatar hallgaeuer avatar helhum avatar liayn avatar liwo avatar mabahe avatar maddy2101 avatar neoblack avatar ohader avatar ohartwig avatar saschanowak avatar simonschaufi avatar smichaelsen avatar spoonerweb avatar stephanschuler avatar stephenking avatar whefter avatar xf- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realurl's Issues

lookupTable and languagField / transOrigPointerField does not work correctly

The check in regards to the languageField is:

 if ($cfg['languageGetVar'] && $cfg['transOrigPointerField'] && $cfg['languageField'])

languageGetVar is wrong here because it is not part of the lookUpTable configuration but of the general pagePath setting. Simplest check is probably if $this->detectedLanguage >= 0

Might be used somewhere else in the method too.

chash cache doesn't take take root page into account

Summary

The internal chash cache (database table tx_realurl_chashcache) maps a given combination of query string and query parameters to a single chash value. It's intended to not recalculate chashe values when resolving GETvars from SEO URLs but to just look them up.

This can conflicts when common non-page records should be displayed on different detail pages on different root pages that share the same language and by accident the same page path to the detail page.

Example

Given a page tree like this:

  • first-domain [1]
    • new-details [2]
  • second-domain [3]
    • news-details [4]

Given a news record "testnews" with News-ID 10.

The news record is to be shared across both root pages.

There are two URLs to the same news record:

Encoded URL Decoded URL
https://first-domain/news-details/testnews index.php?id=2&news=10&chash=foo
https://second-domain/news-details/testnews index.php=id=4&news=10&chash=bar

Expected

The database table tx_realurl_chashcache should look like this:

spurl_hash chash_string spurl_string
aaaaa foo first-domain/news-details/testnews
bbbbb bar second-domain/news-details/testnews

Actual behavior

The database table tx_realurl_chashcache looks like this:

spurl_hash chash_string spurl_string
bbbbb bar news-details/testnews

Solution

There's the \Tx\Realurl\Hooks\UrlRewritingHook::$additionalParametersForChash.

This can be used to add the current hostname to the chash cache.

Class t3lib_lock not found in 7.4 when automatic configuration is enabled

I'm using TYPO3 7.4 and this realurl version. When the automatic configuration is enabled (in extension settings), I get the following error:

Fatal error: Class 't3lib_lock' not found in /.../typo3/cms/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 4349

If I deactivate it, the error is gone. Probably a problem with removed t3lib_lock class in TYPO3 7+?

Domain _GET vars can be overridden

When a domain has configured a $_GET var (most prominently L), a visitor can still set that variable to a different value, leading e.g. to a different language being shown. The decode step will then not set the preconfigured value (see adjustConfigurationByHostDecode()).

IMO if a variable is defined in the domain record, it should not be changeable from the outside, or at least there should be an option to declare the value immutable.

What's the difference between upstream EXT:realurl

The README just points to removed backwards compatibility. However upstream EXT:realurl meanwhile dropped compatibility for <6.2 and moves towards >= 7.6

Is there another benefit from using your extension instead of the upstream from Dmitry?

RSS Feed won't work

i use the basic setup from all the example e.g. news docu.

'fileName' => [
        'defaultToHTMLsuffixOnPrev' => false,
        'acceptHTMLsuffix' => 1,
        'index' => [
            'feed.xml' => [
                'keyValues' => [
                    'type' => 9818,
                ],
            ],
        ],
    ],
],

TS

[globalVar = TSFE:type = 9818]
config {
    disableAllHeaderCode = 1
    xhtml_cleaning = none
    admPanel = 0
    metaCharset = utf-8
    additionalHeaders = Content-Type:application/xml;charset=utf-8
    disablePrefixComment = 1
}

pageNewsRSS = PAGE
pageNewsRSS {
    typeNum = 9818
    10 < tt_content.list.20.news_pi1
    10 {
...

TYPO3@git-master (i also tested 7.4.0 before)
realurl@git-master

/feed.xml - fails
/feed.xml?type=9818 - works

Where did i mess up?

PHP 7.2 - Method create_function is deprecated in UrlRewritingHook

In the class UrlRewritingHook, line 1127, the deprecated php method create_function() is used. Should be replaced with a compatible definition for the latest php versions.

If you are running TYPO3 v8.7 LTS with PHP 7.2. an exception with the deprecation warning is thrown.

Warning: This function has been DEPRECATED as of PHP 7.2.0. Relying on this function is highly discouraged. see: http://php.net/manual/en/function.create-function.php

Classes/Hooks/UrlRewritingHook
array_walk($pathParts, create_function('&$value', '$value = rawurldecode($value);'));

Packagist availability

Hi Helmut,

Any chance we can get this (working!) patch on Packagist, too? Currently I'm cloning and adding an autoload path in composer in order to operate on 7.4.

Thanks ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.