mirror of
https://github.com/php/web-doc.git
synced 2025-08-06 11:06:29 +00:00
this is even safer
This commit is contained in:
@ -238,11 +238,17 @@ function get_stats($idx, $lang, $status) {
|
||||
return array($result['total'], $result['size']);
|
||||
}
|
||||
|
||||
function showdiff ( $dir, $gitfile, $h2, $c )
|
||||
function showdiff ()
|
||||
{
|
||||
if (isset($_GET['f'])) {
|
||||
$gitfile = $_GET['f'];
|
||||
if (isset($_GET['hbp']))
|
||||
$h = $_GET['hbp'];
|
||||
if (isset($_GET['c']))
|
||||
$c = $_GET['c'];
|
||||
$cwd = getcwd();
|
||||
chdir( $dir );
|
||||
$file = `git diff {$h2} -- {$gitfile}`;
|
||||
chdir( GIT_DIR . 'en' );
|
||||
$file = `git diff {$h} -- {$gitfile}`;
|
||||
chdir( $cwd );
|
||||
$raw = htmlspecialchars( $file, ENT_XML1, 'UTF-8' );
|
||||
if ( $c == 'on' ) {
|
||||
@ -265,6 +271,7 @@ function showdiff ( $dir, $gitfile, $h2, $c )
|
||||
} else
|
||||
echo "<pre style='font-family:mono'>" , $raw , "</pre>";
|
||||
}
|
||||
}
|
||||
|
||||
function gen_date($file)
|
||||
{
|
||||
|
@ -382,14 +382,7 @@ END_OF_MULTILINE;
|
||||
break;
|
||||
|
||||
case 'plain':
|
||||
if (isset($_GET['f'])) {
|
||||
$gitfile = $_GET['f'];
|
||||
if (isset($_GET['hbp']))
|
||||
$h2 = $_GET['hbp'];
|
||||
if (isset($_GET['c']))
|
||||
$c = $_GET['c'];
|
||||
showdiff( GIT_DIR . 'en', $gitfile, $h2, $c );
|
||||
}
|
||||
showdiff();
|
||||
echo gen_date($DBLANG);
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user