From 20bf9bd86968e1bc74c61ff928dd78c6246a11ff Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 4 Feb 2015 01:21:23 +0000 Subject: [PATCH] added a tweak for MSID in code diff view --- codepot/src/codepot/views/code_diff.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/codepot/src/codepot/views/code_diff.php b/codepot/src/codepot/views/code_diff.php index cf9d0313..622d287b 100644 --- a/codepot/src/codepot/views/code_diff.php +++ b/codepot/src/codepot/views/code_diff.php @@ -307,6 +307,9 @@ if (FALSE) // don't want to delete code for the original diff view. } else { + $http_user_agent = $_SERVER['HTTP_USER_AGENT']; + $is_msie = (preg_match('/MSIE/i',$http_user_agent) && !preg_match('/Opera/i',$http_user_agent)); + print '
'; if (empty($file['content'])) @@ -345,10 +348,12 @@ else print ""; if ($diffclass == 'diffchanged') - print format_diff ($x['rev1line'], $x['rev2line'], 'diffchangedold'); + $xline = format_diff ($x['rev1line'], $x['rev2line'], 'diffchangedold'); else - print htmlspecialchars($x['rev1line']); + $xline = htmlspecialchars($x['rev1line']); + if ($is_msie && $xline == '') $xline = ' ' + print $xline; print "\n"; } else @@ -392,10 +397,12 @@ else print ""; if ($diffclass == 'diffchanged') - print format_diff ($x['rev2line'], $x['rev1line'], 'diffchangednew'); + $xline = format_diff ($x['rev2line'], $x['rev1line'], 'diffchangednew'); else - print htmlspecialchars($x['rev2line']); + $xline = htmlspecialchars($x['rev2line']); + if ($is_msie && $xline == '') $xline = ' ' + print $xline; print "\n"; } else