Project

General

Profile

Bug #22410 » 14050_cleaning_t3lib_utility_directory.patch

Administrator Admin, 2010-11-25 00:59

View differences:

t3lib/utility/class.t3lib_utility_http.php (revision )
<?php
/***************************************************************
* Copyright notice
*
* (c) 2009-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* 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.
*
* 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
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
* Copyright notice
*
* (c) 2009-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* 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.
*
* 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
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
t3lib/utility/class.t3lib_utility_dependency.php (revision )
* @return t3lib_utility_Dependency
*/
public function setOuterMostParentsRequireReferences($outerMostParentsRequireReferences) {
$this->outerMostParentsRequireReferences = (bool)$outerMostParentsRequireReferences;
$this->outerMostParentsRequireReferences = (bool) $outerMostParentsRequireReferences;
return $this;
}
......
return $this->factory;
}
}
?>
t3lib/utility/dependency/class.t3lib_utility_dependency_element.php (revision )
'*',
'sys_refindex',
'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->table, 'sys_refindex') .
' AND recuid=' . $this->id
' AND recuid=' . $this->id
);
if (is_array($rows)) {
foreach ($rows as $row) {
......
'*',
'sys_refindex',
'ref_table=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->table, 'sys_refindex') .
' AND deleted=0 AND ref_uid=' . $this->id
' AND deleted=0 AND ref_uid=' . $this->id
);
if (is_array($rows)) {
foreach ($rows as $row) {
t3lib/utility/class.t3lib_utility_mail.php (revision )
* @param string Email address to send to.
* @param string Subject line, non-encoded. (see PHP function mail())
* @param string Message content, non-encoded. (see PHP function mail())
* @param string Additional headers for the mail (see PHP function mail())
* @param string Additional headers for the mail (see PHP function mail())
* @param string Additional flags for the sending mail tool (see PHP function mail())
* @return boolean Indicates whether the mail has been sent or not
* @see PHP function mail() []
* @link http://www.php.net/manual/en/function.mail.php
*/
public static function mail($to, $subject, $messageBody, $additionalHeaders = null, $additionalParameters = null) {
public static function mail($to, $subject, $messageBody, $additionalHeaders = NULL, $additionalParameters = NULL) {
$success = TRUE;
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'])) {
$parameters = array(
......
return $success;
}
}
?>
t3lib/utility/class.t3lib_utility_client.php (revision )
'useragent' => $userAgent,
);
// Analyze the userAgent string
// Declare known browsers to look for
// Analyze the userAgent string
// Declare known browsers to look for
$known = array('msie', 'firefox', 'webkit', 'opera', 'netscape', 'konqueror',
'gecko', 'chrome', 'safari', 'seamonkey', 'navigator', 'mosaic',
'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol');
'gecko', 'chrome', 'safari', 'seamonkey', 'navigator', 'mosaic',
'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol');
$matches = array();
$pattern = '#(?P<browser>' . join('|', $known) . ')[/ ]+(?P<version>[0-9]+(?:\.[0-9]+)?)#';
......
} elseif (strstr($userAgent, 'Win16') || strstr($userAgent, 'Windows 311')) {
$browserInfo['system'] = 'win311';
}
} elseif (strstr($userAgent,'Mac')) {
} elseif (strstr($userAgent, 'Mac')) {
$browserInfo['system'] = 'mac';
// unixes
// unixes
} elseif (strstr($userAgent, 'Linux')) {
$browserInfo['system'] = 'linux';
} elseif (strstr($userAgent, 'SGI') && strstr($userAgent, ' IRIX ')) {
......
$getDeviceTypeHooks =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/div/class.t3lib_utility_client.php']['getDeviceType'];
if (is_array($getDeviceTypeHooks)) {
foreach ($getDeviceTypeHooks as $hookFunction) {
$returnResult = true;
$returnResult = TRUE;
$hookParameters = array(
'userAgent' => &$userAgent,
'returnResult' => &$returnResult,
......
$deviceType = '';
// pda
if(strstr($userAgent, 'avantgo')) {
if (strstr($userAgent, 'avantgo')) {
$deviceType = 'pda';
}
// wap
$browser=substr($userAgent, 0, 4);
$browser = substr($userAgent, 0, 4);
$wapviwer=substr(stristr($userAgent,'wap'), 0, 3);
$wapviwer = substr(stristr($userAgent, 'wap'), 0, 3);
if($wapviwer == 'wap' ||
if ($wapviwer == 'wap' ||
$browser == 'noki' ||
$browser == 'eric' ||
$browser == 'r380' ||
......
$deviceType = 'wap';
}
// grabber
if(strstr($userAgent, 'g.r.a.b.') ||
if (strstr($userAgent, 'g.r.a.b.') ||
strstr($userAgent, 'utilmind httpget') ||
strstr($userAgent, 'webcapture') ||
strstr($userAgent, 'teleport') ||
......
$deviceType = 'grabber';
}
// robots
if(strstr($userAgent, 'crawler') ||
if (strstr($userAgent, 'crawler') ||
strstr($userAgent, 'spider') ||
strstr($userAgent, 'googlebot') ||
strstr($userAgent, 'searchbot') ||
......
return $deviceType;
}
}
?>
t3lib/utility/class.t3lib_utility_phpoptions.php (revision )
return filter_var(ini_get($configOption), FILTER_VALIDATE_BOOLEAN, array(FILTER_REQUIRE_SCALAR, FILTER_NULL_ON_FAILURE));
}
}
?>
t3lib/utility/class.t3lib_utility_debug.php (revision )
public function debug($var = '', $header = '', $group = 'Debug') {
// buffer the output of debug if no buffering started before
// buffer the output of debug if no buffering started before
if (ob_get_level() == 0) {
ob_start();
}
......
*/
public static function prepareVariableForJavascript($string, $asObject) {
if ($asObject) {
$string = str_replace(array (
$string = str_replace(array(
'"', '/', '<', "\n", "\r"
'"', '/', '<', "\n", "\r"
), array (
), array(
'\"', '\/', '\<', '<br />', ''
), $string);
'\"', '\/', '\<', '<br />', ''
), $string);
} else {
$string = str_replace(array (
$string = str_replace(array(
'"', '/', '<', "\n", "\r"
'"', '/', '<', "\n", "\r"
), array (
), array(
'\"', '\/', '\<', '', ''
), $string);
'\"', '\/', '\<', '', ''
), $string);
}
return $string;
......
$trail = array_reverse($trail);
array_pop($trail);
$path = array ();
$path = array();
foreach ($trail as $dat) {
$path[] = $dat['class'] . $dat['type'] . $dat['function'] . '#' . $dat['line'];
}
......
$firstEl = current($rows);
if (is_array($firstEl)) {
$headerColumns = array_keys($firstEl);
$tRows = array ();
$tRows = array();
// Header:
// Header:
$tRows[] = '<tr><td colspan="' . count($headerColumns) .
'" style="background-color:#bbbbbb; font-family: verdana,arial; font-weight: bold; font-size: 10px;"><strong>' .
htmlspecialchars($header) . '</strong></td></tr>';
'" style="background-color:#bbbbbb; font-family: verdana,arial; font-weight: bold; font-size: 10px;"><strong>' .
htmlspecialchars($header) . '</strong></td></tr>';
$tCells = array ();
$tCells = array();
foreach ($headerColumns as $key) {
$tCells[] = '
<td><font face="Verdana,Arial" size="1"><strong>' . htmlspecialchars($key) . '</strong></font></td>';
......
<tr>' . implode('', $tCells) . '
</tr>';
// Rows:
// Rows:
foreach ($rows as $singleRow) {
$tCells = array ();
$tCells = array();
foreach ($headerColumns as $key) {
$tCells[] = '
<td><font face="Verdana,Arial" size="1">' .
(is_array($singleRow[$key]) ? self::debugRows($singleRow[$key], '', TRUE) : htmlspecialchars($singleRow[$key])) .
'</font></td>';
(is_array($singleRow[$key]) ? self::debugRows($singleRow[$key], '', TRUE) : htmlspecialchars($singleRow[$key])) .
'</font></td>';
}
$tRows[] = '
<tr>' . implode('', $tCells) . '
......
$table = '
<table border="1" cellpadding="1" cellspacing="0" bgcolor="white">' . implode('', $tRows) . '
</table>';
if ($returnHTML)
if ($returnHTML) {
return $table;
}
else
{
echo $table;
}
} else
{
debug('Empty array of rows', $header);
}
} else {
debug('No array of rows', $header);
}
......
* @deprecated since TYPO3 4.5 - Use t3lib_utility_Debug::debug_ordvalue instead
*/
public function ordinalValue($string, $characters = 100) {
if (strlen($string) < $characters)
if (strlen($string) < $characters) {
$characters = strlen($string);
}
for ($i = 0; $i < $characters; $i++) {
$valuestring .= ' ' . ord(substr($string, $i, 1));
}
......
$string .= print_r($val, TRUE);
}
$result .= '<font face="Verdana,Arial" size="1" color="red">' .
nl2br(htmlspecialchars($string)) .
'<br /></font>';
nl2br(htmlspecialchars($string)) .
'<br /></font>';
} else {
if (gettype($val) == 'object') {
$string = 'Unknown object';
......
$string = (string) $val;
}
$result .= '<font face="Verdana,Arial" size="1" color="red">' .
nl2br(htmlspecialchars($string)) .
'<br /></font>';
nl2br(htmlspecialchars($string)) .
'<br /></font>';
}
$result .= '</td>
</tr>';
......
$result = '<table border="1" cellpadding="1" cellspacing="0" bgcolor="white">
<tr>
<td><font face="Verdana,Arial" size="1" color="red">' .
nl2br(htmlspecialchars((string) $array_in)) .
'<br /></font></td>
nl2br(htmlspecialchars((string) $array_in)) .
'<br /></font></td>
</tr>
</table>'; // Output it as a string.
}
......
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/utility/class.t3lib_utility_debug.php']) {
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/utility/class.t3lib_utility_debug.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/utility/class.t3lib_utility_debug.php']);
}
?>
(93-93/93)