diff options
author | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2014-12-29 16:06:10 +0000 |
---|---|---|
committer | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2014-12-29 16:06:10 +0000 |
commit | 108c207aba95a0f5bbf22c3db7b9ff7700b359ed (patch) | |
tree | 7f2e0ceac473dd3b8ec43b943fc0cc9d33e007bd | |
parent | 8636927905174fee391cd287b5e44fb7be3eb882 (diff) | |
download | pmwiki.svn-108c207aba95a0f5bbf22c3db7b9ff7700b359ed.tar.bz2 |
Enable Markup backtrace in ?action=ruleset
git-svn-id: svn://pmwiki.org/pmwiki/trunk@3015 524c5546-5005-0410-9a3e-e25e191bd360
-rw-r--r-- | pmwiki.php | 6 | ||||
-rw-r--r-- | scripts/diag.php | 11 |
2 files changed, 15 insertions, 2 deletions
@@ -1610,6 +1610,12 @@ function Markup($id, $when, $pat=NULL, $rep=NULL) { if ($pat && !isset($MarkupTable[$id]['pat'])) { $MarkupTable[$id]['pat'] = $pat; $MarkupTable[$id]['rep'] = $rep; + + if (function_exists('debug_backtrace') && preg_match('!/[^/]*e[^/]*$!', $pat)) { + $dbg = debug_backtrace(); + $MarkupTable[$id]['dbg'] = "! file: {$dbg['0']['file']}, " + . "line: {$dbg['0']['line']}, pat: {$dbg['0']['args'][2]}"; + } } } diff --git a/scripts/diag.php b/scripts/diag.php index 6aee036b..0fe133ce 100644 --- a/scripts/diag.php +++ b/scripts/diag.php @@ -25,9 +25,16 @@ if ($action=='phpinfo') { phpinfo(); exit(); } function Ruleset() { global $MarkupTable; $out = ''; + $dbg = 0; BuildMarkupRules(); - foreach($MarkupTable as $id=>$m) - $out .= sprintf("%-16s %-16s %-16s\n",$id,@$m['cmd'],@$m['seq']); + foreach($MarkupTable as $id=>$m) { + $out .= sprintf("%-16s %-16s %-16s %s\n",$id,@$m['cmd'],@$m['seq'], @$m['dbg']); + if(@$m['dbg']) $dbg++; + } + if($dbg) $out .= " +[!] Markup rules possibly incompatible with PHP 5.5 or newer. + Please contact the recipe maintainer for update + or see www.pmwiki.org/wiki/PmWiki/CustomMarkup"; return $out; } |