// Was that eval okay?
if (empty($newContent)) {
// Something went wrong!
- debug_report_bug('Evaluation error:<pre>' . htmlentities($eval) . '</pre>');
+ debug_report_bug('Evaluation error:<pre>' . linenumberCode($eval) . '</pre>');
} // END - if
$GLOBALS['output'] = $newContent;
unset($DATA);
// Compile the code and eval it
- $eval = '$newContent = "' . compileCode(addSmartSlashes($newContent)) . '";';
+ $eval = '$newContent = "' . compileCode(smartAddSlashes($newContent)) . '";';
eval($eval);
// Return content
// Generate XHTML code for the CAPTCHA
function generateCaptchaCode ($code, $type, $DATA, $userid) {
- return '<IMG border="0" alt="Code" src="{?URL?}/mailid_top.php?userid=' . $userid . '&' . $type . '=' . $DATA . '&mode=img&code=' . $code . '" />';
+ return '<img border="0" alt="Code ' . $code . '" src="{?URL?}/mailid_top.php?userid=' . $userid . '&' . $type . '=' . $DATA . '&mode=img&code=' . $code . '" />';
}
// Generates a timestamp (some wrapper for mktime())
-function makeTime ($H, $M, $S, $stamp) {
+function makeTime ($hours, $minutes, $seconds, $stamp) {
// Extract day, month and year from given timestamp
- $day = date('d', $stamp);
- $month = date('m', $stamp);
- $year = date('Y', $stamp);
+ $days = date('d', $stamp);
+ $months = date('m', $stamp);
+ $years = date('Y', $stamp);
// Create timestamp for wished time which depends on extracted date
- return mktime($H, $M, $S, $month, $day, $year);
+ return mktime(
+ $hours,
+ $minutes,
+ $seconds,
+ $months,
+ $days,
+ $years
+ );
}
// Redirects to an URL and if neccessarry extends it with own base URL
shutdown();
}
+// Print code with line numbers
+function linenumberCode ($code) {
+ if (!is_array($code)) $codeE = explode("\n", $code); else $codeE = $code;
+ $count_lines = count($codeE);
+
+ $r = "Line | Code:<br />";
+ foreach($codeE as $line => $c) {
+ $r .= "<div class=\"line\"><span class=\"linenum\">";
+ if ($count_lines == 1) {
+ $r .= '1';
+ } else {
+ $r .= ($line == ($count_lines - 1)) ? '' : ($line+1);
+ }
+ $r .= "</span>|";
+
+ // Add code
+ $r .= "<span class=\"linetext\">" . htmlentities($c) . "</span></div>";
+ }
+
+ return "<div class=\"code\">" . $r . "</div>\n";
+}
+
//////////////////////////////////////////////////
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
//////////////////////////////////////////////////