Fixed bug #8826: calls to ini_set produces warnings
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 21 Aug 2008 09:31:44 +0000 (09:31 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 21 Aug 2008 09:31:44 +0000 (09:31 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4014 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_db.php
t3lib/class.t3lib_htmlmail.php
typo3/alt_clickmenu.php

index d52ca7b..84ed19c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-21  Dmitry Dulepov  <dmitry@typo3.org>
+
+       * Fixed bug #8826: calls to ini_set produces warnings
+
 2008-08-20  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Added feature #9201: Integrate support for definition list into htmlArea RTE
index 87bd0ae..ce7cb42 100755 (executable)
@@ -781,7 +781,7 @@ class t3lib_DB {
        function sql_error()    {
                return mysql_error($this->link);
        }
-       
+
        /**
         * Returns the error number on the last sql() execution
         * mysql_errno() wrapper function
@@ -791,7 +791,7 @@ class t3lib_DB {
        function sql_errno() {
                return mysql_errno($this->link);
        }
-       
+
        /**
         * Returns the number of selected rows.
         * mysql_num_rows() wrapper function
@@ -908,16 +908,16 @@ class t3lib_DB {
        function sql_pconnect($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password)   {
                        // mysql_error() is tied to an established connection
                        // if the connection fails we need a different method to get the error message
-               ini_set('track_errors', 1);
-               ini_set('html_errors', 0);
+               @ini_set('track_errors', 1);
+               @ini_set('html_errors', 0);
                if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['no_pconnect'])  {
                        $this->link = @mysql_connect($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password);
                } else {
                        $this->link = @mysql_pconnect($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password);
                }
                $error_msg = $php_errormsg;
-               ini_restore('track_errors');
-               ini_restore('html_errors');
+               @ini_restore('track_errors');
+               @ini_restore('html_errors');
 
                if (!$this->link) {
                        t3lib_div::sysLog('Could not connect to MySQL server '.$TYPO3_db_host.' with user '.$TYPO3_db_username.': '.$error_msg,'Core',4);
index 894fa31..00c9ae6 100755 (executable)
@@ -715,7 +715,7 @@ class t3lib_htmlmail {
                        // but instead the php.ini parameter sendmail_from is used.
                $returnPath = (strlen($this->returnPath) > 0) ? '-f "' . escapeshellarg($this->returnPath) . '"' : '';
                if($this->returnPath) {
-                       ini_set('sendmail_from', t3lib_div::normalizeMailAddress($this->returnPath));
+                       @ini_set('sendmail_from', t3lib_div::normalizeMailAddress($this->returnPath));
                }
                $recipient = t3lib_div::normalizeMailAddress($this->recipient);
                $recipient_copy = t3lib_div::normalizeMailAddress($this->recipient_copy);
index f1c1434..e260ed2 100755 (executable)
@@ -171,7 +171,8 @@ class clickMenu {
                $this->CB = t3lib_div::_GP('CB');
                if(t3lib_div::_GP('ajax'))      {
                        $this->ajax = 1;
-                       ini_set('display_errors',0);    // XML has to be parsed, no parse errors allowed
+                       // XML has to be parsed, no parse errors allowed
+                       @ini_set('display_errors', 0);
                }
 
                        // Deal with Drag&Drop context menus
@@ -798,18 +799,18 @@ class clickMenu {
         * @return      array           Item array, element in $menuItems
         */
        function DB_changeFlag($table, $rec, $flagField, $title, $name, $iconRelPath='gfx/')    {
-           $uid = $rec['_ORIG_uid'] ? $rec['_ORIG_uid'] : $rec['uid'];
-           $editOnClick='';
-           $loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
-           $editOnClick='if('.$loc.'){'.$loc.".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
-               "&data[".$table.']['.$uid.']['.$flagField.']='.($rec[$flagField]?0:1).'&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
-
-           return $this->linkItem(
-               $title,
-               $this->excludeIcon('<img'.t3lib_iconWorks::skinImg($this->PH_backPath,$iconRelPath.'button_'.($rec[$flagField]?'un':'').$name.'.gif','width="11" height="10"').' alt="" />'),
-               $editOnClick.'return false;',
-               1
-           );
+               $uid = $rec['_ORIG_uid'] ? $rec['_ORIG_uid'] : $rec['uid'];
+               $editOnClick='';
+               $loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
+               $editOnClick='if('.$loc.'){'.$loc.".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
+                       "&data[".$table.']['.$uid.']['.$flagField.']='.($rec[$flagField]?0:1).'&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
+
+               return $this->linkItem(
+                       $title,
+                       $this->excludeIcon('<img'.t3lib_iconWorks::skinImg($this->PH_backPath,$iconRelPath.'button_'.($rec[$flagField]?'un':'').$name.'.gif','width="11" height="10"').' alt="" />'),
+                       $editOnClick.'return false;',
+                       1
+               );
        }