Fixed showpic.php bug.
authorKasper Skårhøj <kasper@typo3.org>
Mon, 19 Apr 2004 11:59:41 +0000 (11:59 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Mon, 19 Apr 2004 11:59:41 +0000 (11:59 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@204 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/alt_shortcut.php
typo3/index.php
typo3/sysext/cms/tslib/showpic.php

index 3e0803c..d140f0e 100755 (executable)
@@ -87,7 +87,6 @@ class SC_alt_shortcut {
        var $URL;
        var $editSC;
        var $deleteCategory;
-       var $editPage;
        var $editName;
        var $editGroup;
        var $whichItem;
index 8e67c79..27acdc6 100755 (executable)
@@ -100,7 +100,6 @@ class SC_index {
        var $L_vars;                            // Set to the labels used for the login screen.
 
                // Internal, dynamic:
-       var $interfaceSelector;         // If set tru, if there is a redirect URL
        var $content;                           // Content accumulation
 
        var $interfaceSelector;                 // A selector box for selecting value for "interface" may be rendered into this variable
index 74f81ad..696d090 100755 (executable)
@@ -1,22 +1,22 @@
 <?php
 /***************************************************************
 *  Copyright notice
-*  
+*
 *  (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
 *  All rights reserved
 *
-*  This script is part of the TYPO3 project. The TYPO3 project is 
+*  This script is part of the TYPO3 project. The TYPO3 project is
 *  free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
-* 
+*
 *  The GNU General Public License can be found at
 *  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license 
+*  A copy is found in the textfile GPL.txt and important notices to the license
 *  from the author is found in LICENSE.txt distributed with these scripts.
 *
-* 
+*
 *  This script is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *
  *
  *
- *   97: class SC_tslib_showpic 
- *  118:     function init()   
- *  166:     function main()   
- *  214:     function printContent()   
+ *   97: class SC_tslib_showpic
+ *  118:     function init()
+ *  166:     function main()
+ *  214:     function printContent()
  *
  * TOTAL FUNCTIONS: 3
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
 
+
 // *******************************
-// Set error reporting 
+// Set error reporting
 // *******************************
-error_reporting (E_ALL ^ E_NOTICE); 
+error_reporting (E_ALL ^ E_NOTICE);
 
 
 // ***********************
@@ -66,21 +66,21 @@ define('PATH_site', dirname(PATH_thisScript).'/');
 define('PATH_t3lib', PATH_site.'t3lib/');
 define('PATH_tslib', PATH_site.'tslib/');
 define('PATH_typo3conf', PATH_site.'typo3conf/');
-define('TYPO3_mainDir', 'typo3/');             // This is the directory of the backend administration for the sites of this TYPO3 installation. 
+define('TYPO3_mainDir', 'typo3/');             // This is the directory of the backend administration for the sites of this TYPO3 installation.
 
-require(PATH_t3lib.'class.t3lib_div.php');
-require(PATH_t3lib.'class.t3lib_extmgm.php');
+require_once(PATH_t3lib.'class.t3lib_div.php');
+require_once(PATH_t3lib.'class.t3lib_extmgm.php');
 
 // ******************
 // Including config
 // ******************
-require(PATH_t3lib.'config_default.php');
+require_once(PATH_t3lib.'config_default.php');
 if (!defined ('TYPO3_db'))     die ('The configuration file was not included.');
 
-require(PATH_t3lib.'class.t3lib_db.php');
+require_once(PATH_t3lib.'class.t3lib_db.php');
 $TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');
 
-require(PATH_t3lib.'class.t3lib_stdgraphic.php');
+require_once(PATH_t3lib.'class.t3lib_stdgraphic.php');
 
 
 
@@ -96,7 +96,7 @@ require(PATH_t3lib.'class.t3lib_stdgraphic.php');
  */
 class SC_tslib_showpic {
        var $content;           // Page content accumulated here.
-       
+
                // Parameters loaded into these internal variables:
        var $file;
        var $width;
@@ -116,7 +116,7 @@ class SC_tslib_showpic {
         * @return      void
         */
        function init() {
-                       // Loading internal vars with the GET/POST parameters from outside:             
+                       // Loading internal vars with the GET/POST parameters from outside:
                $this->file = t3lib_div::_GP('file');
                $this->width = t3lib_div::_GP('width');
                $this->height = t3lib_div::_GP('height');
@@ -128,7 +128,7 @@ class SC_tslib_showpic {
                $this->title = t3lib_div::_GP('title');
                $this->wrap = t3lib_div::_GP('wrap');
                $this->md5 = t3lib_div::_GP('md5');
-               
+
                // ***********************
                // Check parameters
                // ***********************
@@ -136,18 +136,18 @@ class SC_tslib_showpic {
                if (!$this->file)       {
                        die('Parameter Error: No file given.');
                }
-               
+
                        // Chech md5-checksum: If this md5-value does not match the one submitted, then we fail... (this is a kind of security that somebody don't just hit the script with a lot of different parameters
                $md5_value = md5($this->file.'|'.$this->width.'|'.$this->height.'|'.$this->effects.'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'].'|');
                if ($md5_value!=$this->md5) {
                        die('Parameter Error: Wrong parameters sent.');
                }
-               
+
                // ***********************
                // Check the file. If must be in a directory beneath the dir of this script...
-               // $this->file remains unchanged, because of the code in stdgraphic, but we do check if the file exists within the current path 
+               // $this->file remains unchanged, because of the code in stdgraphic, but we do check if the file exists within the current path
                // ***********************
-               
+
                $test_file=PATH_site.$this->file;
                if (!t3lib_div::validPathStr($test_file))       {
                        die('Parameter Error: No valid filepath');
@@ -173,19 +173,20 @@ class SC_tslib_showpic {
                if ($this->alternativeTempPath && t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['FE']['allowedTempPaths'],$this->alternativeTempPath))  {
                        $img->tempPath = $this->alternativeTempPath;
                }
-               if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['enable_typo3temp_db_tracking']) {
-                               // Need to connect to database, because this may be used.
+
+               #if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['enable_typo3temp_db_tracking'])        {
+                               // Need to connect to database, because this may be used (eg. by stdgraphic)
                        $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password);
-               }
-               
+               #}
+
                if (strstr($this->width.$this->height, 'm')) {$max='m';} else {$max='';}
-               
+
                $this->height = t3lib_div::intInRange($this->height,0,1000);
                $this->width = t3lib_div::intInRange($this->width,0,1000);
                if ($this->frame)       {$this->frame = intval($this->frame);}
                $imgInfo = $img->imageMagickConvert($this->file,'web',$this->width.$max,$this->height,$img->IMparams($this->effects),$this->frame,'');
 
-               
+
                        // Create HTML output:
                $this->content='';
                $this->content.='
@@ -196,7 +197,7 @@ class SC_tslib_showpic {
        <title>'.htmlspecialchars($this->title ? $this->title : "Image").'</title>
 </head>
                '.($this->bodyTag ? $this->bodyTag : '<body>');
-               
+
                if (is_array($imgInfo)) {
                        $wrapParts = explode('|',$this->wrap);
                        $this->content.=trim($wrapParts[0]).$img->imgTag($imgInfo).trim($wrapParts[1]);