[evolvis-commits] r15557: put a few commonly used strings into thei =?UTF-8?Q?r=20own=20variables=E2=86=B5=20e?=.g. for easier moves↵
mirabilos at evolvis.org
mirabilos at evolvis.org
Tue Mar 1 00:14:44 CET 2011
Author: mirabilos
Date: 2011-03-01 00:14:44 +0100 (Tue, 01 Mar 2011)
New Revision: 15557
Modified:
trunk/gforge_base/evolvisforge-5.1/src/common/include/extras-debug.php
Log:
put a few commonly used strings into their own variables
e.g. for easier moves
Modified: trunk/gforge_base/evolvisforge-5.1/src/common/include/extras-debug.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/include/extras-debug.php 2011-02-28 23:14:40 UTC (rev 15556)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/include/extras-debug.php 2011-02-28 23:14:44 UTC (rev 15557)
@@ -61,6 +61,10 @@
/* stop calling ffErrorHandler */
restore_error_handler();
+ $dtdpath = $gfcommon . 'include/';
+ // this is, sadly, necessary (especially in ff-plugin-mediawiki)
+ $pre_tag = "<pre style=\"margin:0; padding:0; border:0;\">";
+
if (!isset($ffErrors))
$ffErrors = array();
@@ -106,7 +110,7 @@
/* generate buffer for checking */
$cbuf = str_ireplace('http://www.w3.org/TR/xhtml1/DTD/',
- 'file://' . $gfcommon . 'include/', $buffer);
+ 'file://' . $dtdpath, $buffer);
if ($has_div)
$cbuf .= "\n</div></div>";
$cbuf .= "\n</body></html>\n";
@@ -123,7 +127,7 @@
2 => array("pipe", "w"),
);
$xmlstarlet = proc_open("xmlstarlet val -d " .
- escapeshellarg($gfcommon . 'include/xhtml1-transitional.dtd') .
+ escapeshellarg($dtdpath . 'xhtml1-transitional.dtd') .
" -", $dspec, $pipes);
$rv = 0;
if (is_resource($xmlstarlet)) {
@@ -141,7 +145,7 @@
if ($rv) {
$valck[] = array(
'msg' => "xmlstarlet found that this document is not valid (errorlevel $rv)!",
- 'extra' => "<pre style=\"margin:0; padding:0; border:0;\">" . htmlspecialchars(trim($serr .
+ 'extra' => $pre_tag . htmlspecialchars(trim($serr .
"\n\n" . $sout)) . "</pre>",
'type' => "error"
);
@@ -173,9 +177,9 @@
/* append XHTML source code, if validation failed */
if ($appsrc) {
if (!$sysdebug_akelos || $vbuf == $sbuf[1])
- $vbuf = "<ol><li><pre style=\"margin:0; padding:0; border:0;\">" . join("</pre></li>\n<li><pre style=\"margin:0; padding:0; border:0;\">", explode("\n", htmlentities(rtrim($cbuf)))) . "</pre></li></ol>";
+ $vbuf = "<ol><li>" . $pre_tag . join("</pre></li>\n<li>" . $pre_tag, explode("\n", htmlentities(rtrim($cbuf)))) . "</pre></li></ol>";
else
- $vbuf = "<pre style=\"margin:0; padding:0; border:0;\">" . htmlentities(rtrim($sbuf[0])) . "</pre>" . $vbuf;
+ $vbuf = $pre_tag . htmlentities(rtrim($sbuf[0])) . "</pre>" . $vbuf;
$valck[] = array(
'msg' => "Since XHTML validation failed, here’s the checked document for you to look at:",
'extra' => $vbuf,
More information about the evolvis-commits
mailing list