[TYPO3-dev] Getting id of the page

Bernd Wilke xoonsji02 at sneakemail.com
Sat Aug 26 00:15:04 CEST 2006


On Fri, 25 Aug 2006 20:55:23 +0300, Tapio Markula wrote
with subject "Re: [TYPO3-dev] Getting id of the page":

> Bernd Wilke kirjoitti:
> > On Fri, 25 Aug 2006 10:28:39 +0300, Tapio Markula wrote
> > with subject "[TYPO3-dev] Getting id of the page":
> > 
> >> Hi
> >>
> >> I would need for function 'docStyle()' for class.ux_template.php
> 
> > what are all you talking about?
> > 
> > FE or BE?
> 
> function 'docStyle()' for class.ux_template.php
> is a BE function - I wondered why Martin Ficzel wrote about TSFE

hm. til now I don't know that this function belongs to BE.
maybe it would be clearer if you had written about this in your first
posting :-)
 
> > (consider: editing a page in FE-mode still is BE!)
> 
> yes, I know but Martin Ficzel didn't figure if the function is BE of FE 
> function. Because there is not build-in class method for
> this purpose, I got much conditions.
> 
> BTW. Why t3lib_div::GP() would be better than $_GET?
> Why I should use t3lib_div::GP()?

let's see what is written in class.t3lib_dev.php:
/*************************
 *
 * GET/POST Variables
 *
 * Background:
 * Input GET/POST variables in PHP may have their quotes escaped with "\"
 * or not depending on configuration.
 * TYPO3 has always converted quotes to BE escaped if the configuration
 * told that they would not be so.
 * But the clean solution is that quotes are never escaped and that is what
 * the functions below offers.
 * Eventually TYPO3 should provide this in the global space as well.
 * In the transitional phase (or forever..?) we need to encourage EVERY to
 * read and write GET/POST vars through the API functions below.
 *
 *************************/

/**
 * Returns the 'GLOBAL' value of incoming data from POST or GET, with
 * priority to POST (that is equalent to 'GP' order)
 * Strips slashes from all output, both strings and arrays.
 * This function substitutes t3lib_div::GPvar()
 * To enhancement security in your scripts, please consider using
 * t3lib_div::_GET or t3lib_div::_POST if you already know by which method
 * your data is arriving to the scripts!
 * Usage: 537
 *
 * @param	string		GET/POST var to return
 * @return	mixed		POST var named $var and if not set, the GET
 *                               var of the same name.
 * @see GPvar()
 */
function _GP($var)	{ ... }

/**
 * GET/POST variable
 * Returns the 'GLOBAL' value of incoming data from POST or GET, with
 * priority to POST (that is equalent to 'GP' order)
 * Strips slashes of string-outputs, but not arrays UNLESS $strip is set.
 * If $strip is set all output will have escaped characters unescaped.
 * Usage: 2
 *
 * @param	string		GET/POST var to return
 * @param	boolean		If set, values are stripped of return
 *                              values that are *arrays!* - string/integer
 *                              values returned are always strip-slashed()
 * @return	mixed		POST var named $var and if not set, the GET
 *                              var of the same name.
 * @deprecated		Use t3lib_div::_GP instead (ALWAYS delivers a value
 *                      with un-escaped values!)
 * @see _GP()
 */
function GPvar($var,$strip=0)	{ ... }


a little bit more security, and a little bit more comfort :-)

> the method is t3lib_div::_GP()
> 
> If I put
> $_GET=t3lib_div::_GET();
> that's do the task.

??????
setting the params from the params? :-(

Bernd
-- 
----------------
Bernd Wilke     
Annweilerstr.20 
40229 Düsseldorf
0211/229 2800




More information about the TYPO3-dev mailing list