Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/files_external/js/gdrive.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$(document).ready(function() {
var backendId = 'googledrive';
var backendUrl = OC.generateUrl('apps/files_external/ajax/oauth2.php');
var backendUrl = OC.generateUrl('/index.php/apps/files_external/ajax/oauth2.php');

function generateUrl($tr) {
// no mapping between client ID and Google 'project', so we always load the same URL
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/js/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ OCA.Sharing.PublicApp = {
urlSpec.x = Math.ceil(urlSpec.x);
urlSpec.y = Math.ceil(urlSpec.y);
urlSpec.t = $('#dirToken').val();
return OC.generateUrl('/apps/files_sharing/ajax/publicpreview.php?') + $.param(urlSpec);
return OC.generateUrl('/index.php/apps/files_sharing/ajax/publicpreview.php') + '?' + $.param(urlSpec);
};

this.fileList.updateEmptyContent = function () {
Expand Down
2 changes: 1 addition & 1 deletion apps/files_trashbin/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
},

generatePreviewUrl: function(urlSpec) {
return OC.generateUrl('/apps/files_trashbin/ajax/preview.php?') + $.param(urlSpec);
return OC.generateUrl('/index.php/apps/files_trashbin/ajax/preview.php') + '?' + $.param(urlSpec);
},

getDownloadUrl: function() {
Expand Down
18 changes: 18 additions & 0 deletions changelog/unreleased/41743
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Bugfix: Request legacy ajax endpoints through the front controller

The front controller rewrite only forwards a request to index.php when the
requested path does not exist on disk. Five javascript call sites requested a url
that was itself a real file, so the web server executed the script directly,
without the bootstrap index.php would have performed, and the request died with a
fatal error (HTTP 500): changing the personal language, the share dialog e-mail
lookup, the Google Drive OAuth entry point, and the trashbin and public link
preview thumbnails.

All five now build their url with an explicit /index.php/ prefix so that the
request no longer matches a file on disk and reaches the router. The prefix has
to be part of the url literal because OC.generateUrl() omits /index.php when
mod_rewrite is active, which is how four of the five came to request the shadowed
url in the first place.

https://github.com/owncloud/core/issues/41740
https://github.com/owncloud/core/pull/41743
2 changes: 1 addition & 1 deletion core/js/sharedialogmailview.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
if (this.xhr != null)
this.xhr.abort();

var xhr = $.get(OC.generateUrl('core/ajax/share.php'), {
var xhr = $.get(OC.generateUrl('/index.php/core/ajax/share.php'), {
'fetch' : 'getShareWithEmail',
'search': query.term
}).done(function(result) {
Expand Down
2 changes: 1 addition & 1 deletion settings/js/panels/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ $(document).ready(function () {
// Serialize the data
var post = $("#languageinput").serialize();
// Ajax foo
$.post('ajax/setlanguage.php', post, function (data) {
$.post(OC.generateUrl('/index.php/settings/ajax/setlanguage.php'), post, function (data) {
if (data.status === "success") {
location.reload();
}
Expand Down