]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3714 also forwarding to the top of the page when a plugin activation fails
authorCash Costello <cash.costello@gmail.com>
Sun, 11 Sep 2011 00:51:30 +0000 (20:51 -0400)
committerCash Costello <cash.costello@gmail.com>
Sun, 11 Sep 2011 00:51:30 +0000 (20:51 -0400)
actions/admin/plugins/activate.php

index 5a945e8eb221b06fa90e23fe3ac3ef4a1b5d3983..0049878e38428480af7dc7bb4888a7b1ac1f7d9f 100644 (file)
@@ -47,5 +47,10 @@ if (count($activated_guids) === 1) {
        $plugin = get_entity($plugin_guids[0]);
        forward("$url#{$plugin->getID()}");
 } else {
-       forward(REFERER);
+       // forward to top of page with a failure so remove any #foo
+       $url = $_SERVER['HTTP_REFERER'];
+       if (strpos($url, '#')) {
+               $url = substr(0, strpos($url, '#'));
+       }
+       forward($url);
 }
\ No newline at end of file