diff --git a/ChangeLog b/ChangeLog index 2e85938bdc28407d47a980f7b3217ce19c67c73c..ed1da769b1db4d4d93f51039f45fff61e4bdf07e 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,20 @@ +2005-07-02 Michael Stucki <michael@typo3.org> + + * Removed misc/mod_rewrite.htaccess and misc/php_optimized.htaccess and replaced them by misc/simple.htaccess and misc/advanced.htaccess + * Added a die() call to protect the display of phpinfo() in misc/phpcheck/incfile.php + * config.disablePrefixComment was ignored by plugins + * $TT->pull() was called without $TT->push() before in typo3/sysext/indexed_search/class.indexer.php + * Fixed bug #0001239: Install tool does not accept hyphen in database host name + 2005-06-27 Andreas Otto <andreas@php4win.de> * Method fetchGroups() in t3lib/class.t3lib_userauthgroup.php: - * Added hook as requested and provided by Stig N. Faerch. - * - * This hook is used by the extension 'roles'. With this hook it's possible to - * control the backend usergroup access, through manipulating a sql-sentence. - * In the case of 'roles', the hook is used to limit access to the selected - * backend usergroup (which is marked as a role). This is very powerful when - * you need to have a better overview in the backend. + Added hook as requested and provided by Stig N. Faerch. + This hook is used by the extension 'roles'. With this hook it's possible to + control the backend usergroup access, through manipulating a sql-sentence. + In the case of 'roles', the hook is used to limit access to the selected + backend usergroup (which is marked as a role). This is very powerful when + you need to have a better overview in the backend. 2005-06-25 Michael Stucki <michael@typo3.org> diff --git a/misc/advanced.htaccess b/misc/advanced.htaccess new file mode 100644 index 0000000000000000000000000000000000000000..d31119f2250e70195f4fdc630e41cc7f49e1e8fe --- /dev/null +++ b/misc/advanced.htaccess @@ -0,0 +1,126 @@ +##### +# +# Example .htaccess file +# +# This file contains a collection of almost everything you will need +# for optimising TYPO3: +# +# - mod_rewrite (used for SimulateStaticDocuments, RealUrl, etc.) +# - PHP optimisation +# +# If you want to use it, you'll need to rename this file to '.htaccess'. +# (To make this work you will need to adjust the 'AllowOverride' +# directive in your Apache configuration file.) +# +# IMPORTANT: You may need to change this file depending on your TYPO3 +# installation! +# +# You should change every occurance of TYPO3root/ to the location where you +# have your website in. For example: +# If you have your website located at http://mysite.com/ +# then your TYPO3root/ is just empty (remove 'TYPO3root/') +# If you have your website located at http://mysite.com/some/path/ +# then your TYPO3root/ is some/path/ (search and replace) +# +# If you have problems with this file, try using the minimal +# mod_rewrite.htaccess which is located in the typo3_src/misc/ +# directory of this installation. +# +# You can also use this configuration in your httpd.conf, but you'll have +# to modify some lines, see the comments (search for 'httpd.conf') +# +# Using rewriting in your httpd.conf is much faster, btw. +# +# Questions about this file go to the matching Install mailing list, +# see http://typo3.org/documentation/mailing-lists/ +# +#### + +### Begin: Rewrite stuff ### + +# Enable URL rewriting +RewriteEngine On + +# To assist in debugging rewriting, you could use these lines +# DON'T enable it for production! +# This will only work in httpd.conf, not in .htaccess files +#RewriteLog /var/log/apache/rewrite.log +#RewriteLogLevel 9 + +# If you use the RealUrl extension, then you'll have to enable the next line. +# You will have to change this path if your TYPO3 installation is located +# in a subdirectory of the website root. +# +# If you place this in httpd.conf, you cannot use this directive in any case! +#RewriteBase / + +# Stop rewrite processing if we are in the typo3/ directory +# For httpd.conf, use this line instead of the next one: +# RewriteRule ^/TYPO3root/(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)/ - [L] +RewriteRule ^(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)/ - [L] + +# Redirect http://mysite/typo3 to http://mysite/typo3/index_re.php +# and stop the rewrite processing +# For httpd.conf, use this line instead of the next one: +# RewriteRule ^/TYPO3root/typo3$ /TYPO3root/typo3/index.php [L] +RewriteRule ^typo3$ typo3/index_re.php [L] + +# If the file/symlink/directory does not exist => Redirect to index.php +# Important note: If you copy/paste this into httpd.conf instead +# of .htaccess you will need to add '%{DOCUMENT_ROOT}' left to each +# '%{REQUEST_FILENAME}' part. +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_FILENAME} !-l + +# Main URL rewriting. + +# If you use Windows and SimulateStaticDocuments do not work, try adding a +# slash (/) right before 'index.php' below. + +# The example shows how to rewrite only *.html and *.pdf files to index.php +# This may be helpful when using an extension that can generate PDF files +# on the fly. +# Example: RewriteRule .*\.(html|pdf)$ index.php [L] + +# For httpd.conf, use this line instead of the next one that has no '#': +# RewriteRule .* /TYPO3root/index.php [L] + +# For use with the RealUrl extension, you might need to remove the +# RewriteBase directive somewhere above and use this line instead of the +# next one: +# RewriteRule .* /index.php [L] + +RewriteRule .* index.php [L] + +### End: Rewrite stuff ### + +### Begin: PHP optimisation ### + +# All features below are left to the default if you don't change this. +# Simply remove the comment marks if you want to use some/all of these +# settings + +# The PHP developers recommend disabling this feature. Do that. +# It's deprecated and is likely to be unsupported in future versions of PHP. +#php_flag allow_call_time_pass_reference off + +# TYPO3 works fine with register_globals turned off. +# This is highly recommended! +#php_flag register_globals off + +# PHP may not declare the argv & argc variables (that would contain the GET +# information). +# TYPO3 doesn't need this, so just turn it off. +#php_flag register_argc_argv off + +# Magic quotes for runtime-generated data (data from SQL, exec(), etc.) +#php_flag magic_quotes_gpc off + +# Order in which PHP registers GET, POST, Cookie and Built-in variables +#php_value variables_order GPCS + +### End: PHP optimisation ### + +# Add your own rules here +# ... diff --git a/misc/php_optimized.htaccess b/misc/php_optimized.htaccess deleted file mode 100755 index 998e8168105347506e2bbffb6d5ac233797dc7ec..0000000000000000000000000000000000000000 --- a/misc/php_optimized.htaccess +++ /dev/null @@ -1,5 +0,0 @@ -php_flag allow_call_time_pass_reference off -php_flag register_globals off -php_flag register_argc_argv off -php_flag magic_quotes_gpc off -php_value variables_order GPCS diff --git a/misc/phpcheck/incfile.php b/misc/phpcheck/incfile.php index 5fc8d18eec6d8dc07fd6ae5a3ba65ef2c6836767..bd16c3705b9167058033f8249d0918419344ac26 100755 --- a/misc/phpcheck/incfile.php +++ b/misc/phpcheck/incfile.php @@ -1,5 +1,10 @@ <?php -SetCookie("test_script_cookie", "Cookie Value!", 0, "/"); + // This checks for my own IP at home. You can just remove the if-statement. +if (1==0 || (substr($_SERVER['REMOTE_ADDR'],0,7)!='192.168' && $_SERVER['REMOTE_ADDR']!='127.0.0.1')) { + die('In the source distribution of TYPO3, this script is disabled by a die() function call.<br/><b>Fix:</b> Open the file misc/phpcheck/incfile.php and remove/out-comment the line that outputs this message!'); +} + +SetCookie('test_script_cookie', 'Cookie Value!', 0, '/'); class t3lib_div { diff --git a/misc/mod_rewrite.htaccess b/misc/simple.htaccess similarity index 100% rename from misc/mod_rewrite.htaccess rename to misc/simple.htaccess diff --git a/t3lib/class.t3lib_db.php b/t3lib/class.t3lib_db.php index 16a5f303841ca0328de81e21c77523742d870aef..1eab201054b5b02884a8b6c6dbda56f5c3451a0e 100755 --- a/t3lib/class.t3lib_db.php +++ b/t3lib/class.t3lib_db.php @@ -901,7 +901,7 @@ class t3lib_DB { /** * Returns information about each field in the $table (quering the DBMS) * In a DBAL this should look up the right handler for the table and return compatible information - * This function is important not only for the Install Tool but probably for DBALs as well since they might need to look up table specific information in order to construct correct queries. In such cases this information should probably be cached for quick delivery + * This function is important not only for the Install Tool but probably for DBALs as well since they might need to look up table specific information in order to construct correct queries. In such cases this information should probably be cached for quick delivery. * * @param string Table name * @return array Field information in an associative array with fieldname => field row @@ -911,7 +911,7 @@ class t3lib_DB { $columns_res = mysql_query('SHOW columns FROM '.$tableName, $this->link); while($fieldRow = mysql_fetch_assoc($columns_res)) { - $output[$fieldRow["Field"]] = $fieldRow; + $output[$fieldRow['Field']] = $fieldRow; } return $output; diff --git a/t3lib/class.t3lib_div.php b/t3lib/class.t3lib_div.php index cc2c69e0d022e3913b2fb31c14e5804bccc14478..32ce301bc7316e92e9321796262f2842590b3da4 100755 --- a/t3lib/class.t3lib_div.php +++ b/t3lib/class.t3lib_div.php @@ -469,8 +469,8 @@ class t3lib_div { * DEPRECIATED. Works ONLY for single-byte charsets! USE t3lib_div::fixed_lgd_cs() instead * Usage: 39 * - * @param string $string string to truncate - * @param integer $chars must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end. + * @param string string to truncate + * @param integer must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end. * @param string String to append to the output if it is truncated, default is '...' * @return string new string * @see fixed_lgd_pre() @@ -495,8 +495,8 @@ class t3lib_div { * DEPRECIATED. Use either fixed_lgd() or fixed_lgd_cs() (with negative input value for $chars) * Usage: 6 * - * @param string $string string to truncate - * @param integer $chars must be an integer of at least 4 + * @param string string to truncate + * @param integer must be an integer of at least 4 * @return string new string * @see fixed_lgd() */ diff --git a/typo3/class.db_list.inc b/typo3/class.db_list.inc index 43914bbbc0d37f5fbf2d7ffb2a1f15aca70bbf27..54b577693d63b81346fe2e8ba747bea7b31e4e53 100755 --- a/typo3/class.db_list.inc +++ b/typo3/class.db_list.inc @@ -84,35 +84,35 @@ class recordList extends t3lib_recordList { // External, static: - var $tableList=''; // Specify a list of tables which are the only ones allowed to be displayed. - var $returnUrl=''; // Return URL - var $thumbs = 0; // Boolean. Thumbnails on records containing files (pictures) + var $tableList=''; // Specify a list of tables which are the only ones allowed to be displayed. + var $returnUrl=''; // Return URL + var $thumbs = 0; // Boolean. Thumbnails on records containing files (pictures) var $itemsLimitPerTable = 20; // default Max items shown per table in "multi-table mode", may be overridden by tables.php var $itemsLimitSingleTable = 100; // default Max items shown per table in "single-table mode", may be overridden by tables.php var $widthGif = '<img src="clear.gif" width="1" height="4" hspace="160" alt="" />'; var $script = 'db_list.php'; // Current script name - var $allFields=0; // Indicates if all available fields for a user should be selected or not. + var $allFields=0; // Indicates if all available fields for a user should be selected or not. var $localizationView=FALSE; // Whether to show localization view or not. // Internal, static: GPvar: - var $csvOutput=FALSE; // If set, csvList is outputted. + var $csvOutput=FALSE; // If set, csvList is outputted. var $sortField; // Field, to sort list by var $sortRev; // Field, indicating to sort in reverse order. var $displayFields; // Array, containing which fields to display in extended mode - var $duplicateField; // String, can contain the field name from a table which must have duplicate values marked. + var $duplicateField; // String, can contain the field name from a table which must have duplicate values marked. // Internal, static: - var $id; // Page id + var $id; // Page id var $table=''; // Tablename if single-table mode - var $listOnlyInSingleTableMode=FALSE; // If true, records are listed only if a specific table is selected. - var $firstElementNumber=0; // Pointer for browsing list - var $searchString=''; // Search string - var $searchLevels=''; // Levels to search down. + var $listOnlyInSingleTableMode=FALSE; // If true, records are listed only if a specific table is selected. + var $firstElementNumber=0; // Pointer for browsing list + var $searchString=''; // Search string + var $searchLevels=''; // Levels to search down. var $showLimit=0; // Number of records to show var $pidSelect=''; // List of ids from which to select/search etc. (when search-levels are set high). See start() - var $perms_clause=''; // Page select permissions + var $perms_clause=''; // Page select permissions var $calcPerms=0; // Some permissions... - var $clickTitleMode = ''; // Mode for what happens when a user clicks the title of a record. + var $clickTitleMode = ''; // Mode for what happens when a user clicks the title of a record. var $modSharedTSconfig = array(); // Shared module configuration, used by localization features // Internal, dynamic: @@ -121,10 +121,10 @@ class recordList extends t3lib_recordList { var $iLimit=0; // "LIMIT " in SQL... var $eCounter=0; // Counting the elements no matter what... var $totalItems=''; // Set to the total number of items for a table when selecting. - var $recPath_cache=array(); // Cache for record path - var $setFields=array(); // Fields to display for the current table - var $currentTable = array(); // Used for tracking next/prev uids - var $duplicateStack=array(); // Used for tracking duplicate values of fields + var $recPath_cache=array(); // Cache for record path + var $setFields=array(); // Fields to display for the current table + var $currentTable = array(); // Used for tracking next/prev uids + var $duplicateStack=array(); // Used for tracking duplicate values of fields diff --git a/typo3/install/index.php b/typo3/install/index.php index 35de88c6d3077ea75796fe8a90379874db15d234..771cdf3342041811f00f624523a4599393e87191 100755 --- a/typo3/install/index.php +++ b/typo3/install/index.php @@ -41,7 +41,7 @@ // ************************************************************************** // This checks for my own IP at home. You can just remove the if-statement. -if (1==0 || (substr($_SERVER['REMOTE_ADDR'],0,7)!='192.168' && $_SERVER['REMOTE_ADDR']!='127.0.0.1')) { +if (1==0 || (substr($_SERVER['REMOTE_ADDR'],0,7)!='192.168' && $_SERVER['REMOTE_ADDR']!='127.0.0.1')) { die("In the source distribution of TYPO3, the install script is disabled by a die() function call.<br/><b>Fix:</b> Open the file typo3/install/index.php and remove/out-comment the line that outputs this message!"); } diff --git a/typo3/sysext/cms/tslib/class.tslib_fe.php b/typo3/sysext/cms/tslib/class.tslib_fe.php index d22cb377895745f82017bb15ee5af7ece77083fb..58d90ce4e7cf4bca9362eb346b694acd5f014fb0 100755 --- a/typo3/sysext/cms/tslib/class.tslib_fe.php +++ b/typo3/sysext/cms/tslib/class.tslib_fe.php @@ -2313,7 +2313,6 @@ // Here we put some temporary stuff in the cache in order to let the first hit generate the page. The temporary cache will expire after a few seconds (typ. 30) or will be cleared by the rendered page, which will also clear and rewrite the cache. $this->tempPageCacheContent(); - // Setting cache_timeout_default. May be overridden by PHP include scritps. $this->cacheTimeOutDefault = intval($this->config['config']['cache_period']); diff --git a/typo3/sysext/cms/tslib/class.tslib_pibase.php b/typo3/sysext/cms/tslib/class.tslib_pibase.php index 6f3203ca7db187e2452ef6458814b9b425912ebd..917eeaf0df79fac45246fedec7a661e5b234ade4 100755 --- a/typo3/sysext/cms/tslib/class.tslib_pibase.php +++ b/typo3/sysext/cms/tslib/class.tslib_pibase.php @@ -132,31 +132,31 @@ class tslib_pibase { // Reserved variables: - var $cObj; // The backReference to the mother cObj object set at call time + var $cObj; // The backReference to the mother cObj object set at call time var $prefixId; // Should be same as classname of the plugin, used for CSS classes, variables var $scriptRelPath; // Path to the plugin class script relative to extension directory, eg. 'pi1/class.tx_newfaq_pi1.php' var $extKey; // Extension key. var $piVars = Array ( // This is the incomming array by name $this->prefixId merged between POST and GET, POST taking precedence. Eg. if the class name is 'tx_myext' then the content of this array will be whatever comes into &tx_myext[...]=... - 'pointer' => '', // Used as a pointer for lists - 'mode' => '', // List mode - 'sword' => '', // Search word - 'sort' => '', // [Sorting column]:[ASC=0/DESC=1] + 'pointer' => '', // Used as a pointer for lists + 'mode' => '', // List mode + 'sword' => '', // Search word + 'sort' => '', // [Sorting column]:[ASC=0/DESC=1] ); var $internal = Array( // Used internally for general storage of values between methods - 'res_count' => 0, // Total query count + 'res_count' => 0, // Total query count 'results_at_a_time' => 20, // pi_list_browseresults(): Show number of results at a time - 'maxPages' => 10, // pi_list_browseresults(): Max number of 'Page 1 - Page 2 - ...' in the list browser + 'maxPages' => 10, // pi_list_browseresults(): Max number of 'Page 1 - Page 2 - ...' in the list browser 'currentRow' => Array(), // Current result row 'currentTable' => '', // Current table ); - var $LOCAL_LANG = Array(); // Local Language content + var $LOCAL_LANG = Array(); // Local Language content var $LOCAL_LANG_charset = Array(); // Local Language content charset for individual labels (overriding) - var $LOCAL_LANG_loaded = 0; // Flag that tells if the locallang file has been fetch (or tried to be fetched) already. - var $LLkey='default'; // Pointer to the language to use. - var $altLLkey=''; // Pointer to alternative fall-back language to use. - var $LLtestPrefix=''; // You can set this during development to some value that makes it easy for you to spot all labels that ARe delivered by the getLL function. - var $LLtestPrefixAlt=''; // Save as LLtestPrefix, but additional prefix for the alternative value in getLL() function calls + var $LOCAL_LANG_loaded = 0; // Flag that tells if the locallang file has been fetch (or tried to be fetched) already. + var $LLkey='default'; // Pointer to the language to use. + var $altLLkey=''; // Pointer to alternative fall-back language to use. + var $LLtestPrefix=''; // You can set this during development to some value that makes it easy for you to spot all labels that ARe delivered by the getLL function. + var $LLtestPrefixAlt=''; // Save as LLtestPrefix, but additional prefix for the alternative value in getLL() function calls var $pi_isOnlyFields = 'mode,pointer'; var $pi_alwaysPrev = 0; @@ -167,7 +167,7 @@ class tslib_pibase { var $pi_autoCacheFields=array(); var $pi_autoCacheEn=0; - var $pi_USER_INT_obj = FALSE; // If set, then links are 1) not using cHash and 2) allowing pages to be cached. (Set this for all USER_INT plugins!) + var $pi_USER_INT_obj = FALSE; // If set, then links are 1) not using cHash and 2) not allowing pages to be cached. (Set this for all USER_INT plugins!) var $pi_checkCHash = FALSE; // If set, then caching is disabled if piVars are incoming while no cHash was set (Set this for all USER plugins!) /** @@ -799,7 +799,13 @@ class tslib_pibase { * @return string HTML content wrapped, ready to return to the parent object. */ function pi_wrapInBaseClass($str) { - return ' + $content = '<div class="'.str_replace('_','-',$this->prefixId).'"> + '.$str.' + </div> + '; + + if(!$GLOBALS['TSFE']->config['config']['disablePrefixComment']) { + $content = ' <!-- @@ -807,12 +813,13 @@ class tslib_pibase { BEGIN: Content of extension "'.$this->extKey.'", plugin "'.$this->prefixId.'" --> - <div class="'.str_replace('_','-',$this->prefixId).'"> - '.$str.' - </div> + '.$content.' <!-- END: Content of extension "'.$this->extKey.'", plugin "'.$this->prefixId.'" --> '; + } + + return $content; } diff --git a/typo3/sysext/indexed_search/class.indexer.php b/typo3/sysext/indexed_search/class.indexer.php index d516bbb00af3bb8c277be993d555624e0008e87e..4f8566c87d2392583c94363c07b58ebd6d31d672 100755 --- a/typo3/sysext/indexed_search/class.indexer.php +++ b/typo3/sysext/indexed_search/class.indexer.php @@ -271,8 +271,8 @@ class tx_indexedsearch_indexer { } else $this->log_setTSlogMessage('Index page? No, page was set to "no_cache" and so cannot be indexed.'); } else $this->log_setTSlogMessage('Index page? No, The "No Search" flag has been set in the page header!'); } else $this->log_setTSlogMessage('Index page? No, Ordinary Frontend indexing during rendering is disabled.'); + $this->log_pull(); } - $this->log_pull(); } diff --git a/typo3/sysext/install/mod/class.tx_install.php b/typo3/sysext/install/mod/class.tx_install.php index f1a7c707d42e5b08a2f16c4cd5bc45e68cadb4b1..533727a5c57086c880dfb45999cf614d92ecf817 100755 --- a/typo3/sysext/install/mod/class.tx_install.php +++ b/typo3/sysext/install/mod/class.tx_install.php @@ -2075,7 +2075,7 @@ From sub-directory: } else $this->messages[]= $errorMessages[] = "Password '".$value."' was longer than 50 chars (...not saved)"; break; case "typo_db_host": - if (!ereg("[^[:alnum:]_\.-:]",$value) && strlen($value)<50) { + if (!ereg("[^[:alnum:]_\.:-]",$value) && strlen($value)<50) { if (strcmp(TYPO3_db_host,$value)) $this->setValueInLocalconfFile($lines, '$typo_db_host', $value); } else $this->messages[]= $errorMessages[] = "Host '".$value."' was not alphanumeric, a-zA-Z0-9_-:., or longer than 50 chars (...not saved)"; break;