Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Jun 3, 2022
1 parent 02bc85e commit 16db81c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion userfiles/modules/files/admin_backend.php
Expand Up @@ -342,7 +342,10 @@

</style>

<script>mw.require("<?php print $config['url_to_module']; ?>/files_admin.js"); </script>
<script>
MEDIA_UPLOADS_URL = '<?php echo media_uploads_url(); ?>';
mw.require("<?php print $config['url_to_module']; ?>/files_admin.js");
</script>

<script type="text/javascript">
gchecked = function () {
Expand Down
6 changes: 6 additions & 0 deletions userfiles/modules/files/files_admin.js
Expand Up @@ -76,6 +76,12 @@ if (self === parent) {

pval = filterXSS(pval);

var checkUrlIsCorrect = pval.indexOf(MEDIA_UPLOADS_URL);
if (checkUrlIsCorrect !== 0) {
mw.notification.error('Wrong media file.');
return false;
}

if (pval.valueOf()) {
var type = pval.valueOf().split(".").pop();
type = type.toLowerCase();
Expand Down

0 comments on commit 16db81c

Please sign in to comment.