Things to describe:
Operating system ATutor is installed on -
ATutor version - 1.6.3
PHP version - 5.2.6
MySQL version - 5.0.75
Webserver & version - 2.2.11
Hi
As I mentioned before, because we use proxy server, ATutor patch didn't work properly so I added a few lines to the code to fix this. The following code was added :
<?php
/*************added by sam***************/
$aContext = array(
'http' => array(
'proxy' => 'tcp://proxy_ip ',
'request_fulluri' => true,
),
);
$cxContext = stream_context_create($aContext);
/*******************************************/
?>
And all @file_get_contents($connection_test_file) replaced by @file_get_contents($connection_test_file,False, $cxContext)
By this changes, ATutor is now able to get the list of the patches and their xml files from http://update.atutor.ca, But installing a patch makes server to generate "Intertal Server Error". I debug the mods/_standard/ patches/index_admin.php and understood that this line cause the problem:
if ($patch_xml === FALSE)
I put "echo var_dump($patch_xml);" befor that line and the result was:
string(8165)
" 08 1.6.3 Fixes a security hole introduced from patch 06. 06 alter vitals.inc.php include/ replace function my_add_null_slashes( $string ) { $string = replaceTags($string); return mysql_real_escape_string(stripslashes($string)); } function my_mysql_real_escape_string( $string ) { return replaceTags($string); } function my_null_slashes($string) { return $string; } if ( get_magic_quotes_gpc() == 1 ) { $addslashes = 'my_add_null_slashes'; $stripslashes = 'stripslashes'; } else { $addslashes = 'my_mysql_real_escape_string'; $stripslashes = 'my_null_slashes'; } //bug #3924, for now, take out the sensitive tags. Not the most briliant way of doing it, //but should be the quickest and easiest way to deal with the hole, yet allow //the mathematical expression to work still. function replaceTags($input){ return preg_replace('/\<\s*meta/', '', $input); } function my_add_null_slashes( $string ) { return mysql_real_escape_string(stripslashes($string)); } function my_null_slashes($string) { return $string; } if ( get_magic_quotes_gpc() == 1 ) { $addslashes = 'my_add_null_slashes'; $stripslashes = 'stripslashes'; } else { $addslashes = 'mysql_real_escape_string'; $stripslashes = 'my_null_slashes'; } alter header.inc.php include/ replace $section_title = validate_length($_SESSION['course_title'], 45, VALIDATE_LENGTH_FOR_DISPLAY); $session_course_title = htmlentities($_SESSION['course_title'], ENT_QUOTES, 'UTF-8'); $section_title = validate_length($session_course_title, 45, VALIDATE_LENGTH_FOR_DISPLAY); alter header.inc.php include/ replace $nav_courses[$row['course_id']] = validate_length($system_courses[$row['course_id']]['title'], 45, VALIDATE_LENGTH_FOR_DISPLAY); $system_courses[$row['course_id']]['title'] = htmlentities($system_courses[$row['course_id']]['title'], ENT_QUOTES, 'UTF-8'); $nav_courses[$row['course_id']] = validate_length($system_courses[$row['course_id']]['title'], 45, VALIDATE_LENGTH_FOR_DISPLAY); alter index.tmpl.php themes/default/users/ replace <img src="images/clr.gif" class="icon" border="0" width="79" height="79" alt="<?php echo $row['title']; ?>" /> <img src="images/clr.gif" class="icon" border="0" width="79" height="79" alt="<?php echo htmlentities($row['title'], ENT_QUOTES, 'UTF-8'); ?>" /> alter index.tmpl.php themes/default/users/ replace <img src="<?php echo $dir; ?>" class="icon" border="0" alt="<?php echo $row['title']; ?>" /> <?php echo $link2; ?> <?php endif; ?> <strong><?php echo $link.$row['title'].$link2; ?></strong> <img src="<?php echo $dir; ?>" class="icon" border="0" alt="<?php echo htmlentities($row['title'], ENT_QUOTES, 'UTF-8'); ?>" /> <?php echo $link2; ?> <?php endif; ?> <strong><?php echo $link.htmlentities($row['title'], ENT_QUOTES, 'UTF-8').$link2; ?></strong> alter index.php replace $savant->assign('banner', AT_print($row['banner'], 'courses.banner')); $savant->assign('banner', AT_print(htmlentities($row['banner'], ENT_QUOTES, 'UTF-8'), 'courses.banner')); alter copyright.inc.php include/html/ replace echo '<small>' . AT_print($system_courses[$_SESSION['course_id']]['copyright'], 'courses.copyright') . '</small><br />'; $system_courses[$_SESSION['course_id']]['copyright'] = htmlentities($system_courses[$_SESSION['course_id']]['copyright'], ENT_QUOTES, 'UTF-8'); echo '<small>' . AT_print($system_courses[$_SESSION['course_id']]['copyright'], 'courses.copyright') . '</small><br />'; alter browse.tmpl.php themes/default/users/ replace <a href="<?php echo url_rewrite('bounce.php?course='.$row['course_id'], true); ?>"><img src="<?php echo $course_icon; ?>" class="headicon" alt="<?php echo $row['title']; ?>" /> </a> <?php } ?> </dt> <dd><h3 <?php echo $style_for_title; ?>><a href="<?php echo url_rewrite('bounce.php?course='.$row['course_id'], true); ?>"><?php echo $row['title']; ?></a></h3></dd> <?php if ($row['description']): ?> <dt><?php echo _AT('description'); ?></dt> <dd><?php echo nl2br($row['description']); ?> </dd> <a href="<?php echo url_rewrite('bounce.php?course='.$row['course_id'], true); ?>"><img src="<?php echo $course_icon; ?>" class="headicon" alt="<?php echo htmlentities($row['title'], ENT_QUOTES, 'UTF-8'); ?>" /> </a> <?php } ?> </dt> <dd><h3 <?php echo $style_for_title; ?>><a href="<?php echo url_rewrite('bounce.php?course='.$row['course_id'], true); ?>"><?php echo htmlentities($row['title'], ENT_QUOTES, 'UTF-8'); ?></a></h3></dd> <?php if ($row['description']): ?> <dt><?php echo _AT('description'); ?></dt> <dd><?php echo nl2br(htmlentities($row['description'], ENT_QUOTES, 'UTF-8')); ?> </dd> "
It seems that $patch_xml is not a Boolean variable!! I change the condition to "if(strcmp($patch_xml,'')==0)" but it still produce the same error!!!!
Would you please help me to know why this error happens??
Thanks a lot
[red] [/red] [red] [/red]