@@ -674,6 +674,9 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request,
674674 LOG_TRC (" css_variables=" << cssVars);
675675 const std::string postMessageOrigin = form.get (" postmessage_origin" , " " );
676676 LOG_TRC (" postmessage_origin" << postMessageOrigin);
677+ const std::string theme = form.get (" theme" , " " );
678+ LOG_TRC (" theme=" << theme);
679+
677680 // Escape bad characters in access token.
678681 // This is placed directly in javascript in loleaflet.html, we need to make sure
679682 // that no one can do anything nasty with their clever inputs.
@@ -729,8 +732,9 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request,
729732 LOOLWSD::getConfigValue<bool >(" hexify_embedded_urls" , false ) ? " true" : " false" ;
730733 Poco::replaceInPlace (preprocess, std::string (" %HEXIFY_URL%" ), hexifyEmbeddedUrls);
731734
732- static const std::string linkCSS (" <link rel=\" stylesheet\" href=\" %s/loleaflet/" LOOLWSD_VERSION_HASH " /%s.css\" >" );
733- static const std::string scriptJS (" <script src=\" %s/loleaflet/" LOOLWSD_VERSION_HASH " /%s.js\" ></script>" );
735+ std::string themePreFix = (theme == " nextcloud" ) ? theme + " /" : " " ;
736+ static const std::string linkCSS (" <link rel=\" stylesheet\" href=\" %s/loleaflet/" LOOLWSD_VERSION_HASH " /" + themePreFix + " %s.css\" >" );
737+ static const std::string scriptJS (" <script src=\" %s/loleaflet/" LOOLWSD_VERSION_HASH " /" + themePreFix+ " %s.js\" ></script>" );
734738
735739 std::string brandCSS (Poco::format (linkCSS, responseRoot, std::string (BRANDING)));
736740 std::string brandJS (Poco::format (scriptJS, responseRoot, std::string (BRANDING)));
0 commit comments