This page is still a beta!

Chapter 1. TSLib Patcher

Extension Key: tslib_patcher

Copyright 2000-2002, Jean-David Gadina, <info@macmade.net>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

1.1. Introduction

What does it do?

This extension provides a correction for some bugs in the TSLib core classes.

Actually, it mainly correct bugs related to the cache hash (cHash) variable. The use of this extension should increase the overall performances of your TYPO3 website.

The cHash URL parameter is used when URL parameters other than id, type, etc are used, in order to cache the page state. As said in the official documentation:

«Each link involving more parameters than the &id must contain “&cHash=[hash string]” in addition. The value of “&cHash” is used on the server to verify that the combination of additional parameters is made by the server itself and not forged by an outside spammer.»

Unfortunately, the core typoLink function, which is used in TypoScript and usually in TYPO3 extensions, is buggy and does not generate correctly the cHash.

In addition, there is absolutely no support for the cHash in the core TS menus. This last case is really problematic when you use the RealURL extension, and/or if you have a multi-language website. For instance, if you take that URL: http://mydomain/en/typo3-test-page/index.html (which is a RealURL URL), it means something like http://mydomain/index.php?id=35&L=1.

As you can see, with RealURL, there is always the L variable in the URL. So a cHash is requested. As the TS menus did not generate the cHash, it causes problems to the TYPO3 mechanism.

This extension fixes the typoLink function and the TS menu classes, in order to have always a correct cHash value when needed. It also fixes some cHash related bugs in the RealURL classes,

To know more about the cHash, please see http://typo3.org/development/articles/the-mysteries-of-chash/

Important warning

This extension uses the XCLASS mechanism in order to correct some TYPO3 core classes, as there is no other way to do it. So it won't work if you already have an extension which does an XCLASS on the same core classes (except for the imagelightbox2 extension – see below).

Please also note that this extension is an override of some TYPO3 core classes, I've tried to test the most used cases, but I can't test every configuration. Please report any bug you may find.

This extension was build and tested on TYPO3 4.1.2.