Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #13 from pnomolos/master

A few basic fixes
  • Loading branch information...
commit 0309090b8a0d4d24b62846fdb71d56fd18163f7b 2 parents 94582d9 + 4dc3ae8
Tom Maiaroto authored
Showing with 11 additions and 2 deletions.
  1. +6 −1 config/bootstrap/dispatcher.php
  2. +5 −1 extensions/util/Asset.php
7 config/bootstrap/dispatcher.php
View
@@ -50,7 +50,12 @@
// Render the toolbar (unless it's an asset from the li3_perf library)
// Why? See li3_perf\extensions\util\Asset
- if(!isset($params['request']->params['asset_type'])) {
+ $content_type = isset($result->headers['Content-Type']) ? $result->headers['Content-Type'] : '';
+ $content_type = array_shift(explode(';', $result->headers['Content-Type'], 2));
+ if(
+ !isset($params['request']->params['asset_type']) &&
+ (!$content_type || $content_type == 'text/html')
+ ) {
$skip = false;
$li3_perf = Libraries::get('li3_perf');
if(isset($li3_perf['skip'])) {
6 extensions/util/Asset.php
View
@@ -32,7 +32,11 @@ public static function render($library=null, $asset_type=null, $asset=null, $opt
$headers = array($_SERVER['SERVER_PROTOCOL'].' 404 Not Found' => null, 'Content-Type' => null, 'Status' => '404 Not Found');
$body = '';
- $full_asset_path = LITHIUM_APP_PATH . '/libraries/' . $library . '/webroot/' . $asset_type . '/' . $asset;
+ if (strpos(__DIR__, LITHIUM_LIBRARY_PATH) !== FALSE) {
+ $full_asset_path = LITHIUM_LIBRARY_PATH . '/' . $library . '/webroot/' . $asset_type . '/' . $asset;
+ } else {
+ $full_asset_path = LITHIUM_APP_PATH . '/libraries/' . $library . '/webroot/' . $asset_type . '/' . $asset;
+ }
if(file_exists($full_asset_path)) {
// get the full content-type, default to text/plain
$finfo = new finfo(FILEINFO_MIME, null);
Please sign in to comment.
Something went wrong with that request. Please try again.