$param->background = trim($matches[0][5], '/'); $param->external = (bool) $matches[0][6]; $param->file = $matches[0][7]; } elseif (preg_match_all('/^(1|4)\\/([0-9]+)\\/([0-9]+)\\/(?:(0|1)\\/)?(.+)$/i', $string, $matches, PREG_SET_ORDER)) { $param->mode = (int) $matches[0][1]; $param->width = (int) $matches[0][2]; $param->height = (int) $matches[0][3]; $param->external = (bool) $matches[0][4]; $param->file = $matches[0][5]; } elseif (preg_match_all('/^(?:(0|1)\\/)?(.+)$/i', $string, $matches, PREG_SET_ORDER)) { $param->external = (bool) $matches[0][1]; $param->file = $matches[0][2]; } return $param; } $param = processParams($_GET['param'], $settings['image']); // If the background has been set, ensure that it's not mistakenly // a folder. This is rare edge case in that if a folder is named like // a hexcode, JIT will interpret it as the background colour instead of // the filepath. // @link https://github.com/symphonycms/jit_image_manipulation/issues/8 if (($param->background !== 0 || empty($param->background)) && $param->external === false) { // Also check the case of `bbbbbb/bbbbbb/file.png`, which should resolve // as background = bbbbbb, file = bbbbbb/file.png (if that's the correct path of // course) if (is_dir(WORKSPACE . '/' . $param->background) && (!is_file(WORKSPACE . '/' . $param->file) && is_file(WORKSPACE . '/' . $param->background . '/' . $param->file))) { $param->file = $param->background . '/' . $param->file; $param->background = 0; } } function __errorHandler($errno = null, $errstr, $errfile = null, $errline = null, $errcontext = null)
$param->position = $matches[0][3]; $param->external = (bool) $matches[0][4]; $param->file = $matches[0][5]; } elseif (preg_match_all('/^1\\/([0-9]+)\\/([0-9]+)\\/(?:(0|1)\\/)?(.+)$/i', $string, $matches, PREG_SET_ORDER)) { $param->mode = 1; $param->width = $matches[0][1]; $param->height = $matches[0][2]; $param->external = (bool) $matches[0][3]; $param->file = $matches[0][4]; } elseif (preg_match_all('/^(?:(0|1)\\/)?(.+)$/i', $string, $matches, PREG_SET_ORDER)) { $param->external = (bool) $matches[0][1]; $param->file = $matches[0][2]; } return $param; } $param = processParams($_GET['param']); define_safe('CACHING', $param->external == false && $settings['image']['cache'] == 1 ? true : false); function __errorHandler($errno = NULL, $errstr, $errfile = NULL, $errline = NULL, $errcontext = NULL) { global $param; if (error_reporting() != 0 && in_array($errno, array(E_WARNING, E_USER_WARNING, E_ERROR, E_USER_ERROR))) { $Log = new Log(ACTIVITY_LOG); $Log->pushToLog("{$errno} - " . strip_tags(is_object($errstr) ? $errstr->generate() : $errstr) . ($errfile ? " in file {$errfile}" : '') . ($errline ? " on line {$errline}" : ''), $errno == E_WARNING || $errno == E_USER_WARNING ? Log::WARNING : Log::ERROR, true); /* stdClass Object ( [mode] => 1 [width] => 100 [height] => 210 [position] => 0 [background] => 0
include '../util/util.php'; include 'newsutil.php'; $siteRootPath = getPathToRootDir(__FILE__); printPageDeclaration($siteRootPath); ?> <div id="wrap"> <div id="overlay"></div> <?php printHeader($siteRootPath); ?> <div class="left rounded"> <div class="box rounded"> <?php processParams(); ?> <h1><?php println('Welcome to <span class="white">News Admin</span>'); ?> </h1> <br/> <div style="text-align:left"> <button class="rounded" value="new-news-story" onclick="document.location.href = 'newsadmin.php';">CREATE NEW NEWS STORY</button> </div> <br/> <?php currentlyEditing(); ?> <?php deletePost();
/* * page variables */ $a_vars = getRequestVar('a_vars', array(), 'array'); /* * visitor config, as saved in the database */ $userAgent = secureVar(@$_SERVER['HTTP_USER_AGENT']); $os = getOs($userAgent); $a_browser = getBrowserInfo($userAgent); $resolution = getRequestVar('res', 'unknown', 'string'); $colorDepth = getRequestVar('col', 32, 'numeric'); $browserLang = secureVar(@$_SERVER['HTTP_ACCEPT_LANGUAGE']); $localTime = getRequestVar('h', date("H"), 'numeric') . ':' . getRequestVar('m', date("i"), 'numeric') . ':' . getRequestVar('s', date("s"), 'numeric'); // assign pageCategory default value of the parse_url::path?query $pageUrlParamsProcessed = processParams($pageUrl, $siteParams); // fix add site.com because else parse_url bugs with ':' in query string if (!ereg('^http://', $pageUrlParamsProcessed)) { $urlParse = parse_url('http://site.com' . $pageUrlParamsProcessed); } else { $urlParse = parse_url($pageUrlParamsProcessed); } if (isset($urlParse['path'])) { $pageNameDefault = substr($urlParse['path'], 1); } if (isset($urlParse['query'])) { $pageNameDefault .= '?' . $urlParse['query']; } if ((!isset($pageNameDefault) || strcmp($pageNameDefault, '') === 0) && isset($urlParse['host'])) { $pageNameDefault = DEFAULT_PAGE_NAME; } else {