2
2
3
3
define ( 'DVWA_WEB_PAGE_TO_ROOT ' , '' );
4
4
require_once DVWA_WEB_PAGE_TO_ROOT . 'dvwa/includes/dvwaPage.inc.php ' ;
5
+ require_once DVWA_WEB_PAGE_TO_ROOT . 'dvwa/includes/Parsedown.php ' ;
5
6
6
7
dvwaPageStartup ( array ( 'phpids ' ) );
7
8
10
11
$ page [ 'page_id ' ] = 'instructions ' ;
11
12
12
13
$ docs = array (
13
- 'readme ' => array ( 'legend ' => 'Read Me ' , 'file ' => 'README.md ' ),
14
- 'PDF ' => array ( 'legend ' => 'PDF Guide ' , 'file ' => 'docs/pdf.html ' ),
15
- 'changelog ' => array ( 'legend ' => 'Change Log ' , 'file ' => 'CHANGELOG.md ' ),
16
- 'copying ' => array ( 'legend ' => 'Copying ' , 'file ' => 'COPYING.txt ' ),
17
- 'PHPIDS-license ' => array ( 'legend ' => 'PHPIDS License ' , 'file ' => DVWA_WEB_PAGE_TO_PHPIDS . 'LICENSE ' ),
14
+ 'readme ' => array ( 'type ' => ' markdown ' , ' legend ' => 'Read Me ' , 'file ' => 'README.md ' ),
15
+ 'PDF ' => array ( 'type ' => ' html ' , ' legend ' => 'PDF Guide ' , 'file ' => 'docs/pdf.html ' ),
16
+ 'changelog ' => array ( 'type ' => ' markdown ' , ' legend ' => 'Change Log ' , 'file ' => 'CHANGELOG.md ' ),
17
+ 'copying ' => array ( 'type ' => ' markdown ' , ' legend ' => 'Copying ' , 'file ' => 'COPYING.txt ' ),
18
+ 'PHPIDS-license ' => array ( 'type ' => ' markdown ' , ' legend ' => 'PHPIDS License ' , 'file ' => DVWA_WEB_PAGE_TO_PHPIDS . 'LICENSE ' ),
18
19
);
19
20
20
21
$ selectedDocId = isset ( $ _GET [ 'doc ' ] ) ? $ _GET [ 'doc ' ] : '' ;
25
26
26
27
$ instructions = file_get_contents ( DVWA_WEB_PAGE_TO_ROOT .$ readFile );
27
28
29
+ if ($ docs [ $ selectedDocId ]['type ' ] == "markdown " ) {
30
+ $ parsedown = new ParseDown ();
31
+ $ instructions = $ parsedown ->text ($ instructions );
32
+ }
33
+
34
+ /*
28
35
function urlReplace( $matches ) {
29
36
return dvwaExternalLinkUrlGet( $matches[1] );
30
37
}
@@ -37,7 +44,7 @@ function urlReplace( $matches ) {
37
44
);
38
45
39
46
$instructions = nl2br( $instructions );
40
-
47
+ */
41
48
$ docMenuHtml = '' ;
42
49
foreach ( array_keys ( $ docs ) as $ docId ) {
43
50
$ selectedClass = ( $ docId == $ selectedDocId ) ? ' selected ' : '' ;
0 commit comments