Project

General

Profile

Bug #21143 » 12066_v2.diff

Administrator Admin, 2009-10-21 00:06

View differences:

tests/regularexpression_testcase.php (working copy)
*/
public function split1() {
$string = 'test1, test2|test3;test4';
$array1 = split(',|;|'.chr(10),$string);
$array2 = preg_split('/[,;'.chr(10).']/',$string);
$array1 = split(',|;|'.LF,$string);
$array2 = preg_split('/[,;'.LF.']/',$string);
foreach($array1 as $key => $value) {
$this->assertTrue(
($array2[$key] === $value)
tests/t3lib/t3lib_div_testcase.php (working copy)
* @test
*/
public function checkTrimExplodeRemovesNewLines() {
$testString = ' a , b , ' . chr(10) . ' ,d ,, e,f,';
$testString = ' a , b , ' . LF . ' ,d ,, e,f,';
$expectedArray = array('a', 'b', 'd', 'e', 'f');
$actualArray = t3lib_div::trimExplode(',', $testString, true);
tests/t3lib/t3lib_pagerenderer_testcase.php (working copy)
*/
public function testAddCssInlineBlockForceOnTop() {
$expectedReturnValue = '/*general1*/' . chr(10) . 'h1 {margin:20px;}' . chr(10) . '/*general*/' . chr(10) . 'body {margin:20px;}';
$expectedReturnValue = '/*general1*/' . LF . 'h1 {margin:20px;}' . LF . '/*general*/' . LF . 'body {margin:20px;}';
$this->fixture->addCssInlineBlock('general', 'body {margin:20px;}');
$this->fixture->addCssInlineBlock('general1', 'h1 {margin:20px;}', NULL, TRUE);
$out = $this->fixture->render();
......
*/
public function testLoadExtJS() {
$expectedReturnValue = '<script src="contrib/extjs/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>' . chr(10) . '<script src="contrib/extjs/ext-all.js" type="text/javascript"></script>';
$expectedReturnValue = '<script src="contrib/extjs/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>' . LF . '<script src="contrib/extjs/ext-all.js" type="text/javascript"></script>';
$this->fixture->loadExtJS(TRUE, TRUE, 'jquery');
$out = $this->fixture->render();
......
*/
public function testEnableExtJsDebug() {
$expectedReturnValue = '<script src="contrib/extjs/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>' . chr(10) . '<script src="contrib/extjs/ext-all-debug.js" type="text/javascript"></script>';
$expectedReturnValue = '<script src="contrib/extjs/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>' . LF . '<script src="contrib/extjs/ext-all-debug.js" type="text/javascript"></script>';
$this->fixture->loadExtJS(TRUE, TRUE, 'jquery');
$this->fixture->enableExtJsDebug();
$out = $this->fixture->render();
t3lib/class.t3lib_install.php (working copy)
}
// Splitting localconf.php file into lines:
$lines = explode(chr(10),str_replace(chr(13),'',trim(t3lib_div::getUrl($writeToLocalconf_dat['file']))));
$lines = explode(LF,str_replace(CR,'',trim(t3lib_div::getUrl($writeToLocalconf_dat['file']))));
$writeToLocalconf_dat['endLine'] = array_pop($lines); // Getting "? >" ending.
// Checking if "updated" line was set by this tool - if so remove old line.
......
if ($this->setLocalconf) {
$success = FALSE;
if (!t3lib_div::writeFile($writeToLocalconf_dat['tmpfile'],implode(chr(10),$inlines))) {
if (!t3lib_div::writeFile($writeToLocalconf_dat['tmpfile'],implode(LF,$inlines))) {
$msg = 'typo3conf/localconf.php'.$tmpExt.' could not be written - maybe a write access problem?';
}
elseif (strcmp(t3lib_div::getUrl($writeToLocalconf_dat['tmpfile']), implode(chr(10),$inlines))) {
elseif (strcmp(t3lib_div::getUrl($writeToLocalconf_dat['tmpfile']), implode(LF,$inlines))) {
@unlink($writeToLocalconf_dat['tmpfile']);
$msg = 'typo3conf/localconf.php'.$tmpExt.' was NOT written properly (written content didn\'t match file content) - maybe a disk space problem?';
}
......
* @see setValueInLocalconfFile()
*/
function checkForBadString($string) {
return preg_match('/['.chr(10).chr(13).']/',$string) ? FALSE : TRUE;
return preg_match('/['.LF.CR.']/',$string) ? FALSE : TRUE;
}
/**
......
* @see setValueInLocalconfFile()
*/
function slashValueForSingleDashes($value) {
$value = str_replace("'.chr(10).'", '###INSTALL_TOOL_LINEBREAK###', $value);
$value = str_replace("'.LF.'", '###INSTALL_TOOL_LINEBREAK###', $value);
$value = str_replace("'","\'",str_replace('\\','\\\\',$value));
$value = str_replace('###INSTALL_TOOL_LINEBREAK###', "'.chr(10).'", $value);
$value = str_replace('###INSTALL_TOOL_LINEBREAK###', "'.LF.'", $value);
return $value;
}
......
* @return array Array with information about table.
*/
function getFieldDefinitions_fileContent($fileContent) {
$lines = t3lib_div::trimExplode(chr(10), $fileContent, 1);
$lines = t3lib_div::trimExplode(LF, $fileContent, 1);
$table = '';
$total = array();
......
* @return array Array of SQL statements
*/
function getStatementArray($sqlcode,$removeNonSQL=0,$query_regex='') {
$sqlcodeArr = explode(chr(10), $sqlcode);
$sqlcodeArr = explode(LF, $sqlcode);
// Based on the assumption that the sql-dump has
$statementArray = array();
......
$statementArrayPointer++;
} elseif ($is_set) {
$statementArray[$statementArrayPointer].= chr(10);
$statementArray[$statementArrayPointer].= LF;
}
}
......
if (TYPO3_OS == 'WIN') {
$table = strtolower($table);
}
$sqlLines = explode(chr(10), $lineContent);
$sqlLines = explode(LF, $lineContent);
foreach ($sqlLines as $k=>$v) {
if (stristr($v,'auto_increment')) {
$sqlLines[$k] = preg_replace('/ default \'0\'/i', '', $v);
}
}
$lineContent = implode(chr(10), $sqlLines);
$lineContent = implode(LF, $sqlLines);
$crTables[$table] = $lineContent;
}
} elseif ($insertCountFlag && preg_match('/^insert[[:space:]]*into[[:space:]]*[`]?([[:alnum:]_]*)[`]?/i',substr($lineContent,0,100),$reg)) {
t3lib/class.t3lib_flexformtools.php (working copy)
$output = t3lib_div::array2xml($array,'',0,'T3FlexForms', $spaceInd, $options);
if ($addPrologue) {
$output = '<?xml version="1.0" encoding="'.$GLOBALS['LANG']->charSet.'" standalone="yes" ?>'.chr(10).$output;
$output = '<?xml version="1.0" encoding="'.$GLOBALS['LANG']->charSet.'" standalone="yes" ?>'.LF.$output;
}
return $output;
t3lib/class.t3lib_cli.php (working copy)
if ($token{0}==='-' && !t3lib_div::testInt($token{1})) { // Options starting with a number is invalid - they could be negative values... !
list($index,$opt) = explode('=',$token,2);
if (isset($cli_options[$index])) {
echo 'ERROR: Option '.$index.' was used twice!'.chr(10);
echo 'ERROR: Option '.$index.' was used twice!'.LF;
exit;
}
$cli_options[$index] = array();
......
$ii=$i;
if ($i>0) {
if (!isset($cli_args_copy[$argSplit[0]][$i-1]) && $v{0}!='[') { // Using "[]" around a paramter makes it optional
echo 'ERROR: Option "'.$argSplit[0].'" requires a value ("'.$v.'") on position '.$i.chr(10);
echo 'ERROR: Option "'.$argSplit[0].'" requires a value ("'.$v.'") on position '.$i.LF;
exit;
}
}
......
$ii++;
if (isset($cli_args_copy[$argSplit[0]][$ii-1])) {
echo 'ERROR: Option "'.$argSplit[0].'" does not support a value on position '.$ii.chr(10);
echo 'ERROR: Option "'.$argSplit[0].'" does not support a value on position '.$ii.LF;
exit;
}
......
}
if (count($cli_args_copy)) {
echo wordwrap('ERROR: Option '.implode(',',array_keys($cli_args_copy)).' was unknown to this script!'.chr(10).'(Options are: '.implode(', ',$allOptions).')'.chr(10));
echo wordwrap('ERROR: Option '.implode(',',array_keys($cli_args_copy)).' was unknown to this script!'.LF.'(Options are: '.implode(', ',$allOptions).')'.LF);
exit;
}
}
......
}
foreach ($this->cli_options as $v) {
$this->cli_echo($v[0].substr($this->cli_indent(rtrim($v[1].chr(10).$v[2]),$maxLen+4),strlen($v[0]))."\n");
$this->cli_echo($v[0].substr($this->cli_indent(rtrim($v[1].LF.$v[2]),$maxLen+4),strlen($v[0]))."\n");
}
$this->cli_echo("\n");
break;
......
* @return string Result
*/
function cli_indent($str,$indent) {
$lines = explode(chr(10),wordwrap($str,75-$indent));
$lines = explode(LF,wordwrap($str,75-$indent));
$indentStr = str_pad('',$indent,' ');
foreach($lines as $k => $v) {
$lines[$k] = $indentStr.$lines[$k];
}
return implode(chr(10),$lines);
return implode(LF,$lines);
}
}
t3lib/class.t3lib_userauthgroup.php (working copy)
* SECTION: Logging
* 1589: function writelog($type,$action,$error,$details_nr,$details,$data,$tablename='',$recuid='',$recpid='',$event_pid=-1,$NEWid='',$userId=0)
* 1621: function simplelog($message, $extKey='', $error=0)
* 1642: function checkLogFailures($email, $secondsBack=3600, $max=3)
* 1642: function checkLogFailures($email, $secondsBack=ONE_HOUR, $max=3)
*
* TOTAL FUNCTIONS: 45
* (This index is automatically created/updated by the extension "extdeveval")
......
// Check include lines.
$this->TSdataArray = t3lib_TSparser::checkIncludeLines_array($this->TSdataArray);
$this->userTS_text = implode(chr(10).'[GLOBAL]'.chr(10),$this->TSdataArray); // Imploding with "[global]" will make sure that non-ended confinements with braces are ignored.
$this->userTS_text = implode(LF.'[GLOBAL]'.LF,$this->TSdataArray); // Imploding with "[global]" will make sure that non-ended confinements with braces are ignored.
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['TSconfigConditions'] && !$this->userTS_dontGetCached) {
// Perform TS-Config parsing with condition matching
......
function addTScomment($str) {
$delimiter = '# ***********************************************';
$out = $delimiter.chr(10);
$lines = t3lib_div::trimExplode(chr(10),$str);
$out = $delimiter.LF;
$lines = t3lib_div::trimExplode(LF,$str);
foreach($lines as $v) {
$out.= '# '.$v.chr(10);
$out.= '# '.$v.LF;
}
$out.= $delimiter.chr(10);
$out.= $delimiter.LF;
return $out;
}
......
* @return void
* @access private
*/
function checkLogFailures($email, $secondsBack=3600, $max=3) {
function checkLogFailures($email, $secondsBack=ONE_HOUR, $max=3) {
if ($email) {
......
while($testRows = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$theData = unserialize($testRows['log_data']);
$email_body.= date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].' '.$GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'],$testRows['tstamp']).': '.@sprintf($testRows['details'],''.$theData[0],''.$theData[1],''.$theData[2]);
$email_body.= chr(10);
$email_body.= LF;
}
mail( $email,
$subject,
t3lib/class.t3lib_diff.php (working copy)
$str1Lines = $this->explodeStringIntoWords($str1);
$str2Lines = $this->explodeStringIntoWords($str2);
$diffRes = $this->getDiff(implode(chr(10),$str1Lines).chr(10),implode(chr(10),$str2Lines).chr(10));
$diffRes = $this->getDiff(implode(LF,$str1Lines).LF,implode(LF,$str2Lines).LF);
if (is_array($diffRes)) {
reset($diffRes);
......
}
$outString.=$this->addClearBuffer($clearBuffer,1);
$outString = str_replace(' ',chr(10),$outString);
$outString = str_replace(' ',LF,$outString);
if (!$this->stripTags) {
$outString = $this->tagSpace($outString,1);
}
......
* @access private
*/
function explodeStringIntoWords($str) {
$strArr = t3lib_div::trimExplode(chr(10),$str);
$strArr = t3lib_div::trimExplode(LF,$str);
$outArray=array();
reset($strArr);
while(list(,$lineOfWords)=each($strArr)) {
t3lib/class.t3lib_readmail.php (working copy)
function extractMailHeader($content,$limit=0) {
if ($limit) $content = substr($content,0,$limit);
$lines=explode(chr(10),ltrim($content));
$lines=explode(LF,ltrim($content));
$headers=array();
$p='';
while(list($k,$str)=each($lines)) {
......
}
unset($lines[$k]);
}
if (!$limit) $headers['CONTENT']=ltrim(implode(chr(10),$lines));
if (!$limit) $headers['CONTENT']=ltrim(implode(LF,$lines));
return $headers;
}
t3lib/class.t3lib_formmail.php (working copy)
reset($V);
while (list($key,$val)=each($V)) {
if (!t3lib_div::inList($this->reserved_names,$key)) {
$space = (strlen($val)>60)?chr(10):'';
$val = (is_array($val) ? implode($val,chr(10)) : $val);
$space = (strlen($val)>60)?LF:'';
$val = (is_array($val) ? implode($val,LF) : $val);
// convert form data from renderCharset to mail charset (HTML may use entities)
$Plain_val = ($convCharset && strlen($val)) ? $GLOBALS['TSFE']->csConvObj->conv($val,$GLOBALS['TSFE']->renderCharset,$this->charset,0) : $val;
t3lib/class.t3lib_tsparser.php (working copy)
// Internal
var $setup = Array(); // TypoScript hierarchy being build during parsing.
var $raw; // raw data, the input string exploded by chr(10)
var $raw; // raw data, the input string exploded by LF
var $rawP; // pointer to entry in raw data array
var $lastComment=''; // Holding the value of the last comment
var $commentSet=0; // Internally set, used as internal flag to create a multi-line comment (one of those like /*... */)
......
* @return void
*/
function parse($string,$matchObj='') {
$this->raw = explode(chr(10),$string);
$this->raw = explode(LF,$string);
$this->rawP = 0;
$pre = '[GLOBAL]';
while($pre) {
......
if (substr($line,0,1)==')') { // Multiline ends...
if ($this->syntaxHighLight) $this->regHighLight("operator",$lineP,strlen($line)-1);
$this->multiLineEnabled=0; // Disable multiline
$theValue = implode($this->multiLineValue,chr(10));
$theValue = implode($this->multiLineValue,LF);
if (strstr($this->multiLineObject,'.')) {
$this->setVal($this->multiLineObject,$setup,array($theValue)); // Set the value deeper.
} else {
......
$tsFuncArg = str_replace(
array('\\\\', '\n','\t'),
array('\\', chr(10),chr(9)),
array('\\', LF,TAB),
$tsFuncArg
);
......
if ($this->syntaxHighLight) $this->regHighLight("comment", $lineP);
// Comment. The comments are concatenated in this temporary string:
if ($this->regComments) $this->lastComment.= trim($line).chr(10);
if ($this->regComments) $this->lastComment.= trim($line).LF;
}
}
}
......
$splitStr='<INCLUDE_TYPOSCRIPT:';
if (strstr($string,$splitStr)) {
$newString='';
$allParts = explode($splitStr,chr(10).$string.chr(10)); // adds line break char before/after
$allParts = explode($splitStr,LF.$string.LF); // adds line break char before/after
foreach ($allParts as $c => $v) {
if (!$c) { // first goes through
$newString.=$v;
......
$subparts=explode('>',$v,2);
if (preg_match('/^\s*\r?\n/',$subparts[1])) { // There must be a line-break char after
// SO, the include was positively recognized:
$newString.='### '.$splitStr.$subparts[0].'> BEGIN:'.chr(10);
$newString.='### '.$splitStr.$subparts[0].'> BEGIN:'.LF;
$params = t3lib_div::get_tag_attributes($subparts[0]);
if ($params['source']) {
$sourceParts = explode(':',$params['source'],2);
......
$includedFiles = array_merge($includedFiles, $included_text['files']);
$included_text = $included_text['typoscript'];
}
$newString.= $included_text.chr(10);
$newString.= $included_text.LF;
}
}
break;
}
}
$newString.='### '.$splitStr.$subparts[0].'> END:'.chr(10);
$newString.='### '.$splitStr.$subparts[0].'> END:'.LF;
$newString.=$subparts[1];
} else $newString.=$splitStr.$v;
} else $newString.=$splitStr.$v;
......
$this->syntaxHighLight=1;
$this->highLightData=array();
$this->error=array();
$string = str_replace(chr(13),'',$string); // This is done in order to prevent empty <span>..</span> sections around chr(13) content. Should not do anything but help lessen the amount of HTML code.
$string = str_replace(CR,'',$string); // This is done in order to prevent empty <span>..</span> sections around CR content. Should not do anything but help lessen the amount of HTML code.
$this->parse($string);
......
$lines[] = $lineC;
}
return '<pre class="ts-hl">'.implode(chr(10),$lines).'</pre>';
return '<pre class="ts-hl">'.implode(LF,$lines).'</pre>';
}
}
t3lib/class.t3lib_pagerenderer.php (working copy)
$this->backPath = isset($backPath) ? $backPath : $GLOBALS['BACK_PATH'];
$this->inlineJavascriptWrap = array(
'<script type="text/javascript">' . chr(10) . '/*<![CDATA[*/' . chr(10) . '<!-- ' . chr(10),
'// -->' . chr(10) . '/*]]>*/' . chr(10) . '</script>' . chr(10)
'<script type="text/javascript">' . LF . '/*<![CDATA[*/' . LF . '<!-- ' . LF,
'// -->' . LF . '/*]]>*/' . LF . '</script>' . LF
);
$this->inlineCssWrap = array(
'<style type="text/css">' . chr(10) . '/*<![CDATA[*/' . chr(10) . '<!-- ' . chr(10),
'-->' . chr(10) . '/*]]>*/' . chr(10) . '</style>' . chr(10)
'<style type="text/css">' . LF . '/*<![CDATA[*/' . LF . '<!-- ' . LF,
'-->' . LF . '/*]]>*/' . LF . '</style>' . LF
);
}
......
public function addJsInlineCode($name, $block, $compress = TRUE, $forceOnTop = FALSE) {
if (!isset($this->jsInline[$name])) {
$this->jsInline[$name] = array (
'code' => $block . chr(10),
'code' => $block . LF,
'section' => self::PART_HEADER,
'compress' => $compress,
'forceOnTop' => $forceOnTop
......
public function addJsFooterInlineCode($name, $block, $compress = TRUE, $forceOnTop = FALSE) {
if (!isset($this->jsInline[$name])) {
$this->jsInline[$name] = array (
'code' => $block . chr(10),
'code' => $block . LF,
'section' => self::PART_FOOTER,
'compress' => $compress,
'forceOnTop' => $forceOnTop
......
$this->doConcatenate();
}
$metaTags = implode(chr(10), $this->metaTags);
$metaTags = implode(LF, $this->metaTags);
if (count($this->cssFiles)) {
foreach ($this->cssFiles as $file => $properties) {
......
$tag = str_replace('|', $tag, $properties['allWrap']);
}
if ($properties['forceOnTop']) {
$cssFiles = $tag . chr(10) . $cssFiles;
$cssFiles = $tag . LF . $cssFiles;
} else {
$cssFiles .= chr(10) . $tag;
$cssFiles .= LF . $tag;
}
}
}
......
foreach ($this->cssInline as $name => $properties) {
if ($properties['forceOnTop']) {
$cssInline = '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10) . $cssInline;
$cssInline = '/*' . htmlspecialchars($name) . '*/' . LF . $properties['code'] . LF . $cssInline;
} else {
$cssInline .= '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10);
$cssInline .= '/*' . htmlspecialchars($name) . '*/' . LF . $properties['code'] . LF;
}
}
$cssInline = $this->inlineCssWrap[0] . $cssInline . $this->inlineCssWrap[1];
......
}
if ($properties['forceOnTop']) {
if ($properties['section'] === self::PART_HEADER) {
$jsLibs = $tag . chr(10) . $jsLibs;
$jsLibs = $tag . LF . $jsLibs;
} else {
$jsFooterLibs = $tag . chr(10) . $jsFooterLibs;
$jsFooterLibs = $tag . LF . $jsFooterLibs;
}
} else {
if ($properties['section'] === self::PART_HEADER) {
$jsLibs .= chr(10) . $tag;
$jsLibs .= LF . $tag;
} else {
$jsFooterLibs .= chr(10) . $tag;
$jsFooterLibs .= LF . $tag;
}
}
......
}
if ($properties['forceOnTop']) {
if ($properties['section'] === self::PART_HEADER) {
$jsFiles = $tag . chr(10) . $jsFiles;
$jsFiles = $tag . LF . $jsFiles;
} else {
$jsFooterFiles = $tag . chr(10) . $jsFooterFiles;
$jsFooterFiles = $tag . LF . $jsFooterFiles;
}
} else {
if ($properties['section'] === self::PART_HEADER) {
$jsFiles .= chr(10) . $tag;
$jsFiles .= LF . $tag;
} else {
$jsFooterFiles .= chr(10) . $tag;
$jsFooterFiles .= LF . $tag;
}
}
}
......
foreach ($this->jsInline as $name => $properties) {
if ($properties['forceOnTop']) {
if ($properties['section'] === self::PART_HEADER) {
$jsInline = '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10) . $jsInline;
$jsInline = '/*' . htmlspecialchars($name) . '*/' . LF . $properties['code'] . LF . $jsInline;
} else {
$jsFooterInline = '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10) . $jsFooterInline;
$jsFooterInline = '/*' . htmlspecialchars($name) . '*/' . LF . $properties['code'] . LF . $jsFooterInline;
}
} else {
if ($properties['section'] === self::PART_HEADER) {
$jsInline .= '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10);
$jsInline .= '/*' . htmlspecialchars($name) . '*/' . LF . $properties['code'] . LF;
} else {
$jsFooterInline .= '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10);
$jsFooterInline .= '/*' . htmlspecialchars($name) . '*/' . LF . $properties['code'] . LF;
}
}
}
......
$template = t3lib_div::getURL($templateFile);
if ($this->removeEmptyLinesFromTemplate) {
$template = strtr($template, array(chr(10) => '', chr(13) => ''));
$template = strtr($template, array(LF => '', CR => ''));
}
if ($part != self::PART_COMPLETE) {
$templatePart = explode('###BODY###', $template);
......
}
if ($this->moveJsFromHeaderToFooter) {
$jsFooterLibs = $jsLibs . chr(10) . $jsFooterLibs;
$jsFooterLibs = $jsLibs . LF . $jsFooterLibs;
$jsLibs = '';
$jsFooterFiles = $jsFiles . chr(10) . $jsFooterFiles;
$jsFooterFiles = $jsFiles . LF . $jsFooterFiles;
$jsFiles = '';
$jsFooterInline = $jsInline . chr(10) . $jsFooterInline;
$jsFooterInline = $jsInline . LF . $jsFooterInline;
$jsInline = '';
}
......
'HTMLTAG' => $this->htmlTag,
'HEADTAG' => $this->headTag,
'METACHARSET' => $this->charSet ? str_replace('|', htmlspecialchars($this->charSet), $this->metaCharsetTag) : '',
'INLINECOMMENT' => $this->inlineComments ? chr(10) . chr(10) . '<!-- ' . chr(10) . implode(chr(10), $this->inlineComments) . '-->' . chr(10) . chr(10) : '',
'INLINECOMMENT' => $this->inlineComments ? LF . LF . '<!-- ' . LF . implode(LF, $this->inlineComments) . '-->' . LF . LF : '',
'BASEURL' => $this->baseUrl ? str_replace('|', $this->baseUrl, $this->baseUrlTag) : '',
'SHORTCUT' => $this->favIcon ? sprintf($this->shortcutTag, htmlspecialchars($this->favIcon), $this->iconMimeType) : '',
'CSS_INCLUDE' => $cssFiles,
......
'JS_LIBS' => $jsLibs,
'TITLE' => $this->title ? str_replace('|', htmlspecialchars($this->title), $this->titleTag) : '',
'META' => $metaTags,
'HEADERDATA' => $this->headerData ? implode(chr(10), $this->headerData) : '',
'FOOTERDATA' => $this->footerData ? implode(chr(10), $this->footerData) : '',
'HEADERDATA' => $this->headerData ? implode(LF, $this->headerData) : '',
'FOOTERDATA' => $this->footerData ? implode(LF, $this->footerData) : '',
'JS_LIBS_FOOTER' => $jsFooterLibs,
'JS_INCLUDE_FOOTER' => $jsFooterFiles,
'JS_INLINE_FOOTER' => $jsFooterInline,
......
$out = '';
if ($this->addPrototype) {
$out .= '<script src="' . $this->backPath . 'contrib/prototype/prototype.js" type="text/javascript"></script>' . chr(10);
$out .= '<script src="' . $this->backPath . 'contrib/prototype/prototype.js" type="text/javascript"></script>' . LF;
unset($this->jsFiles[$this->backPath . 'contrib/prototype/prototype.js']);
}
......
$moduleLoadString = '?load=' . implode(',', $mods);
}
$out .= '<script src="' . $this->backPath . 'contrib/scriptaculous/scriptaculous.js' . $moduleLoadString . '" type="text/javascript"></script>' . chr(10);
$out .= '<script src="' . $this->backPath . 'contrib/scriptaculous/scriptaculous.js' . $moduleLoadString . '" type="text/javascript"></script>' . LF;
unset($this->jsFiles[$this->backPath . 'contrib/scriptaculous/scriptaculous.js' . $moduleLoadString]);
}
// include extCore
if ($this->addExtCore) {
$out .= '<script src="' . $this->backPath . 'contrib/extjs/ext-core' . ($this->enableExtCoreDebug ? '-debug' : '') . '.js" type="text/javascript"></script>' . chr(10);
$out .= '<script src="' . $this->backPath . 'contrib/extjs/ext-core' . ($this->enableExtCoreDebug ? '-debug' : '') . '.js" type="text/javascript"></script>' . LF;
unset($this->jsFiles[$this->backPath . 'contrib/extjs/ext-core' . ($this->enableExtCoreDebug ? '-debug' : '') . '.js']);
}
// include extJS
if ($this->addExtJS) {
// use the base adapter all the time
$out .= '<script src="' . $this->backPath . 'contrib/extjs/adapter/' . $this->extJSadapter . '" type="text/javascript"></script>' . chr(10);
$out .= '<script src="' . $this->backPath . 'contrib/extjs/ext-all' . ($this->enableExtJsDebug ? '-debug' : '') . '.js" type="text/javascript"></script>' . chr(10);
$out .= '<script src="' . $this->backPath . 'contrib/extjs/adapter/' . $this->extJSadapter . '" type="text/javascript"></script>' . LF;
$out .= '<script src="' . $this->backPath . 'contrib/extjs/ext-all' . ($this->enableExtJsDebug ? '-debug' : '') . '.js" type="text/javascript"></script>' . LF;
// add extJS localization
$localeMap = $this->csConvObj->isoArray; // load standard ISO mapping and modify for use with ExtJS
......
// TODO autoconvert file from UTF8 to current BE charset if necessary!!!!
$extJsLocaleFile = 'contrib/extjs/locale/ext-lang-' . $extJsLang . '-min.js';
if (file_exists(PATH_typo3 . $extJsLocaleFile)) {
$out .= '<script src="' . $this->backPath . $extJsLocaleFile . '" type="text/javascript"></script>' . chr(10);
$out .= '<script src="' . $this->backPath . $extJsLocaleFile . '" type="text/javascript"></script>' . LF;
}
......
$out .= $this->inlineJavascriptWrap[0] . '
Ext.ns("TYPO3");
Ext.BLANK_IMAGE_URL = "' . htmlspecialchars(t3lib_div::locationHeaderUrl($this->backPath . 'gfx/clear.gif')) . '";' . chr(10) .
Ext.BLANK_IMAGE_URL = "' . htmlspecialchars(t3lib_div::locationHeaderUrl($this->backPath . 'gfx/clear.gif')) . '";' . LF .
$inlineSettings .
'Ext.onReady(function() {' .
($this->enableExtJSQuickTips ? 'Ext.QuickTips.init();' . chr(10) : '') . $code .
($this->enableExtJSQuickTips ? 'Ext.QuickTips.init();' . LF : '') . $code .
' });' . $this->inlineJavascriptWrap[1];
unset ($this->extOnReadyCode);
......
$error = '';
$this->jsInline[$name]['code'] = t3lib_div::minifyJavaScript($properties['code'], $error);
if ($error) {
$this->compressError .= 'Error with minify JS Inline Block "' . $name . '": ' . $error . chr(10);
$this->compressError .= 'Error with minify JS Inline Block "' . $name . '": ' . $error . LF;
}
}
}
t3lib/class.t3lib_tcemain.php (working copy)
* 4846: function insertDB($table,$id,$fieldArray,$newVersion=FALSE,$suggestedUid=0,$dontSetNewIdIndex=FALSE)
* 4919: function checkStoredRecord($table,$id,$fieldArray,$action)
* 4956: function setHistory($table,$id,$logId)
* 4989: function clearHistory($maxAgeSeconds=604800,$table)
* 4989: function clearHistory($maxAgeSeconds=ONE_WEEK,$table)
* 5003: function updateRefIndex($table,$id)
*
* SECTION: Misc functions
......
$eFileMarker = $eFile['markerField']&&trim($mixedRec[$eFile['markerField']]) ? trim($mixedRec[$eFile['markerField']]) : '###TYPO3_STATICFILE_EDIT###';
$insertContent = str_replace($eFileMarker,'',$mixedRec[$eFile['contentField']]); // must replace the marker if present in content!
$SW_fileNewContent = $parseHTML->substituteSubpart($SW_fileContent, $eFileMarker, chr(10).$insertContent.chr(10), 1, 1);
$SW_fileNewContent = $parseHTML->substituteSubpart($SW_fileContent, $eFileMarker, LF.$insertContent.LF, 1, 1);
t3lib_div::writeFile($eFile['editFile'],$SW_fileNewContent);
// Write status:
......
foreach($files as $dat) {
if (@is_file($dat['ID_absFile'])) {
unlink ($dat['ID_absFile']);
#echo 'DELETE FlexFormFile:'.$dat['ID_absFile'].chr(10);
#echo 'DELETE FlexFormFile:'.$dat['ID_absFile'].LF;
} else {
$this->log($table,0,3,0,100,"Delete: Referenced file '".$dat['ID_absFile']."' that was supposed to be deleted together with it's record didn't exist");
}
......
* @param string table where the history should be cleared
* @return void
*/
function clearHistory($maxAgeSeconds=604800,$table) {
function clearHistory($maxAgeSeconds=ONE_WEEK,$table) {
$tstampLimit = $maxAgeSeconds ? $GLOBALS['EXEC_TIME'] - $maxAgeSeconds : 0;
$GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_history', 'tstamp<'.intval($tstampLimit).' AND tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_history'));
t3lib/cache/backend/class.t3lib_cache_backend_abstractbackend.php (working copy)
*
* @var integer
*/
protected $defaultLifetime = 3600;
protected $defaultLifetime = ONE_HOUR;
/**
* Constructs this backend
t3lib/class.t3lib_beuserauth.php (working copy)
if ($this->user['uid']) {
if (!$this->isAdmin()) {
return TRUE;
} else die('ERROR: CLI backend user "'.$userName.'" was ADMIN which is not allowed!'.chr(10).chr(10));
} else die('ERROR: No backend user named "'.$userName.'" was found! [Database: '.TYPO3_db.']'.chr(10).chr(10));
} else die('ERROR: Module name, "'.$GLOBALS['MCONF']['name'].'", was not prefixed with "_CLI_"'.chr(10).chr(10));
} else die('ERROR: Another user was already loaded which is impossible in CLI mode!'.chr(10).chr(10));
} else die('ERROR: CLI backend user "'.$userName.'" was ADMIN which is not allowed!'.LF.LF);
} else die('ERROR: No backend user named "'.$userName.'" was found! [Database: '.TYPO3_db.']'.LF.LF);
} else die('ERROR: Module name, "'.$GLOBALS['MCONF']['name'].'", was not prefixed with "_CLI_"'.LF.LF);
} else die('ERROR: Another user was already loaded which is impossible in CLI mode!'.LF.LF);
}
}
t3lib/class.t3lib_querygenerator.php (working copy)
while(list($key,$conf) = each($queryConfig)) {
switch($conf['type']) {
case 'newlevel':
$qs.=chr(10).$pad.trim($conf['operator']).' ('.$this->getQuery($queryConfig[$key]['nl'],$pad.' ').chr(10).$pad.')';
$qs.=LF.$pad.trim($conf['operator']).' ('.$this->getQuery($queryConfig[$key]['nl'],$pad.' ').LF.$pad.')';
break;
case 'userdef':
$qs.=chr(10).$pad.getUserDefQuery($conf,$first);
$qs.=LF.$pad.getUserDefQuery($conf,$first);
break;
default:
$qs.=chr(10).$pad.$this->getQuerySingle($conf,$first);
$qs.=LF.$pad.$this->getQuerySingle($conf,$first);
break;
}
$first=0;
t3lib/class.t3lib_xml.php (working copy)
* @return string
*/
function getResult() {
$content = implode(chr(10),$this->lines);
$content = implode(LF,$this->lines);
return $this->output($content);
}
......
if ($b) $this->XMLIndent++; else $this->XMLIndent--;
$this->Icode='';
for ($a=0;$a<$this->XMLIndent;$a++) {
$this->Icode.=chr(9);
$this->Icode.=TAB;
}
return $this->Icode;
}
......
}
/**
* Substitutes chr(10) characters with a '<newline/>' tag.
* Substitutes LF characters with a '<newline/>' tag.
*
* @param string Input value
* @return string Processed input value
*/
function substNewline($string) {
return str_replace(chr(10),'<newline/>',$string);
return str_replace(LF,'<newline/>',$string);
}
/**
t3lib/class.t3lib_tsstyleconfig.php (working copy)
*/
function ext_mergeIncomingWithExisting($arr) {
$parseObj = t3lib_div::makeInstance("t3lib_TSparser");
$parseObj->parse(implode(chr(10),$this->ext_incomingValues));
$parseObj->parse(implode(LF,$this->ext_incomingValues));
$arr2 = $parseObj->setup;
return t3lib_div::array_merge_recursive_overrule($arr,$arr2);
}
t3lib/class.t3lib_tceforms.php (working copy)
$this->RTEenabled = $GLOBALS['BE_USER']->isRTE();
if (!$this->RTEenabled) {
$this->RTEenabled_notReasons = implode(chr(10),$GLOBALS['BE_USER']->RTE_errors);
$this->commentMessages[] = 'RTE NOT ENABLED IN SYSTEM due to:'.chr(10).$this->RTEenabled_notReasons;
$this->RTEenabled_notReasons = implode(LF,$GLOBALS['BE_USER']->RTE_errors);
$this->commentMessages[] = 'RTE NOT ENABLED IN SYSTEM due to:'.LF.$this->RTEenabled_notReasons;
}
// Default color+class scheme
......
$origRows = $rows = t3lib_div::intInRange($config['rows'] ? $config['rows'] : 5, 1, 20);
if (strlen($PA['itemFormElValue']) > $this->charsPerRow*2) {
$cols = $this->maxTextareaWidth;
$rows = t3lib_div::intInRange(round(strlen($PA['itemFormElValue'])/$this->charsPerRow), count(explode(chr(10),$PA['itemFormElValue'])), 20);
$rows = t3lib_div::intInRange(round(strlen($PA['itemFormElValue'])/$this->charsPerRow), count(explode(LF,$PA['itemFormElValue'])), 20);
if ($rows<$origRows) $rows = $origRows;
}
......
$origRows = $rows = t3lib_div::intInRange($rows, 1, 20);
if (strlen($itemValue)>$this->charsPerRow*2) {
$cols = $this->maxTextareaWidth;
$rows = t3lib_div::intInRange(round(strlen($itemValue)/$this->charsPerRow),count(explode(chr(10),$itemValue)),20);
$rows = t3lib_div::intInRange(round(strlen($itemValue)/$this->charsPerRow),count(explode(LF,$itemValue)),20);
if ($rows<$origRows) $rows=$origRows;
}
}
......
// Description texts:
if ($this->edit_showFieldHelp) {
$descr = $GLOBALS['LANG']->moduleLabels['labels'][$theMod.'_tablabel'].
chr(10).
LF.
$GLOBALS['LANG']->moduleLabels['labels'][$theMod.'_tabdescr'];
}
......
';
}
$out .= chr(10).implode(chr(10),$this->additionalJS_post).chr(10).$this->extJSCODE;
$out .= LF.implode(LF,$this->additionalJS_post).LF.$this->extJSCODE;
$out .= '
TBE_EDITOR.loginRefreshed();
';
// Regular direct output:
if (!$update) {
$spacer = chr(10) . chr(9);
$spacer = LF . TAB;
$out = $spacer . implode($spacer, $jsFile) . t3lib_div::wrapJS($out);
}
t3lib/class.t3lib_tstemplate.php (working copy)
'title'=>$row['title'],
'uid'=>$row['uid'],
'pid'=>$row['pid'],
'configLines' => substr_count($row['config'], chr(10))+1
'configLines' => substr_count($row['config'], LF)+1
);
// Adding the content of the fields constants (Constants), config (Setup) and editorcfg (Backend Editor Configuration) to the internal arrays.
......
}
// Parsing the user TS (or getting from cache)
$TSdataArray = t3lib_TSparser::checkIncludeLines_array($TSdataArray);
$userTS = implode(chr(10).'[GLOBAL]'.chr(10),$TSdataArray);
$userTS = implode(LF.'[GLOBAL]'.LF,$TSdataArray);
$parseObj = t3lib_div::makeInstance('t3lib_TSparser');
$parseObj->parse($userTS);
t3lib/class.t3lib_userauth.php (working copy)
var $lockHashKeyWords = 'useragent'; // Keyword list (commalist with no spaces!): "useragent". Each keyword indicates some information that can be included in a integer hash made to lock down usersessions.
var $warningEmail = ''; // warning -emailaddress:
var $warningPeriod = 3600; // Period back in time (in seconds) in which number of failed logins are collected
var $warningPeriod = ONE_HOUR; // Period back in time (in seconds) in which number of failed logins are collected
var $warningMax = 3; // The maximum accepted number of warnings before an email is sent
var $checkPid = TRUE; // If set, the user-record must $checkPid_value as pid
var $checkPid_value=0; // The pid, the user-record must have as page-id
......
// Set $this->gc_time if not explicitely specified
if ($this->gc_time==0) {
$this->gc_time = ($this->auth_timeout_field==0 ? 86400 : $this->auth_timeout_field); // Default to 1 day if $this->auth_timeout_field is 0
$this->gc_time = ($this->auth_timeout_field==0 ? ONE_DAY : $this->auth_timeout_field); // Default to 1 day if $this->auth_timeout_field is 0
}
// If we're lucky we'll get to clean up old sessions....
t3lib/t3lib_constants.php (revision 0)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2009 Oliver Klee <typo3-coding@oliverklee.de>
* 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!
***************************************************************/
// a tabulator
define('TAB', chr(9));
// a linefeed
define('LF', chr(10));
// a carriage return
define('CR', chr(13));
// a CR-LF combination
define('CRLF', CR . LF);
// one hour in seconds
define('ONE_HOUR', 3600);
// one day in seconds
define('ONE_DAY', 86400);
// one week in seconds
define('ONE_WEEK', 604800);
?>
t3lib/class.t3lib_admin.php (working copy)
// Build HTML output:
if ($this->genTree_makeHTML) {
$this->genTree_HTML.=chr(10).'<div><span class="nobr">';
$this->genTree_HTML.=LF.'<div><span class="nobr">';
$PM = 'join';
$LN = ($a==$c)?'blank':'line';
$BTM = ($a==$c)?'bottom':'';
......
// Build HTML output:
if ($this->genTree_makeHTML) {
$this->genTree_HTML.=chr(10).'<div><span class="nobr">';
$this->genTree_HTML.=LF.'<div><span class="nobr">';
$PM = 'join';
$LN = ($a==$c)?'blank':'line';
$BTM = ($a==$c)?'bottom':'';
t3lib/class.t3lib_parsehtml_proc.php (working copy)
// Line breaks of content is unified into char-10 only (removing char 13)
if (!$this->procOptions['disableUnifyLineBreaks']) {
$value = str_replace(chr(13).chr(10),chr(10),$value);
$value = str_replace(CRLF,LF,$value);
}
// In an entry-cleaner was configured, pass value through the HTMLcleaner with that:
......
break;
case 'ts_transform':
case 'css_transform':
$value = str_replace(chr(13),'',$value); // Has a very disturbing effect, so just remove all '13' - depend on '10'
$value = str_replace(CR,'',$value); // Has a very disturbing effect, so just remove all '13' - depend on '10'
$this->allowedClasses = t3lib_div::trimExplode(',', $this->procOptions['allowedClasses'], 1);
$value = $this->TS_transform_db($value,$cmd=='css_transform');
break;
......
break;
case 'ts_transform':
case 'css_transform':
$value = str_replace(chr(13),'',$value); // Has a very disturbing effect, so just remove all '13' - depend on '10'
$value = str_replace(CR,'',$value); // Has a very disturbing effect, so just remove all '13' - depend on '10'
$value = $this->TS_transform_rte($value,$cmd=='css_transform');
break;
default:
......
// Final clean up of linebreaks:
if (!$this->procOptions['disableUnifyLineBreaks']) {
$value = str_replace(chr(13).chr(10),chr(10),$value); // Make sure no \r\n sequences has entered in the meantime...
$value = str_replace(chr(10),chr(13).chr(10),$value); // ... and then change all \n into \r\n
$value = str_replace(CRLF,LF,$value); // Make sure no \r\n sequences has entered in the meantime...
$value = str_replace(LF,CRLF,$value); // ... and then change all \n into \r\n
}
// Return value:
......
// Traverse the blocks
foreach($blockSplit as $k => $v) {
$cc++;
$lastBR = $cc==$aC ? '' : chr(10);
$lastBR = $cc==$aC ? '' : LF;
if ($k%2) { // Inside block:
......
if (!isset($this->procOptions['typolist']) || $this->procOptions['typolist']) {
$parts = $this->getAllParts($this->splitIntoBlock('LI',$this->removeFirstAndLastTag($blockSplit[$k])),1,0);
while(list($k2)=each($parts)) {
$parts[$k2]=preg_replace('/['.preg_quote(chr(10).chr(13)).']+/','',$parts[$k2]); // remove all linesbreaks!
$parts[$k2]=preg_replace('/['.preg_quote(LF.CR).']+/','',$parts[$k2]); // remove all linesbreaks!
$parts[$k2]=$this->defaultTStagMapping($parts[$k2],'db');
$parts[$k2]=$this->cleanFontTags($parts[$k2],0,0,0);
$parts[$k2] = $this->HTMLcleaner_db($parts[$k2],strtolower($this->procOptions['allowTagsInTypolists']?$this->procOptions['allowTagsInTypolists']:'br,font,b,i,u,a,img,span,strong,em'));
}
if ($tagName=='ol') { $params=' type="1"'; } else { $params=''; }
$blockSplit[$k]='<typolist'.$params.'>'.chr(10).implode(chr(10),$parts).chr(10).'</typolist>'.$lastBR;
$blockSplit[$k]='<typolist'.$params.'>'.LF.implode(LF,$parts).LF.'</typolist>'.$lastBR;
}
} else {
$blockSplit[$k]=preg_replace('/['.preg_quote(chr(10).chr(13)).']+/',' ',$this->transformStyledATags($blockSplit[$k])).$lastBR;
$blockSplit[$k]=preg_replace('/['.preg_quote(LF.CR).']+/',' ',$this->transformStyledATags($blockSplit[$k])).$lastBR;
}
break;
case 'table': // Tables are NOT allowed in any form (unless preserveTables is set or CSS is the mode)
if (!$this->procOptions['preserveTables'] && !$css) {
$blockSplit[$k]=$this->TS_transform_db($this->removeTables($blockSplit[$k]));
} else {
$blockSplit[$k]=preg_replace('/['.preg_quote(chr(10).chr(13)).']+/',' ',$this->transformStyledATags($blockSplit[$k])).$lastBR;
$blockSplit[$k]=preg_replace('/['.preg_quote(LF.CR).']+/',' ',$this->transformStyledATags($blockSplit[$k])).$lastBR;
}
break;
case 'h1':
......
}
} else {
// Eliminate true linebreaks inside Hx tags
$blockSplit[$k]=preg_replace('/['.preg_quote(chr(10).chr(13)).']+/',' ',$this->transformStyledATags($blockSplit[$k])).$lastBR;
$blockSplit[$k]=preg_replace('/['.preg_quote(LF.CR).']+/',' ',$this->transformStyledATags($blockSplit[$k])).$lastBR;
}
break;
default:
// Eliminate true linebreaks inside other headlist tags and after hr tag
$blockSplit[$k]=preg_replace('/['.preg_quote(chr(10).chr(13)).']+/',' ',$this->transformStyledATags($blockSplit[$k])).$lastBR;
$blockSplit[$k]=preg_replace('/['.preg_quote(LF.CR).']+/',' ',$this->transformStyledATags($blockSplit[$k])).$lastBR;
break;
}
} else { // NON-block:
if (strcmp(trim($blockSplit[$k]),'')) {
$blockSplit[$k]=$this->divideIntoLines(preg_replace('/['.preg_quote(chr(10).chr(13)).']+/',' ',$blockSplit[$k])).$lastBR;
$blockSplit[$k]=$this->divideIntoLines(preg_replace('/['.preg_quote(LF.CR).']+/',' ',$blockSplit[$k])).$lastBR;
$blockSplit[$k]=$this->transformStyledATags($blockSplit[$k]);
} else unset($blockSplit[$k]);
}
......
case 'typolist': // Transform typolist blocks into OL/UL lists. Type 1 is expected to be numerical block
if (!isset($this->procOptions['typolist']) || $this->procOptions['typolist']) {
$tListContent = $this->removeFirstAndLastTag($blockSplit[$k]);
$tListContent = preg_replace('/^[ ]*'.chr(10).'/','',$tListContent);
$tListContent = preg_replace('/'.chr(10).'[ ]*$/','',$tListContent);
$lines = explode(chr(10),$tListContent);
$tListContent = preg_replace('/^[ ]*'.LF.'/','',$tListContent);
$tListContent = preg_replace('/'.LF.'[ ]*$/','',$tListContent);
$lines = explode(LF,$tListContent);
$typ = $attribArray['type']==1 ? 'ol' : 'ul';
$blockSplit[$k] = '<'.$typ.'>'.chr(10).
'<li>'.implode('</li>'.chr(10).'<li>',$lines).'</li>'.
$blockSplit[$k] = '<'.$typ.'>'.LF.
'<li>'.implode('</li>'.LF.'<li>',$lines).'</li>'.
'</'.$typ.'>';
}
break;
......
}
break;
}
$blockSplit[$k+1] = preg_replace('/^[ ]*'.chr(10).'/','',$blockSplit[$k+1]); // Removing linebreak if typohead
$blockSplit[$k+1] = preg_replace('/^[ ]*'.LF.'/','',$blockSplit[$k+1]); // Removing linebreak if typohead
} else { // NON-block:
$nextFTN = $this->getFirstTagName($blockSplit[$k+1]);
$singleLineBreak = $blockSplit[$k]==chr(10);
$singleLineBreak = $blockSplit[$k]==LF;
if (t3lib_div::inList('TABLE,BLOCKQUOTE,TYPOLIST,TYPOHEAD,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->blockElementList,$nextFTN)) { // Removing linebreak if typolist/typohead
$blockSplit[$k] = preg_replace('/'.chr(10).'[ ]*$/','',$blockSplit[$k]);
$blockSplit[$k] = preg_replace('/'.LF.'[ ]*$/','',$blockSplit[$k]);
}
// If $blockSplit[$k] is blank then unset the line. UNLESS the line happend to be a single line break.
if (!strcmp($blockSplit[$k],'') && !$singleLineBreak) {
......
}
}
}
return implode(chr(10),$blockSplit);
return implode(LF,$blockSplit);
}
/**
......
}
/**
* This resolves the $value into parts based on <div></div>-sections and <p>-sections and <br />-tags. These are returned as lines separated by chr(10).
* This resolves the $value into parts based on <div></div>-sections and <p>-sections and <br />-tags. These are returned as lines separated by LF.
* This point is to resolve the HTML-code returned from RTE into ordinary lines so it's 'human-readable'
* The function ->setDivTags does the opposite.
* This function processes content to go into the database.
......
}
// Remove any line break char (10 or 13)
$subLines[$sk]=preg_replace('/'.chr(10).'|'.chr(13).'/','',$subLines[$sk]);
$subLines[$sk]=preg_replace('/'.LF.'|'.CR.'/','',$subLines[$sk]);
// If there are any attributes or if we are supposed to remap the tag, then do so:
if (count($newAttribs) && strcmp($remapParagraphTag,'1')) {
......
}
}
// Add the processed line(s)
$divSplit[$k] = implode(chr(10),$subLines);
$divSplit[$k] = implode(LF,$subLines);
// If it turns out the line is just blank (containing a &nbsp; possibly) then just make it pure blank.
// But, prevent filtering of lines that are blank in sense above, but whose tags contain attributes.
......
}
// Return value:
return $returnArray ? $divSplit : implode(chr(10),$divSplit);
return $returnArray ? $divSplit : implode(LF,$divSplit);
}
/**
......
$hSC = $this->procOptions['dontHSC_rte'] ? 0 : 1; // Default: re-convert literals to characters (that is &lt; to <)
$convNBSP = !$this->procOptions['dontConvAmpInNBSP_rte']?1:0;
// Divide the content into lines, based on chr(10):
$parts = explode(chr(10),$value);
// Divide the content into lines, based on LF:
$parts = explode(LF,$value);
foreach($parts as $k => $v) {
// Processing of line content:
......
}
// Implode result:
return implode(chr(10),$parts);
return implode(LF,$parts);
}
/**
t3lib/class.t3lib_div.php (working copy)
public static function breakTextForEmail($str,$implChar="\n",$charWidth=76) {
self::logDeprecatedFunction();
$lines = explode(chr(10),$str);
$lines = explode(LF,$str);
$outArr=array();
foreach ($lines as $lStr) {
$outArr[] = t3lib_div::breakLinesForEmail($lStr,$implChar,$charWidth);
}
return implode(chr(10),$outArr);
return implode(LF,$outArr);
}
/**
......
* @return string Formatted for <textarea>-tags
*/
public static function formatForTextarea($content) {
return chr(10).htmlspecialchars($content);
return LF.htmlspecialchars($content);
}
/**
......
}
// Return XML:
return '<?xml version="1.0" encoding="'.htmlspecialchars($charset).'" standalone="yes" ?>'.chr(10).
return '<?xml version="1.0" encoding="'.htmlspecialchars($charset).'" standalone="yes" ?>'.LF.
t3lib_div::array2xml($array,'',0,$docTag,0, $options);
}
......
chr(20).chr(21).chr(22).chr(23).chr(24).chr(25).chr(26).chr(27).chr(28).chr(29).
chr(30).chr(31);
// Set indenting mode:
$indentChar = $spaceInd ? ' ' : chr(9);
$indentChar = $spaceInd ? ' ' : TAB;
$indentN = $spaceInd>0 ? $spaceInd : 1;
$nl = ($spaceInd >= 0 ? chr(10) : '');
$nl = ($spaceInd >= 0 ? LF : '');
// Init output variable:
$output='';
......
require_once(PATH_typo3 . 'contrib/jsmin/jsmin.php');
try {
$error = '';
$script = trim(JSMin::minify(str_replace(chr(13), '', $script)));
$script = trim(JSMin::minify(str_replace(CR, '', $script)));
}
catch(JSMinException $e) {
$error = 'Error while minifying JavaScript: ' . $e->getMessage();
......
* @param string Email address to send to. (see PHP function mail())
* @param string Subject line, non-encoded. (see PHP function mail())
* @param string Message content, non-encoded. (see PHP function mail())
* @param string Headers, separated by chr(10)
* @param string Headers, separated by LF
* @param string Encoding type: "base64", "quoted-printable", "8bit". Default value is "quoted-printable".
* @param string Charset used in encoding-headers (only if $encoding is set to a valid value which produces such a header)
* @param boolean If set, the header content will not be encoded.
......
if (!$dontEncodeHeader) {
// Mail headers must be ASCII, therefore we convert the whole header to either base64 or quoted_printable
$newHeaders=array();
foreach (explode(chr(10),$headers) as $line) { // Split the header in lines and convert each line separately
foreach (explode(LF,$headers) as $line) { // Split the header in lines and convert each line separately
$parts = explode(': ',$line,2); // Field tags must not be encoded
if (count($parts)==2) {
if (0 == strcasecmp($parts[0], 'from')) {
......
$newHeaders[] = $line; // Should never happen - is such a mail header valid? Anyway, just add the unchanged line...
}
}
$headers = implode(chr(10),$newHeaders);
$headers = implode(LF,$newHeaders);
unset($newHeaders);
$email = t3lib_div::encodeHeader($email,$encoding,$charset); // Email address must not be encoded, but it could be appended by a name which should be so (e.g. "Kasper Sk�rh�j <kasperYYYY@typo3.com>")
......
switch ((string)$encoding) {
case 'base64':
$headers=trim($headers).chr(10).
'Mime-Version: 1.0'.chr(10).
'Content-Type: text/plain; charset="'.$charset.'"'.chr(10).
$headers=trim($headers).LF.
'Mime-Version: 1.0'.LF.
'Content-Type: text/plain; charset="'.$charset.'"'.LF.
'Content-Transfer-Encoding: base64';
$message=trim(chunk_split(base64_encode($message.chr(10)))).chr(10); // Adding chr(10) because I think MS outlook 2002 wants it... may be removed later again.
$message=trim(chunk_split(base64_encode($message.LF))).LF; // Adding LF because I think MS outlook 2002 wants it... may be removed later again.
break;
case '8bit':
$headers=trim($headers).chr(10).
'Mime-Version: 1.0'.chr(10).
'Content-Type: text/plain; charset='.$charset.chr(10).
$headers=trim($headers).LF.
'Mime-Version: 1.0'.LF.
'Content-Type: text/plain; charset='.$charset.LF.
'Content-Transfer-Encoding: 8bit';
break;
case 'quoted-printable':
default:
$headers=trim($headers).chr(10).
'Mime-Version: 1.0'.chr(10).
'Content-Type: text/plain; charset='.$charset.chr(10).
$headers=trim($headers).LF.
'Mime-Version: 1.0'.LF.
'Content-Type: text/plain; charset='.$charset.LF.
'Content-Transfer-Encoding: quoted-printable';
$message=t3lib_div::quoted_printable($message);
......
// Headers must be separated by CRLF according to RFC 2822, not just LF.
// But many servers (Gmail, for example) behave incorectly and want only LF.
// So we stick to LF in all cases.
$headers = trim(implode(chr(10), t3lib_div::trimExplode(chr(10), $headers, true))); // Make sure no empty lines are there.
$headers = trim(implode(LF, t3lib_div::trimExplode(LF, $headers, true))); // Make sure no empty lines are there.
$ret = @mail($email, $subject, $message, $headers);
if (!$ret) {
......
*/
public static function quoted_printable($string,$maxlen=76) {
// Make sure the string contains only Unix linebreaks
$string = str_replace(chr(13).chr(10), chr(10), $string); // Replace Windows breaks (\r\n)
$string = str_replace(chr(13), chr(10), $string); // Replace Mac breaks (\r)
$string = str_replace(CRLF, LF, $string); // Replace Windows breaks (\r\n)
$string = str_replace(CR, LF, $string); // Replace Mac breaks (\r)
$linebreak = chr(10); // Default line break for Unix systems.
$linebreak = LF; // Default line break for Unix systems.
if (TYPO3_OS=='WIN') {
$linebreak = chr(13).chr(10); // Line break for Windows. This is needed because PHP on Windows systems send mails via SMTP instead of using sendmail, and thus the linebreak needs to be \r\n.
$linebreak = CRLF; // Line break for Windows. This is needed because PHP on Windows systems send mails via SMTP instead of using sendmail, and thus the linebreak needs to be \r\n.
}
$newString = '';
$theLines = explode(chr(10),$string); // Split lines
$theLines = explode(LF,$string); // Split lines
foreach ($theLines as $val) {
$newVal = '';
$theValLen = strlen($val);
......
}
}
$newVal = preg_replace('/'.chr(32).'$/','=20',$newVal); // Replaces a possible SPACE-character at the end of a line
$newVal = preg_replace('/'.chr(9).'$/','=09',$newVal); // Replaces a possible TAB-character at the end of a line
$newVal = preg_replace('/'.TAB.'$/','=09',$newVal); // Replaces a possible TAB-character at the end of a line
$newString.=$newVal.$linebreak;
}
return preg_replace('/'.$linebreak.'$/','',$newString); // Remove last newline
......
$file = fopen($destination, 'a');
if ($file) {
flock($file, LOCK_EX); // try locking, but ignore if not available (eg. on NFS and FAT)
fwrite($file, date($dateFormat.' '.$timeFormat).$msgLine.chr(10));
fwrite($file, date($dateFormat.' '.$timeFormat).$msgLine.LF);
flock($file, LOCK_UN); // release the lock
fclose($file);
}
......
if ($file) {
$date = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ': ');
flock($file, LOCK_EX); // try locking, but ignore if not available (eg. on NFS and FAT)
@fwrite($file, $date.$msg.chr(10));
@fwrite($file, $date.$msg.LF);
flock($file, LOCK_UN); // release the lock
@fclose($file);
}
......
* @return string The encoded value already quoted
*/
public static function quoteJSvalue($value, $inScriptTags = false) {
$value = addcslashes($value, '\''.'"'.chr(10).chr(13));
$value = addcslashes($value, '\''.'"'.LF.CR);
if (!$inScriptTags) {
$value = htmlspecialchars($value);
}
t3lib/class.t3lib_htmlmail.php (working copy)
// Default line break for Unix systems.
$this->linebreak = chr(10);
$this->linebreak = LF;
// Line break for Windows. This is needed because PHP on Windows systems
// send mails via SMTP instead of using sendmail, and thus the linebreak needs to be \r\n.
if (TYPO3_OS == 'WIN') {
$this->linebreak = chr(13).chr(10);
$this->linebreak = CRLF;
}
// Sets the Charset
......
// Auto response
if ($this->auto_respond_msg) {
$theParts = explode('/',$this->auto_respond_msg,2);
$theParts[1] = str_replace("/",chr(10),$theParts[1]);
$theParts[1] = str_replace("/",LF,$theParts[1]);
if ($returnPathPossible) {
$mailWasSent = mail($this->from_email,
$theParts[0],
......
$pieces = count($textpieces);
$textstr = $textpieces[0];
for($i = 1; $i<$pieces; $i++) {
$len = strcspn($textpieces[$i],chr(32).chr(9).chr(13).chr(10));
$len = strcspn($textpieces[$i],chr(32).TAB.CRLF);
if (trim(substr($textstr,-1)) == '' && $len) {
$lastChar = substr($textpieces[$i],$len-1,1);
if (!preg_match('/[A-Za-z0-9\/#]/',$lastChar)) {
t3lib/class.t3lib_superadmin.php (working copy)
// List of those extension keys in a form field:
$extensionKeysCollect = array_unique($extensionKeysCollect);
asort($extensionKeysCollect);
$out.='<form action=""><textarea cols="80" rows="10">'.implode(chr(10),$extensionKeysCollect).'</textarea></form>';
$out.='<form action=""><textarea cols="80" rows="10">'.implode(LF,$extensionKeysCollect).'</textarea></form>';
// USER extension (prefixed "user_")
$out.='<br />
......
// debug($row);
}
return '<pre>'.implode(chr(10),$lines).'</pre>';
return '<pre>'.implode(LF,$lines).'</pre>';
}
/**
t3lib/class.t3lib_tsparser_ext.php (working copy)
if (!is_array($this->lnToScript)) {
$this->lnToScript = array();
$c=1;
$c+=substr_count($GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup'],chr(10))+2;
$c+=substr_count($GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup'],LF)+2;
$this->lnToScript[$c] = '[Default]';
foreach($this->hierarchyInfoToRoot as $info) {
......
$all='';
reset($config);
while (list(,$str)=each($config)) {
$all .= chr(10) .'[GLOBAL]' . chr(10) . $str;
$all .= LF .'[GLOBAL]' . LF . $str;
}
if ($syntaxHL) {
$all = preg_replace('/^[^'.chr(10).']*./','',$all);
$all = preg_replace('/^[^'.LF.']*./','',$all);
$all = chop($all);
$tsparser = t3lib_div::makeInstance('t3lib_TSparser');
$tsparser->lineNumberOffset=$this->ext_lineNumberOffset+1;
......
* @return [type] ...
*/
function ext_formatTS($input, $ln, $comments=1, $crop=0) {
$input = preg_replace('/^[^'.chr(10).']*./','',$input);
$input = preg_replace('/^[^'.LF.']*./','',$input);
$input = chop($input);
$cArr = explode(chr(10),$input);
$cArr = explode(LF,$input);
reset($cArr);
$n = ceil(log10(count($cArr)+$this->ext_lineNumberOffset));
......
while(list($const,$value)=each($this->flatSetup)) {
if (substr($const,-2)!='..' && isset($this->flatSetup[$const.'..'])) {
$comment = trim($this->flatSetup[$const.'..']);
... This diff was truncated because it exceeds the maximum size that can be displayed.
(2-2/11)