<?php
namespace wcf\acp\page;
-use wcf\page\AbstractPage;
-class LessStylesheetsPage extends AbstractPage {
- public function show() {
- if (defined('LESS_FILES') && LESS_FILES) {
- @header('Content-Type: text/css');
-
- foreach (explode("\n", LESS_FILES) as $stylesheet) {
- $path = WCF_DIR . 'style/'.$stylesheet.'.less';
- if (!file_exists($path)) {
- echo "\n\nFILE NOT FOUND: ".$path."\n\n\n";
- }
- else {
- readfile($path);
- }
- }
- }
- }
-}
\ No newline at end of file
+class LessStylesheetsPage extends \wcf\page\LessStylesheetsPage { }
<?php
namespace wcf\page;
+use wcf\system\application\ApplicationHandler;
class LessStylesheetsPage extends AbstractPage {
public function show() {
echo "\n\nFILE NOT FOUND: ".$path."\n\n\n";
}
else {
- readfile($path);
+ $content = file_get_contents($path);
+
+ // use absolute path for url()
+ $application = ApplicationHandler::getInstance()->getApplication('wcf');
+ $absolutePath = $application->domainName . $application->domainPath;
+
+ preg_replace('~url\(\'..\/~', 'url(\''.$absolutePath, $content);
+
+ echo $content;
}
}
}
}
-}
\ No newline at end of file
+}