Showing the changes to libraries/script-engine/src/ScriptEngines.cpp (1 of 3 files). Show all
Unified · Split
| @@ -89,13 +89,7 @@ QUrl expandScriptUrl(const QUrl& rawScriptURL) { · 88 unmodified lines | ||
| 89 | 89 | |
| 90 | 90 | // stop something like Script.include(["/~/../Desktop/naughty.js"]); from working |
| 91 | 91 | QFileInfo fileInfo(url.toLocalFile()); |
| 92 | − #if defined(Q_OS_WIN) | |
| 93 | − url = QUrl::fromLocalFile(fileInfo.canonicalFilePath().toLower()); | |
| 94 | − #elif defined(Q_OS_OSX) | |
| 95 | − url = QUrl::fromLocalFile(fileInfo.canonicalFilePath().toLower()); | |
| 96 | − #else | |
| 97 | 92 | url = QUrl::fromLocalFile(fileInfo.canonicalFilePath()); |
| 98 | − #endif | |
| 99 | 93 | |
| 100 | 94 | QUrl defaultScriptsLoc = defaultScriptsLocation(); |
| 101 | 95 | if (!defaultScriptsLoc.isParentOf(url)) { |
| @@ -105,6 +99,9 @@ QUrl expandScriptUrl(const QUrl& rawScriptURL) { · 3 unmodified lines | ||
| 105 | 99 | << defaultScriptsLoc.path(); |
| 106 | 100 | return rawScriptURL; |
| 107 | 101 | } |
| 102 | + if (rawScriptURL.path().endsWith("/") && !url.path().endsWith("/")) { | |
| 103 | + url.setPath(url.path() + "/"); | |
| 104 | + } | |
| 108 | 105 | return url; |
| 109 | 106 | } |
| 110 | 107 | return normalizedScriptURL; |