--- rat/lonpageflip.pm 2018/12/27 20:11:16 1.99 +++ rat/lonpageflip.pm 2018/12/30 19:47:06 1.101 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.99 2018/12/27 20:11:16 raeburn Exp $ +# $Id: lonpageflip.pm,v 1.101 2018/12/30 19:47:06 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -320,7 +320,8 @@ sub check_http_req { } elsif (($$srcref =~ m{^\Q/adm/wrapper/ext/\E(?!https:)}) && ($ENV{'SERVER_PORT'} == 443)) { unless (&Apache::lonnet::uses_sts()) { - $$srcref .= (($$srcref =~/\?/)? '&':'?') . 'usehttp=1'; + my ($url,$anchor) = ($$srcref =~ /^([^\#]+)(?:|(\#[^\#]+))$/); + $$srcref = $url . (($$srcref =~/\?/)? '&':'?') . 'usehttp=1' .$anchor; $usehttp = 1; } } @@ -471,7 +472,7 @@ sub handler { return REDIRECT; } } - if ($direction eq 'return') { + if ($direction eq 'return') { # -------------------------------------------------------- Return to last known my ($newloc,$usehttp); if (($last) && (tie(%hash,'GDBM_File',$env{'request.course.fn'}.'.db', @@ -483,8 +484,12 @@ sub handler { $usehttp = &check_http_req(\$newloc); if ($hash{'encrypted_'.$id}) { $newloc=&Apache::lonenc::encrypted($newloc); - } elsif ($newloc =~ m{^(/adm/wrapper/ext/[^\#]+)\#([^\#]+)$}) { - $newloc = $1.&escape('#').$2; + } + if ($newloc =~ m{^(/adm/wrapper/ext/[^\#]+)(?:|(\#[^\#]+))$}) { + my ($url,$anchor) = ($1,$2); + if ($anchor) { + $newloc = $url.(($url=~/\?/)?'&':'?').'symb='.&escape($last).$anchor; + } } } else { $newloc='/adm/navmaps';