catalyst / moodle-tool_objectfs

Object file storage system for Moodle
https://moodle.org/plugins/tool_objectfs
84 stars 70 forks source link

When url signing in used, file containing relative links may be broken #227

Closed brendanheywood closed 4 years ago

brendanheywood commented 4 years ago

eg if you have a scorm with html and css and they refer to each other with relative link these link will be broken when served from the signing domain

workaround, have a black list / white list of file types that can be served via signing

Tasks:

Bonus points:

example code to look at:

https://github.com/moodle/moodle/compare/master...Peterburnett:MDL-54716#diff-6ad5fe5e9e08da691d155d1adc252a68R5059-R5086

brendanheywood commented 4 years ago

Just had a thought, if we apply this as a blank rule there are probably a lot of files that we could safely server this way but won't. A more nuanced approach is we could do a once-off task inspect the content and check whether it contains any relative links. We'd need a handler for each content time we want to support, but a html dom parse is easy. Core also bundles lib/php-css-parser so css should be relatively easy.

brendanheywood commented 4 years ago

dup https://github.com/catalyst/moodle-tool_objectfs/issues/231

brendanheywood commented 4 years ago

@gleimermora to see a failing test, please review, tweak as needed and merge in this first:

https://github.com/catalyst/moodle-tool_objectfs/pull/232

brendanheywood commented 4 years ago

Close as duplicate