diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml
index 48811300c00cb..1d966d7ce1ed8 100644
--- a/lib/thirdpartylibs.xml
+++ b/lib/thirdpartylibs.xml
@@ -186,7 +186,7 @@
typo3
Typo3
GPL
- 4.6.8
+ 4.7.4
2.0+
diff --git a/lib/typo3/class.t3lib_cs.php b/lib/typo3/class.t3lib_cs.php
index 75273e2fb531a..2bb2cc742f4a4 100644
--- a/lib/typo3/class.t3lib_cs.php
+++ b/lib/typo3/class.t3lib_cs.php
@@ -194,6 +194,7 @@ class t3lib_cs {
// mapping of iso-639-1 language codes to script names
var $lang_to_script = array(
// iso-639-1 language codes, see http://www.loc.gov/standards/iso639-2/php/code_list.php
+ 'af' => 'west_european', //Afrikaans
'ar' => 'arabic',
'bg' => 'cyrillic', // Bulgarian
'bs' => 'east_european', // Bosnian
@@ -244,6 +245,7 @@ class t3lib_cs {
'zh' => 'chinese',
// MS language codes, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceinternational5/html/wce50conLanguageIdentifiersandLocales.asp
+ 'afk'=> 'west_european', // Afrikaans
'ara' => 'arabic',
'bgr' => 'cyrillic', // Bulgarian
'cat' => 'west_european', // Catalan
@@ -304,6 +306,7 @@ class t3lib_cs {
'trk' => 'turkish',
'ukr' => 'cyrillic', // Ukrainian
// English language names
+ 'afrikaans' => 'west_european',
'albanian' => 'albanian',
'arabic' => 'arabic',
'basque' => 'west_european',
@@ -412,6 +415,7 @@ class t3lib_cs {
// TYPO3 specific: Array with the system charsets used for each system language in TYPO3:
// Empty values means "iso-8859-1"
var $charSetArray = array(
+ 'af' => '',
'ar' => 'iso-8859-6',
'ba' => 'iso-8859-2',
'bg' => 'windows-1251',
@@ -481,7 +485,7 @@ class t3lib_cs {
// TYPO3 specific: Array with the iso names used for each system language in TYPO3:
// Missing keys means: same as TYPO3
- // @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - use t3lib_l10n_Locales::getIsoMapping()
+ // @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - use t3lib_l10n_Locales::getIsoMapping()
var $isoArray = array(
'ba' => 'bs',
'br' => 'pt_BR',
@@ -568,7 +572,7 @@ function get_locale_charset($locale) {
if (TYPO3_OS == 'WIN') {
$cs = $this->script_to_charset_windows[$script] ? $this->script_to_charset_windows[$script] : 'windows-1252';
} else {
- $cs = $this->script_to_charset_unix[$script] ? $this->script_to_charset_unix[$script] : 'iso-8859-1';
+ $cs = $this->script_to_charset_unix[$script] ? $this->script_to_charset_unix[$script] : 'utf-8';
}
return $cs;
@@ -810,26 +814,32 @@ function utf8_to_entities($str) {
* @param boolean If set, then all string-HTML entities (like & or £ will be converted as well)
* @return string Output string
*/
- function entities_to_utf8($str, $alsoStdHtmlEnt = 0) {
+ function entities_to_utf8($str, $alsoStdHtmlEnt = FALSE) {
if ($alsoStdHtmlEnt) {
- $trans_tbl = array_flip(get_html_translation_table(HTML_ENTITIES)); // Getting them in iso-8859-1 - but thats ok since this is observed below.
+ $trans_tbl = array_flip(get_html_translation_table(HTML_ENTITIES, ENT_COMPAT, 'UTF-8'));
}
$token = md5(microtime());
$parts = explode($token, preg_replace('/(&([#[:alnum:]]*);)/', $token . '${2}' . $token, $str));
foreach ($parts as $k => $v) {
- if ($k % 2) {
- if (substr($v, 0, 1) == '#') { // Dec or hex entities:
- if (substr($v, 1, 1) == 'x') {
- $parts[$k] = $this->UnumberToChar(hexdec(substr($v, 2)));
- } else {
- $parts[$k] = $this->UnumberToChar(substr($v, 1));
- }
- } elseif ($alsoStdHtmlEnt && $trans_tbl['&' . $v . ';']) { // Other entities:
- $parts[$k] = $this->utf8_encode($trans_tbl['&' . $v . ';'], 'iso-8859-1');
- } else { // No conversion:
- $parts[$k] = '&' . $v . ';';
+ // only take every second element
+ if ($k % 2 === 0) {
+ continue;
+ }
+
+ $position = 0;
+ if (substr($v, $position, 1) == '#') { // Dec or hex entities:
+ $position++;
+ if (substr($v, $position, 1) == 'x') {
+ $v = hexdec(substr($v, ++$position));
+ } else {
+ $v = substr($v, $position);
}
+ $parts[$k] = $this->UnumberToChar($v);
+ } elseif ($alsoStdHtmlEnt && isset($trans_tbl['&' . $v . ';'])) { // Other entities:
+ $parts[$k] = $trans_tbl['&' . $v . ';'];
+ } else { // No conversion:
+ $parts[$k] = '&' . $v . ';';
}
}
@@ -1696,9 +1706,9 @@ public function convCaseFirst($charset, $string, $case) {
/**
* Converts special chars (like æøåÆØÅ, umlauts etc) to ascii equivalents (usually double-bytes, like æ => ae etc.)
*
- * @param string Character set of string
- * @param string Input string to convert
- * @return string The converted string
+ * @param string $charset Character set of string
+ * @param string $string Input string to convert
+ * @return string The converted string
*/
function specCharsToASCII($charset, $string) {
if ($charset == 'utf-8') {
@@ -2342,4 +2352,4 @@ function euc_char_mapping($str, $charset, $mode, $opt = '') {
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_cs.php']);
}
-?>
\ No newline at end of file
+?>
diff --git a/lib/typo3/class.t3lib_div.php b/lib/typo3/class.t3lib_div.php
index 6a6c241e0ee9c..1d7ddb28f39c8 100644
--- a/lib/typo3/class.t3lib_div.php
+++ b/lib/typo3/class.t3lib_div.php
@@ -375,7 +375,7 @@ public static function fixed_lgd_cs($string, $chars, $appendString = '...') {
} else {
// this case should not happen
$csConvObj = self::makeInstance('t3lib_cs');
- return $csConvObj->crop('iso-8859-1', $string, $chars, $appendString);
+ return $csConvObj->crop('utf-8', $string, $chars, $appendString);
}
}
@@ -386,7 +386,7 @@ public static function fixed_lgd_cs($string, $chars, $appendString = '...') {
* @param string $newlineChar The string to implode the broken lines with (default/typically \n)
* @param integer $lineWidth The line width
* @return string reformatted text
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - Use t3lib_utility_Mail::breakLinesForEmail()
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - Use t3lib_utility_Mail::breakLinesForEmail()
*/
public static function breakLinesForEmail($str, $newlineChar = LF, $lineWidth = 76) {
self::logDeprecatedFunction();
@@ -856,7 +856,7 @@ public static function expandList($list) {
* @param integer $max Higher limit
* @param integer $zeroValue Default value if input is FALSE.
* @return integer The input value forced into the boundaries of $min and $max
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - Use t3lib_utility_Math::forceIntegerInRange() instead
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - Use t3lib_utility_Math::forceIntegerInRange() instead
*/
public static function intInRange($theInt, $min, $max = 2000000000, $zeroValue = 0) {
self::logDeprecatedFunction();
@@ -868,7 +868,7 @@ public static function intInRange($theInt, $min, $max = 2000000000, $zeroValue =
*
* @param integer $theInt Integer string to process
* @return integer
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - Use t3lib_utility_Math::convertToPositiveInteger() instead
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - Use t3lib_utility_Math::convertToPositiveInteger() instead
*/
public static function intval_positive($theInt) {
self::logDeprecatedFunction();
@@ -880,7 +880,7 @@ public static function intval_positive($theInt) {
*
* @param string $verNumberStr Version number on format x.x.x
* @return integer Integer version of version number (where each part can count to 999)
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.9 - Use t3lib_utility_VersionNumber::convertVersionNumberToInteger() instead
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.1 - Use t3lib_utility_VersionNumber::convertVersionNumberToInteger() instead
*/
public static function int_from_ver($verNumberStr) {
// Deprecation log is activated only for TYPO3 4.7 and above
@@ -1066,25 +1066,12 @@ public static function modifyHTMLColorAll($color, $all) {
return self::modifyHTMLColor($color, $all, $all, $all);
}
- /**
- * Removes comma (if present) in the end of string
- *
- * @param string $string String from which the comma in the end (if any) will be removed.
- * @return string
- * @deprecated since TYPO3 4.5, will be removed in TYPO3 4.7 - Use rtrim() directly
- */
- public static function rm_endcomma($string) {
- self::logDeprecatedFunction();
-
- return rtrim($string, ',');
- }
-
/**
* Tests if the input can be interpreted as integer.
*
* @param mixed $var Any input variable to test
* @return boolean Returns TRUE if string is an integer
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - Use t3lib_utility_Math::canBeInterpretedAsInteger() instead
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - Use t3lib_utility_Math::canBeInterpretedAsInteger() instead
*/
public static function testInt($var) {
self::logDeprecatedFunction();
@@ -1177,7 +1164,7 @@ public static function splitCalc($string, $operators) {
* @param string $string Input string, eg "123 + 456 / 789 - 4"
* @return integer Calculated value. Or error string.
* @see calcParenthesis()
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - Use t3lib_utility_Math::calculateWithPriorityToAdditionAndSubtraction() instead
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - Use t3lib_utility_Math::calculateWithPriorityToAdditionAndSubtraction() instead
*/
public static function calcPriority($string) {
self::logDeprecatedFunction();
@@ -1191,7 +1178,7 @@ public static function calcPriority($string) {
* @param string $string Input string, eg "(123 + 456) / 789 - 4"
* @return integer Calculated value. Or error string.
* @see calcPriority(), tslib_cObj::stdWrap()
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - Use t3lib_utility_Math::calculateWithParentheses() instead
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - Use t3lib_utility_Math::calculateWithParentheses() instead
*/
public static function calcParenthesis($string) {
self::logDeprecatedFunction();
@@ -1272,7 +1259,10 @@ public static function validEmail($email) {
if (strlen($email) > 320) {
return FALSE;
}
- return (filter_var($email, FILTER_VALIDATE_EMAIL) !== FALSE);
+ require_once(PATH_typo3 . 'contrib/idna/idna_convert.class.php');
+ $IDN = new idna_convert(array('idn_version' => 2008));
+
+ return (filter_var($IDN->encode($email), FILTER_VALIDATE_EMAIL) !== FALSE);
}
/**
@@ -1522,7 +1512,10 @@ public static function lcfirst($string) {
* @return boolean Whether the given URL is valid
*/
public static function isValidUrl($url) {
- return (filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) !== FALSE);
+ require_once(PATH_typo3 . 'contrib/idna/idna_convert.class.php');
+ $IDN = new idna_convert(array('idn_version' => 2008));
+
+ return (filter_var($IDN->encode($url), FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) !== FALSE);
}
@@ -1862,28 +1855,30 @@ public static function remapArrayKeys(&$array, $mappingTable) {
* @param array $arr1 Second array, overruling the first array
* @param boolean $notAddKeys If set, keys that are NOT found in $arr0 (first array) will not be set. Thus only existing value can/will be overruled from second array.
* @param boolean $includeEmptyValues If set, values from $arr1 will overrule if they are empty or zero. Default: TRUE
+ * @param boolean $enableUnsetFeature If set, special values "__UNSET" can be used in the second array in order to unset array keys in the resulting array.
* @return array Resulting array where $arr1 values has overruled $arr0 values
*/
- public static function array_merge_recursive_overrule(array $arr0, array $arr1, $notAddKeys = FALSE, $includeEmptyValues = TRUE) {
+ public static function array_merge_recursive_overrule(array $arr0, array $arr1, $notAddKeys = FALSE, $includeEmptyValues = TRUE, $enableUnsetFeature = TRUE) {
foreach ($arr1 as $key => $val) {
if (is_array($arr0[$key])) {
if (is_array($arr1[$key])) {
- $arr0[$key] = self::array_merge_recursive_overrule($arr0[$key], $arr1[$key], $notAddKeys, $includeEmptyValues);
+ $arr0[$key] = self::array_merge_recursive_overrule(
+ $arr0[$key],
+ $arr1[$key],
+ $notAddKeys,
+ $includeEmptyValues,
+ $enableUnsetFeature
+ );
}
- } else {
- if ($notAddKeys) {
- if (isset($arr0[$key])) {
- if ($includeEmptyValues || $val) {
- $arr0[$key] = $val;
- }
- }
- } else {
- if ($includeEmptyValues || $val) {
- $arr0[$key] = $val;
- }
+ } elseif (!$notAddKeys || isset($arr0[$key])) {
+ if ($enableUnsetFeature && $val === '__UNSET') {
+ unset($arr0[$key]);
+ } elseif ($includeEmptyValues || $val) {
+ $arr0[$key] = $val;
}
}
}
+
reset($arr0);
return $arr0;
}
@@ -2198,16 +2193,8 @@ public static function xml2tree($string, $depth = 999) {
*/
public static function array2xml_cs(array $array, $docTag = 'phparray', array $options = array(), $charset = '') {
- // Figure out charset if not given explicitly:
- if (!$charset) {
- if ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) { // First priority: forceCharset! If set, this will be authoritative!
- $charset = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'];
- } elseif (is_object($GLOBALS['LANG'])) {
- $charset = $GLOBALS['LANG']->charSet; // If "LANG" is around, that will hold the current charset
- } else {
- $charset = 'iso-8859-1'; // THIS is just a hopeful guess!
- }
- }
+ // Set default charset unless explicitly specified
+ $charset = $charset ? $charset : 'utf-8';
// Return XML:
return '' . LF .
@@ -2406,7 +2393,7 @@ protected static function xml2arrayProcess($string, $NSprefix = '', $reportDocTa
// default output charset is UTF-8, only ASCII, ISO-8859-1 and UTF-8 are supported!!!
$match = array();
preg_match('/^[[:space:]]*<\?xml[^>]*encoding[[:space:]]*=[[:space:]]*"([^"]*)"/', substr($string, 0, 200), $match);
- $theCharset = $match[1] ? $match[1] : ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] : 'iso-8859-1');
+ $theCharset = $match[1] ? $match[1] : 'utf-8';
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $theCharset); // us-ascii / utf-8 / iso-8859-1
// Parse content:
@@ -2742,10 +2729,10 @@ public static function getUrl($url, $includeHeader = 0, $requestHeaders = FALSE,
)
);
- $content = file_get_contents($url, FALSE, $ctx);
+ $content = @file_get_contents($url, FALSE, $ctx);
if ($content === FALSE && isset($report)) {
- $report['error'] = -1;
+ $report['error'] = -1;
$report['message'] = 'Couldn\'t get URL: ' . implode(LF, $http_response_header);
}
} else {
@@ -2753,10 +2740,10 @@ public static function getUrl($url, $includeHeader = 0, $requestHeaders = FALSE,
$report['lib'] = 'file';
}
- $content = file_get_contents($url);
+ $content = @file_get_contents($url);
if ($content === FALSE && isset($report)) {
- $report['error'] = -1;
+ $report['error'] = -1;
$report['message'] = 'Couldn\'t get URL: ' . implode(LF, $http_response_header);
}
}
@@ -2989,7 +2976,7 @@ protected static function createDirectoryPath($fullDirectoryPath) {
$result = @mkdir($fullDirectoryPath, $permissionMask, TRUE);
if (!$result) {
- throw new \RuntimeException('Could not create directory!', 1170251400);
+ throw new \RuntimeException('Could not create directory "' . $fullDirectoryPath . '"!', 1170251400);
}
}
return $firstCreatedPath;
@@ -3090,7 +3077,7 @@ public static function getFilesInDir($path, $extensionList = '', $prependPath =
$sortarray[$key] = filemtime($path . '/' . $entry);
}
elseif ($order) {
- $sortarray[$key] = $entry;
+ $sortarray[$key] = strtolower($entry);
}
}
}
@@ -3341,99 +3328,6 @@ public static function createVersionNumberedFilename($file, $forceQueryString =
return $fullName;
}
-
- /*************************
- *
- * DEBUG helper FUNCTIONS
- *
- *************************/
-
- /* Deprecated since 4.5, use t3lib_utility_Debug */
-
-
- /**
- * Returns a string with a list of ascii-values for the first $characters characters in $string
- *
- * @param string $string String to show ASCII value for
- * @param integer $characters Number of characters to show
- * @return string The string with ASCII values in separated by a space char.
- * @deprecated since TYPO3 4.5 - Use t3lib_utility_Debug::ordinalValue instead
- */
- public static function debug_ordvalue($string, $characters = 100) {
- self::logDeprecatedFunction();
- return t3lib_utility_Debug::ordinalValue($string, $characters);
- }
-
- /**
- * Returns HTML-code, which is a visual representation of a multidimensional array
- * use t3lib_div::print_array() in order to print an array
- * Returns FALSE if $array_in is not an array
- *
- * @param mixed $array_in Array to view
- * @return string HTML output
- * @deprecated since TYPO3 4.5 - Use t3lib_utility_Debug::viewArray instead
- */
- public static function view_array($array_in) {
- self::logDeprecatedFunction();
- return t3lib_utility_Debug::viewArray($array_in);
- }
-
- /**
- * Prints an array
- *
- * @param mixed $array_in Array to print visually (in a table).
- * @return void
- * @see view_array()
- * @deprecated since TYPO3 4.5 - Use t3lib_utility_Debug::printArray instead
- */
- public static function print_array($array_in) {
- self::logDeprecatedFunction();
- t3lib_utility_Debug::printArray($array_in);
- }
-
- /**
- * Makes debug output
- * Prints $var in bold between two vertical lines
- * If not $var the word 'debug' is printed
- * If $var is an array, the array is printed by t3lib_div::print_array()
- *
- * @param mixed $var Variable to print
- * @param string $header The header.
- * @param string $group Group for the debug console
- * @return void
- * @deprecated since TYPO3 4.5 - Use t3lib_utility_Debug::debug instead
- */
- public static function debug($var = '', $header = '', $group = 'Debug') {
- self::logDeprecatedFunction();
- t3lib_utility_Debug::debug($var, $header, $group);
- }
-
- /**
- * Displays the "path" of the function call stack in a string, using debug_backtrace
- *
- * @return string
- * @deprecated since TYPO3 4.5 - Use t3lib_utility_Debug::debugTrail instead
- */
- public static function debug_trail() {
- self::logDeprecatedFunction();
- return t3lib_utility_Debug::debugTrail();
- }
-
- /**
- * Displays an array as rows in a table. Useful to debug output like an array of database records.
- *
- * @param mixed $rows Array of arrays with similar keys
- * @param string $header Table header
- * @param boolean $returnHTML If TRUE, will return content instead of echo'ing out.
- * @return mixed Outputs to browser or returns an HTML string if $returnHTML is TRUE
- * @deprecated since TYPO3 4.5 - Use t3lib_utility_Debug::debugRows instead
- */
- public static function debugRows($rows, $header = '', $returnHTML = FALSE) {
- self::logDeprecatedFunction();
- return t3lib_utility_Debug::debugRows($rows, $header, $returnHTML);
- }
-
-
/*************************
*
* SYSTEM INFORMATION
@@ -3750,7 +3644,7 @@ public static function getIndpEnv($getEnvName) {
if ($proxySSL == '*') {
$proxySSL = $GLOBALS['TYPO3_CONF_VARS']['SYS']['reverseProxyIP'];
}
- if (self::cmpIP($_SERVER['REMOTE_ADDR'], $proxySSL)) {
+ if (self::cmpIP(self::getIndpEnv('REMOTE_ADDR'), $proxySSL)) {
$retVal = TRUE;
} else {
$retVal = $_SERVER['SSL_SESSION_ID'] || !strcasecmp($_SERVER['HTTPS'], 'on') || !strcmp($_SERVER['HTTPS'], '1') ? TRUE : FALSE; // see http://bugs.typo3.org/view.php?id=3909
@@ -3959,7 +3853,7 @@ public static function getFileAbsFileName($filename, $onlyRelative = TRUE, $relT
* So it's compatible with the UNIX style path strings valid for TYPO3 internally.
*
* @param string $theFile File path to evaluate
- * @return boolean TRUE, $theFile is allowed path string
+ * @return boolean TRUE, $theFile is allowed path string, FALSE otherwise
* @see http://php.net/manual/en/security.filesystem.nullbytes.php
* @todo Possible improvement: Should it rawurldecode the string first to check if any of these characters is encoded?
*/
@@ -3967,6 +3861,8 @@ public static function validPathStr($theFile) {
if (strpos($theFile, '//') === FALSE && strpos($theFile, '\\') === FALSE && !preg_match('#(?:^\.\.|/\.\./|[[:cntrl:]])#u', $theFile)) {
return TRUE;
}
+
+ return FALSE;
}
/**
@@ -4175,18 +4071,15 @@ public static function stdAuthCode($uid_or_record, $fields = '', $codeLength = 8
* @param string $addQueryParams Query-parameters: "&xxx=yyy&zzz=uuu"
* @return array Array with key/value pairs of query-parameters WITHOUT a certain list of variable names (like id, type, no_cache etc.) and WITH a variable, encryptionKey, specific for this server/installation
* @see tslib_fe::makeCacheHash(), tslib_cObj::typoLink(), t3lib_div::calculateCHash()
+ * @deprecated since TYPO3 4.7 - will be removed in TYPO3 6.1 - use t3lib_cacheHash instead
*/
public static function cHashParams($addQueryParams) {
+ t3lib_div::logDeprecatedFunction();
$params = explode('&', substr($addQueryParams, 1)); // Splitting parameters up
+ /* @var $cacheHash t3lib_cacheHash */
+ $cacheHash = t3lib_div::makeInstance('t3lib_cacheHash');
+ $pA = $cacheHash->getRelevantParameters($addQueryParams);
- // Make array:
- $pA = array();
- foreach ($params as $theP) {
- $pKV = explode('=', $theP); // Splitting single param by '=' sign
- if (!self::inList('id,type,no_cache,cHash,MP,ftu', $pKV[0]) && !preg_match('/TSFE_ADMIN_PANEL\[.*?\]/', $pKV[0])) {
- $pA[rawurldecode($pKV[0])] = (string) rawurldecode($pKV[1]);
- }
- }
// Hook: Allows to manipulate the parameters which are taken to build the chash:
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['cHashParamsHook'])) {
$cHashParamsHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['cHashParamsHook'];
@@ -4202,9 +4095,6 @@ public static function cHashParams($addQueryParams) {
}
}
}
- // Finish and sort parameters array by keys:
- $pA['encryptionKey'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
- ksort($pA);
return $pA;
}
@@ -4215,11 +4105,13 @@ public static function cHashParams($addQueryParams) {
* @param string $addQueryParams Query-parameters: "&xxx=yyy&zzz=uuu"
* @return string Hash of all the values
* @see t3lib_div::cHashParams(), t3lib_div::calculateCHash()
+ * @deprecated since TYPO3 4.7 - will be removed in TYPO3 6.1 - use t3lib_cacheHash instead
*/
public static function generateCHash($addQueryParams) {
- $cHashParams = self::cHashParams($addQueryParams);
- $cHash = self::calculateCHash($cHashParams);
- return $cHash;
+ t3lib_div::logDeprecatedFunction();
+ /* @var $cacheHash t3lib_cacheHash */
+ $cacheHash = t3lib_div::makeInstance('t3lib_cacheHash');
+ return $cacheHash->generateForParameters($addQueryParams);
}
/**
@@ -4227,10 +4119,13 @@ public static function generateCHash($addQueryParams) {
*
* @param array $params Array of key-value pairs
* @return string Hash of all the values
+ * @deprecated since TYPO3 4.7 - will be removed in TYPO3 6.1 - use t3lib_cacheHash instead
*/
public static function calculateCHash($params) {
- $cHash = md5(serialize($params));
- return $cHash;
+ t3lib_div::logDeprecatedFunction();
+ /* @var $cacheHash t3lib_cacheHash */
+ $cacheHash = t3lib_div::makeInstance('t3lib_cacheHash');
+ return $cacheHash->calculateCacheHash($params);
}
/**
@@ -4282,7 +4177,7 @@ public static function readLLfile($fileRef, $langKey, $charset = '', $errorMode
* @param string $langKey TYPO3 language key, eg. "dk" or "de" or "default"
* @param string $charset Character set (optional)
* @return array LOCAL_LANG array in return.
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - use t3lib_l10n_parser_Llphp::getParsedData() from now on
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - use t3lib_l10n_parser_Llphp::getParsedData() from now on
*/
public static function readLLPHPfile($fileRef, $langKey, $charset = '') {
t3lib_div::logDeprecatedFunction();
@@ -4298,14 +4193,11 @@ public static function readLLPHPfile($fileRef, $langKey, $charset = '') {
if (@is_file($fileRef) && $langKey) {
// Set charsets:
- $sourceCharset = $csConvObj->parse_charset($csConvObj->charSetArray[$langKey] ? $csConvObj->charSetArray[$langKey] : 'iso-8859-1');
+ $sourceCharset = $csConvObj->parse_charset($csConvObj->charSetArray[$langKey] ? $csConvObj->charSetArray[$langKey] : 'utf-8');
if ($charset) {
$targetCharset = $csConvObj->parse_charset($charset);
- } elseif ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) {
- // when forceCharset is set, we store ALL labels in this charset!!!
- $targetCharset = $csConvObj->parse_charset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']);
} else {
- $targetCharset = $csConvObj->parse_charset($csConvObj->charSetArray[$langKey] ? $csConvObj->charSetArray[$langKey] : 'iso-8859-1');
+ $targetCharset = 'utf-8';
}
// Cache file name:
@@ -4328,9 +4220,9 @@ public static function readLLPHPfile($fileRef, $langKey, $charset = '') {
// converting the default language (English)
// this needs to be done for a few accented loan words and extension names
- if (is_array($LOCAL_LANG['default']) && $targetCharset != 'iso-8859-1') {
+ if (is_array($LOCAL_LANG['default']) && $targetCharset != 'utf-8') {
foreach ($LOCAL_LANG['default'] as &$labelValue) {
- $labelValue = $csConvObj->conv($labelValue, 'iso-8859-1', $targetCharset);
+ $labelValue = $csConvObj->conv($labelValue, 'utf-8', $targetCharset);
}
unset($labelValue);
}
@@ -4369,7 +4261,7 @@ public static function readLLPHPfile($fileRef, $langKey, $charset = '') {
* @param string $langKey TYPO3 language key, eg. "dk" or "de" or "default"
* @param string $charset Character set (optional)
* @return array LOCAL_LANG array in return.
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - use t3lib_l10n_parser_Llxml::getParsedData() from now on
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - use t3lib_l10n_parser_Llxml::getParsedData() from now on
*/
public static function readLLXMLfile($fileRef, $langKey, $charset = '') {
t3lib_div::logDeprecatedFunction();
@@ -4388,11 +4280,8 @@ public static function readLLXMLfile($fileRef, $langKey, $charset = '') {
// Set charset:
if ($charset) {
$targetCharset = $csConvObj->parse_charset($charset);
- } elseif ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) {
- // when forceCharset is set, we store ALL labels in this charset!!!
- $targetCharset = $csConvObj->parse_charset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']);
} else {
- $targetCharset = $csConvObj->parse_charset($csConvObj->charSetArray[$langKey] ? $csConvObj->charSetArray[$langKey] : 'iso-8859-1');
+ $targetCharset = 'utf-8';
}
// Cache file name:
@@ -5177,7 +5066,7 @@ public static function requireFile($requireFile) {
/**
* Simple substitute for the PHP function mail() which allows you to specify encoding and character set
* The fifth parameter ($encoding) will allow you to specify 'base64' encryption for the output (set $encoding=base64)
- * Further the output has the charset set to ISO-8859-1 by default.
+ * Further the output has the charset set to UTF-8 by default.
*
* @param string $email Email address to send to. (see PHP function mail())
* @param string $subject Subject line, non-encoded. (see PHP function mail())
@@ -5190,7 +5079,7 @@ public static function requireFile($requireFile) {
*/
public static function plainMailEncoded($email, $subject, $message, $headers = '', $encoding = 'quoted-printable', $charset = '', $dontEncodeHeader = FALSE) {
if (!$charset) {
- $charset = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] : 'ISO-8859-1';
+ $charset = 'utf-8';
}
$email = self::normalizeMailAddress($email);
@@ -5305,7 +5194,7 @@ public static function quoted_printable($string, $maxlen = 76) {
* @param string $charset Charset used for encoding
* @return string The encoded string
*/
- public static function encodeHeader($line, $enc = 'quoted-printable', $charset = 'iso-8859-1') {
+ public static function encodeHeader($line, $enc = 'quoted-printable', $charset = 'utf-8') {
// Avoid problems if "###" is found in $line (would conflict with the placeholder which is used below)
if (strpos($line, '###') !== FALSE) {
return $line;
@@ -5361,30 +5250,32 @@ public static function encodeHeader($line, $enc = 'quoted-printable', $charset =
* @see makeRedirectUrl()
*/
public static function substUrlsInPlainText($message, $urlmode = '76', $index_script_url = '') {
- // Substitute URLs with shorter links:
- foreach (array('http', 'https') as $protocol) {
- $urlSplit = explode($protocol . '://', $message);
- foreach ($urlSplit as $c => &$v) {
- if ($c) {
- $newParts = preg_split('/\s|[<>"{}|\\\^`()\']/', $v, 2);
- $newURL = $protocol . '://' . $newParts[0];
-
- switch ((string) $urlmode) {
- case 'all':
- $newURL = self::makeRedirectUrl($newURL, 0, $index_script_url);
- break;
- case '76':
- $newURL = self::makeRedirectUrl($newURL, 76, $index_script_url);
- break;
- }
- $v = $newURL . substr($v, strlen($newParts[0]));
- }
- }
- unset($v);
- $message = implode('', $urlSplit);
+ $lengthLimit = FALSE;
+
+ switch ((string) $urlmode) {
+ case '':
+ $lengthLimit = FALSE;
+ break;
+ case 'all':
+ $lengthLimit = 0;
+ break;
+ case '76':
+ default:
+ $lengthLimit = (int) $urlmode;
}
- return $message;
+ if ($lengthLimit === FALSE) {
+ // no processing
+ $messageSubstituted = $message;
+ } else {
+ $messageSubstituted = preg_replace(
+ '/(http|https):\/\/.+(?=[\]\.\?]*([\! \'"()<>]+|$))/eiU',
+ 'self::makeRedirectUrl("\\0",' . $lengthLimit . ',"' . $index_script_url . '")',
+ $message
+ );
+ }
+
+ return $messageSubstituted;
}
/**
@@ -5775,25 +5666,15 @@ public static function unQuoteFilenames($parameters, $unQuote = FALSE) {
/**
- * Quotes a string for usage as JS parameter. Depends whether the value is
- * used in script tags (it doesn't need/must not get htmlspecialchar'ed in
- * this case).
+ * Quotes a string for usage as JS parameter.
*
* @param string $value the string to encode, may be empty
- * @param boolean $withinCData
- * whether the escaped data is expected to be used as CDATA and thus
- * does not need to be htmlspecialchared
*
* @return string the encoded value already quoted (with single quotes),
* will not be empty
*/
- static public function quoteJSvalue($value, $withinCData = FALSE) {
- $escapedValue = addcslashes(
- $value, '\'' . '"' . '\\' . TAB . LF . CR
- );
- if (!$withinCData) {
- $escapedValue = htmlspecialchars($escapedValue);
- }
+ public static function quoteJSvalue($value) {
+ $escapedValue = t3lib_div::makeInstance('t3lib_codec_JavaScriptEncoder')->encode($value);
return '\'' . $escapedValue . '\'';
}
diff --git a/lib/typo3/class.t3lib_l10n_locales.php b/lib/typo3/class.t3lib_l10n_locales.php
index 160f0ffddaa67..535bc5ccad2b6 100644
--- a/lib/typo3/class.t3lib_l10n_locales.php
+++ b/lib/typo3/class.t3lib_l10n_locales.php
@@ -47,6 +47,7 @@ class t3lib_l10n_Locales implements t3lib_Singleton {
*/
protected $languages = array(
'default' => 'English',
+ 'af' => 'Afrikaans',
'ar' => 'Arabic',
'bs' => 'Bosnian',
'bg' => 'Bulgarian',
@@ -101,7 +102,7 @@ class t3lib_l10n_Locales implements t3lib_Singleton {
/**
* Supported TYPO3 locales
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0
* @var array
*/
protected $locales = array();
@@ -176,12 +177,12 @@ public static function initialize() {
}
/**
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0
*/
$instance->locales = array_keys($instance->languages);
/**
- * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
+ * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0
*/
define('TYPO3_languages', implode('|', $instance->getLocales()));
}
diff --git a/lib/typo3/readme_moodle.txt b/lib/typo3/readme_moodle.txt
index 7f390fdeb9781..d45a1835b7b44 100644
--- a/lib/typo3/readme_moodle.txt
+++ b/lib/typo3/readme_moodle.txt
@@ -1,10 +1,12 @@
-Description of Typo3 libraries (v 4.6.8) import into Moodle
+Description of Typo3 libraries (v 4.7.4) import into Moodle
Changes: none
skodak, stronk7
+Previous changes:
+
25 June 2010 - Martin D (4.3.0RC1)
I renamed getURL to getUrl since it was being called that way everywhere.
I added a check to avoid notices on lib/typo3/class.t3lib_cs.php line 976