1 Star 0 Fork 0

PeterTu_2019/DVWA

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
instructions.php 2.00 KB
一键复制 编辑 原始数据 按行查看 历史
Robin Wood 提交于 2023-03-01 13:17 . Removing PHPIDS
<?php
define( 'DVWA_WEB_PAGE_TO_ROOT', '' );
require_once DVWA_WEB_PAGE_TO_ROOT . 'dvwa/includes/dvwaPage.inc.php';
require_once DVWA_WEB_PAGE_TO_ROOT . 'dvwa/includes/Parsedown.php';
dvwaPageStartup( array( ) );
$page = dvwaPageNewGrab();
$page[ 'title' ] = 'Instructions' . $page[ 'title_separator' ].$page[ 'title' ];
$page[ 'page_id' ] = 'instructions';
$docs = array(
'readme' => array( 'type' => 'markdown', 'legend' => 'Read Me', 'file' => 'README.md' ),
'PDF' => array( 'type' => 'html' ,'legend' => 'PDF Guide', 'file' => 'docs/pdf.html' ),
'changelog' => array( 'type' => 'markdown', 'legend' => 'Change Log', 'file' => 'CHANGELOG.md' ),
'copying' => array( 'type' => 'markdown', 'legend' => 'Copying', 'file' => 'COPYING.txt' ),
);
$selectedDocId = isset( $_GET[ 'doc' ] ) ? $_GET[ 'doc' ] : '';
if( !array_key_exists( $selectedDocId, $docs ) ) {
$selectedDocId = 'readme';
}
$readFile = $docs[ $selectedDocId ][ 'file' ];
$instructions = file_get_contents( DVWA_WEB_PAGE_TO_ROOT.$readFile );
if ($docs[ $selectedDocId ]['type'] == "markdown") {
$parsedown = new ParseDown();
$instructions = $parsedown->text($instructions);
}
/*
function urlReplace( $matches ) {
return dvwaExternalLinkUrlGet( $matches[1] );
}
// Make links and obfuscate the referer...
$instructions = preg_replace_callback(
'/((http|https|ftp):\/\/([[:alnum:]|.|\/|?|=]+))/',
'urlReplace',
$instructions
);
$instructions = nl2br( $instructions );
*/
$docMenuHtml = '';
foreach( array_keys( $docs ) as $docId ) {
$selectedClass = ( $docId == $selectedDocId ) ? ' selected' : '';
$docMenuHtml .= "<span class=\"submenu_item{$selectedClass}\"><a href=\"?doc={$docId}\">{$docs[$docId]['legend']}</a></span>";
}
$docMenuHtml = "<div class=\"submenu\">{$docMenuHtml}</div>";
$page[ 'body' ] .= "
<div class=\"body_padded\">
<h1>Instructions</h1>
{$docMenuHtml}
<span class=\"fixed\">
{$instructions}
</span>
</div>";
dvwaHtmlEcho( $page );
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/petertu_2019/DVWA.git
git@gitee.com:petertu_2019/DVWA.git
petertu_2019
DVWA
DVWA
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385