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
4 changes: 4 additions & 0 deletions webserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ RUN cd /rw/extensions/PageForms && patch -l -p0 < PF_AutoEdit.php.$MW_REL_BRANCH
RUN cd /rw/extensions/PageForms && patch -l -p0 < PF_TemplateField.php.$MW_REL_BRANCH.patch
RUN cd /rw/extensions/PageForms && patch -l -p0 < PF_FormPrinter.php.$MW_REL_BRANCH.patch

# Apply PageForms patch to preserve default filenames in upload window
# (prevents auto-filled destination filename from being overwritten by uploaded file's name)
RUN cd /rw/extensions/PageForms && patch -l -p0 < PF_upload.js.$MW_REL_BRANCH.patch

# Sphinx: Setup cron job
RUN apt-get install -y cron \
&& mv -f /rw/extensions/SphinxSearch/sphinx.cron /etc/cron.d/sphinxsearch-update \
Expand Down
2 changes: 1 addition & 1 deletion webserver/html/ropewiki/LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,4 +368,4 @@
$isKnown = true;
}
return true;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--- libs/PF_upload.js.orig 2026-04-09 21:30:55.040234672 -0700
+++ libs/PF_upload.js 2026-04-09 21:31:15.828382322 -0700
@@ -33,6 +33,14 @@
// Remove any previously flagged errors
$( '#mw-upload-permitted, #mw-upload-prohibited' ).removeClass();

+ // ROPEWIKI PATCH: Check if destination field already has a value
+ // If it does, preserve it instead of overwriting with the uploaded filename
+ var destField = $( '#wpDestFile' );
+ if ( destField.length && destField.val() && destField.val().trim() !== '' ) {
+ // Destination filename already set, don't overwrite it
+ return;
+ }
+
path = $( this ).val();
// Find trailing part
slash = path.lastIndexOf( '/' );
@@ -53,14 +61,14 @@
// }

// Output result
- if ( $( '#wpDestFile' ).length ) {
+ if ( destField.length ) {
// Call decodeURIComponent function to remove possible URL-encoded characters
// from the file name (T32390). Especially likely with upload-form-url.
// decodeURIComponent can throw an exception if input is invalid utf-8
try {
- $( '#wpDestFile' ).val( decodeURIComponent( fname ) );
+ destField.val( decodeURIComponent( fname ) );
} catch ( err ) {
- $( '#wpDestFile' ).val( fname );
+ destField.val( fname );
}
//uploadWarning.checkNow( fname );
}
Loading