$app->pass(); } }); } ///////////////////////////////////////////////////////////////////////////////////////////////// // Bundle Asset Pipeline ///////////////////////////////////////////////////////////////////////////////////////////////// $app->get('/_add-ons/(:segments+)', function($segments = array()) use ($app) { // reset any content service caching that's been done ContentService::resetCaches(); // clean segments $segments = URL::sanitize($segments); $file_requested = implode($segments, '/'); $bundle_folder = APP_PATH . "/core/bundles/" . $segments[0]; $file = APP_PATH . "/core/bundles/" . $file_requested; $file = realpath($file); // prevent bad access of files if (strpos($file_requested, '../') !== false || File::getExtension($file) === 'php') { $app->pass(); return; }