Project

General

Profile

Bug #18369 » 7753.diff

Administrator Admin, 2008-10-24 19:35

View differences:

typo3/mod/tools/em/class.em_index.php (copie de travail)
}
}
//
$XclassParts = split('if \(defined\([\'"]TYPO3_MODE[\'"]\) && \$TYPO3_CONF_VARS\[TYPO3_MODE\]\[[\'"]XCLASS[\'"]\]',$fContent,2);
$XclassSearch = '\$TYPO3_CONF_VARS\[TYPO3_MODE\]\[[\'"]XCLASS[\'"]\]';
$XclassParts = split('if \(defined\([\'"]TYPO3_MODE[\'"]\) && '.$XclassSearch,$fContent,2);
if (count($XclassParts)!=2) {
$XclassSearch = '\$GLOBALS\[[\'"]TYPO3_CONF_VARS[\'"]\]\[TYPO3_MODE\]\[[\'"]XCLASS[\'"]\]';
$XclassParts = split('if \(defined\([\'"]TYPO3_MODE[\'"]\) && '.$XclassSearch,$fContent,2);
}
if (count($XclassParts)==2) {
unset($reg);
preg_match('/^\[[\'"]([[:alnum:]_\/\.]*)[\'"]\]/',$XclassParts[1],$reg);
if ($reg[1]) {
$cmpF = 'ext/'.$extKey.'/'.$fileName;
if (!strcmp($reg[1],$cmpF)) {
if (preg_match('/_once[[:space:]]*\(\$TYPO3_.ONF_VARS\[TYPO3_MODE\]\[[\'"]XCLASS[\'"]\]\[[\'"]'.preg_quote($cmpF,'/').'[\'"]\]\);/', $XclassParts[1])) {
if (preg_match('/_once[[:space:]]*\('.$XclassSearch.'\[[\'"]'.preg_quote($cmpF,'/').'[\'"]\]\);/', $XclassParts[1])) {
$out['msg'][] = 'XCLASS OK in '.$fileName;
} else $out['errors'][] = 'Couldn\'t find the include_once statement for XCLASS!';
} else $out['errors'][] = 'The XCLASS filename-key "'.$reg[1].'" was different from "'.$cmpF.'" which it should have been!';
} else $out['errors'][] = 'No XCLASS filename-key found in file "'.$fileName.'". Maybe a regex coding error here...';
} elseif (!$this->first_in_array('ux_',$out['files'][$fileName]['classes'])) $out['errors'][] = 'No XCLASS inclusion code found in file "'.$fileName.'"';
} elseif (!$this->first_in_array('ux_',$out['files'][$fileName]['classes'])) {
// a filename containing 'div' does not need to have a XCLASS
if (strpos($fileName,'_div') === FALSE) {
$out['errors'][] = 'No XCLASS inclusion code found in file "'.$fileName.'"';
}
}
}
}
}
(1-1/4)