X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fdoc.php;h=edb2cab62042dbae8d6142158e2f889fba421c0a;hb=d0559fdf4dafcaf8446b437f4af089c944a23d09;hp=0697b25d4f092e224b4ec6a607f1cf6b153b2381;hpb=0cabc70341727a2e017674278a33ddc970e3e2ce;p=quix0rs-gnu-social.git diff --git a/actions/doc.php b/actions/doc.php index 0697b25d4f..edb2cab620 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -27,11 +27,15 @@ class DocAction extends Action { parent::handle($args); $title = $this->trimmed('title'); $filename = INSTALLDIR.'/doc/'.$title; - if (!file_exists()) { + if (!file_exists($filename)) { common_user_error(_t('No such document.')); return; } - $output = Markdown(file_get_contents($filename)); + $c = file_get_contents($filename); + $c = preg_replace('/%%action.(\w+)%%/e', "common_local_url('\\1')", $c); + $c = preg_replace('/%%doc.(\w+)%%/e', "common_local_url('doc', array('title'=>'\\1'))", $c); + $c = preg_replace('/%%(\w+).(\w+)%%/e', 'common_config(\'\\1\', \'\\2\')', $c); + $output = Markdown($c); common_show_header(_t(ucfirst($title))); common_raw($output); common_show_footer();