[Pkg-owncloud-commits] [owncloud] 49/123: Use OC.webroot instead of calculating the URL
David Prévot
taffit at moszumanska.debian.org
Tue May 19 23:55:15 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit baa9503442b5161f1a93d6cd8e6b3629a576fe12
Author: Lukas Reschke <lukas at owncloud.com>
Date: Mon May 11 15:56:37 2015 +0200
Use OC.webroot instead of calculating the URL
Calculating the URL is error-prone as it doesn't work when for example `public.php` is requested and might even be harmful as it could leak sensitive information.
Since `oc.js` is even available when maintenance mode is available it is better to use the global `OC.webroot` that is not controlled by any user.
---
core/js/maintenance-check.js | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/core/js/maintenance-check.js b/core/js/maintenance-check.js
index 061a434..663f7fb 100644
--- a/core/js/maintenance-check.js
+++ b/core/js/maintenance-check.js
@@ -3,10 +3,7 @@ window.setInterval(checkStatus, 20000);
function checkStatus() {
var request = new XMLHttpRequest();
- var ocroot = location.pathname.substr(
- 0, location.pathname.indexOf('index.php')
- );
- request.open("GET", ocroot+'status.php', true);
+ request.open("GET", OC.webroot+'/status.php', true);
request.onreadystatechange = function() {
if (request.readyState === 4) {
var response = request.responseText;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list