59 if ($this->stripTags) {
60 $str1 = strip_tags($str1);
61 $str2 = strip_tags($str2);
68 $diffRes = $this->
getDiff(implode(LF, $str1Lines) . LF, implode(LF, $str2Lines) . LF);
69 if (is_array($diffRes)) {
71 $diffResArray = array();
73 foreach ($diffRes as $lValue) {
76 $diffResArray[$c][
'changeInfo'] = $lValue;
78 if ($lValue[0] ===
'<') {
79 $differenceStr .= ($diffResArray[$c][
'old'][] = substr($lValue, 2));
81 if ($lValue[0] ===
'>') {
82 $differenceStr .= ($diffResArray[$c][
'new'][] = substr($lValue, 2));
85 $this->differenceLgd = strlen($differenceStr);
88 $str1LinesCount = count($str1Lines);
89 for ($a = -1; $a < $str1LinesCount; $a++) {
90 if (is_array($diffResArray[$a + 1])) {
92 if (strstr($diffResArray[$a + 1][
'changeInfo'],
'a')) {
93 $clearBuffer .= htmlspecialchars($str1Lines[$a]) .
' ';
97 if (is_array($diffResArray[$a + 1][
'old'])) {
98 $outString .=
'<' . $wrapTag .
' class="diff-r">' . htmlspecialchars(implode(
' ', $diffResArray[($a + 1)][
'old'])) .
'</' . $wrapTag .
'> ';
100 if (is_array($diffResArray[$a + 1][
'new'])) {
101 $outString .=
'<' . $wrapTag .
' class="diff-g">' . htmlspecialchars(implode(
' ', $diffResArray[($a + 1)][
'new'])) .
'</' . $wrapTag .
'> ';
103 $chInfParts = explode(
',', $diffResArray[$a + 1][
'changeInfo']);
104 if ((
string)$chInfParts[0] === (
string)($a + 1)) {
105 $newLine = (int)$chInfParts[1] - 1;
111 $clearBuffer .= htmlspecialchars($str1Lines[$a]) .
' ';
115 $outString = str_replace(
' ', LF, $outString);
116 if (!$this->stripTags) {
117 $outString = $this->
tagSpace($outString, 1);
141 $cmd =
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'diff_path'] .
' ' . $this->diffOptions .
' ' . $file1 .
' ' . $file2;
159 if (strlen($clearBuffer) > 200) {
162 $this->clearBufferIdx++;
178 foreach ($strArr as $lineOfWords) {
180 $outArray[] = $allWords;
181 $outArray[] = array(
'');
182 $outArray[] = array(
'');
184 return call_user_func_array(
'array_merge', $outArray);
198 return str_replace(
' <',
'<', str_replace(
'> ',
'>', $str));
200 return str_replace(
'<',
' <', str_replace(
'>',
'> ', $str));
static writeFile($file, $content, $changePermissions=FALSE)
makeDiffDisplay($str1, $str2, $wrapTag='span')
explodeStringIntoWords($str)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static tempnam($filePrefix, $fileSuffix='')
static fixed_lgd_cs($string, $chars, $appendString='...')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static exec($command, &$output=NULL, &$returnValue=0)
addClearBuffer($clearBuffer, $last=0)