X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=blobdiff_plain;f=lib%2Fweblib.php;fp=lib%2Fweblib.php;h=844fd5c7ed26360bdf78302dd07bd4922f21886c;hp=95dc03acc6e83f3a831c60035915b3d9825606c3;hb=24262f59481a65522a839f4d7e825c8e43c5273e;hpb=d06ffbdf2d06aa7495dd47685cfc99f7d875a196;ds=sidebyside diff --git a/lib/weblib.php b/lib/weblib.php index 95dc03acc6e..844fd5c7ed2 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1827,9 +1827,10 @@ function markdown_to_html($text) { return $text; } - require_once($CFG->libdir .'/markdown.php'); + require_once($CFG->libdir .'/markdown/Markdown.php'); + require_once($CFG->libdir .'/markdown/MarkdownExtra.php'); - return Markdown($text); + return \Michelf\MarkdownExtra::defaultTransform($text); } /** @@ -2621,12 +2622,11 @@ function redirect($url, $message='', $delay=-1) { } } - if ($delay == 0 && !$debugdisableredirect && !headers_sent()) { - // Workaround for IIS bug http://support.microsoft.com/kb/q176113/. - if (session_id()) { - session_get_instance()->write_close(); - } + // Make sure the session is closed properly, this prevents problems in IIS + // and also some potential PHP shutdown issues. + \core\session\manager::write_close(); + if ($delay == 0 && !$debugdisableredirect && !headers_sent()) { // 302 might not work for POST requests, 303 is ignored by obsolete clients. @header($_SERVER['SERVER_PROTOCOL'] . ' 303 See Other'); @header('Location: '.$url);