function parse($str, $markdown = true) { // process tags $pattern = '/[\\{\\{]{1}([a-z]+)[\\}\\}]{1}/i'; if (preg_match_all($pattern, $str, $matches)) { list($search, $replace) = $matches; foreach ($replace as $index => $key) { $replace[$index] = Config::meta($key); } $str = str_replace($search, $replace, $str); } $str = html_entity_decode($str, ENT_NOQUOTES, System\Config::app('encoding')); // Parse Markdown as well? if ($markdown === true) { $md = new Parsedown(); $str = $md->text($str); } return $str; }
* Magic Quotes Fix */ if (get_magic_quotes_gpc()) { $gpc = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); array_walk_recursive($gpc, function (&$value) { $value = stripslashes($value); }); } /** * Include base classes and functions */ require PATH . 'system/helpers' . EXT; require PATH . 'system/error' . EXT; require PATH . 'system/arr' . EXT; require PATH . 'system/config' . EXT; require PATH . 'system/autoloader' . EXT; /** * Register the autoloader */ spl_autoload_register(array('System\\Autoloader', 'load')); // set the base path to search System\Autoloader::directory(PATH); // map application aliases to autoloader so we dont // have to fully specify the class namespaces each time. System\Autoloader::$aliases = (array) System\Config::aliases(); /** * Error handling */ set_exception_handler(array('System\\Error', 'exception')); set_error_handler(array('System\\Error', 'native')); register_shutdown_function(array('System\\Error', 'shutdown'));
function decrypt($text) { $key = System\Config::get("App", "AppKey"); $data = base64_decode($text); $iv = substr($data, 0, mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)); return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, hash('sha256', $key, true), substr($data, mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)), MCRYPT_MODE_CBC, $iv), ""); }
<?php /* * Error reporting */ ini_set('display_error', true); error_reporting(-1); /** * Register composer autoloader */ $composer = (require PATH . 'vendor/autoload' . EXT); $composer->add('', APP . 'src'); /* * Set your applications current timezone */ date_default_timezone_set(System\Config::app('timezone', 'UTC')); /** * Import helpers */ require APP . 'helpers' . EXT; /** * Import defined routes */ require APP . 'routes' . EXT; /** * Error handling */ System\Error::register(); /** * Set input */
<body> <div id="header"> <?php $messages = array("We're lost.", "This doesn't look familiar.", "We need a map."); $message = $messages[mt_rand(0, 2)]; ?> <h1 class="laravel"><?php echo $message; ?> </h1> </div> <div id="wrapper"> <?php $apologies = array("This is embarrassing.", "Don't give up on us.", "We're really sorry."); $apology = $apologies[mt_rand(0, 2)]; ?> <h2><?php echo $apology; ?> </h2> <p>We couldn't find the resource you requested. Would you like go to our <a href="<?php echo System\Config::get('application.url'); ?> ">home page</a> instead?</p> </div> </body> </html>
/** * Encode html to entities */ function e($str) { return htmlspecialchars($str, ENT_NOQUOTES, System\Config::app('encoding'), false); }