0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: output.php.tar
home/academiac/www/libraries/joomla/cache/controller/output.php 0000644 00000004646 15137267275 0020774 0 ustar 00 <?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Cache output type object * * @package Joomla.Platform * @subpackage Cache * @since 11.1 */ class JCacheControllerOutput extends JCacheController { /** * @since 11.1 */ protected $_id; /** * @since 11.1 */ protected $_group; /** * @since 11.1 */ protected $_locktest = null; /** * Start the cache * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True if the cache is hit (false else) * * @since 11.1 */ public function start($id, $group = null) { // If we have data in cache use that. $data = $this->cache->get($id, $group); $this->_locktest = new stdClass; $this->_locktest->locked = null; $this->_locktest->locklooped = null; if ($data === false) { $this->_locktest = $this->cache->lock($id, $group); if ($this->_locktest->locked == true && $this->_locktest->locklooped == true) { $data = $this->cache->get($id, $group); } } if ($data !== false) { $data = unserialize(trim($data)); echo $data; if ($this->_locktest->locked == true) { $this->cache->unlock($id, $group); } return true; } else { // Nothing in cache... let's start the output buffer and start collecting data for next time. if ($this->_locktest->locked == false) { $this->_locktest = $this->cache->lock($id, $group); } ob_start(); ob_implicit_flush(false); // Set id and group placeholders $this->_id = $id; $this->_group = $group; return false; } } /** * Stop the cache buffer and store the cached data * * @return boolean True if cache stored * * @since 11.1 */ public function end() { // Get data from output buffer and echo it $data = ob_get_contents(); ob_end_clean(); echo $data; // Get id and group and reset them placeholders $id = $this->_id; $group = $this->_group; $this->_id = null; $this->_group = null; // Get the storage handler and store the cached data $ret = $this->cache->store(serialize($data), $id, $group); if ($this->_locktest->locked == true) { $this->cache->unlock($id, $group); } return $ret; } } home/academiac/www/libraries/joomla/filter/output.php 0000644 00000013047 15137567657 0017035 0 ustar 00 <?php /** * @package Joomla.Platform * @subpackage Filter * * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JFilterOutput * * @package Joomla.Platform * @subpackage Filter * @since 11.1 */ class JFilterOutput { /** * Makes an object safe to display in forms * * Object parameters that are non-string, array, object or start with underscore * will be converted * * @param object &$mixed An object to be parsed * @param integer $quote_style The optional quote style for the htmlspecialchars function * @param mixed $exclude_keys An optional string single field name or array of field names not * to be parsed (eg, for a textarea) * * @return void * * @since 11.1 */ public static function objectHTMLSafe(&$mixed, $quote_style = ENT_QUOTES, $exclude_keys = '') { if (is_object($mixed)) { foreach (get_object_vars($mixed) as $k => $v) { if (is_array($v) || is_object($v) || $v == null || substr($k, 1, 1) == '_') { continue; } if (is_string($exclude_keys) && $k == $exclude_keys) { continue; } elseif (is_array($exclude_keys) && in_array($k, $exclude_keys)) { continue; } $mixed->$k = htmlspecialchars($v, $quote_style, 'UTF-8'); } } } /** * This method processes a string and replaces all instances of & with & in links only. * * @param string $input String to process * * @return string Processed string * * @since 11.1 */ public static function linkXHTMLSafe($input) { $regex = 'href="([^"]*(&(amp;){0})[^"]*)*?"'; return preg_replace_callback("#$regex#i", array('JFilterOutput', '_ampReplaceCallback'), $input); } /** * This method processes a string and replaces all accented UTF-8 characters by unaccented * ASCII-7 "equivalents", whitespaces are replaced by hyphens and the string is lowercase. * * @param string $string String to process * * @return string Processed string * * @since 11.1 */ public static function stringURLSafe($string) { // Remove any '-' from the string since they will be used as concatenaters $str = str_replace('-', ' ', $string); $lang = JFactory::getLanguage(); $str = $lang->transliterate($str); // Trim white spaces at beginning and end of alias and make lowercase $str = trim(JString::strtolower($str)); // Remove any duplicate whitespace, and ensure all characters are alphanumeric $str = preg_replace('/(\s|[^A-Za-z0-9\-])+/', '-', $str); // Trim dashes at beginning and end of alias $str = trim($str, '-'); return $str; } /** * This method implements unicode slugs instead of transliteration. * * @param string $string String to process * * @return string Processed string * * @since 11.1 */ public static function stringURLUnicodeSlug($string) { // Replace double byte whitespaces by single byte (East Asian languages) $str = preg_replace('/\xE3\x80\x80/', ' ', $string); // Remove any '-' from the string as they will be used as concatenator. // Would be great to let the spaces in but only Firefox is friendly with this $str = str_replace('-', ' ', $str); // Replace forbidden characters by whitespaces $str = preg_replace('#[:\#\*"@+=;!><&\.%()\]\/\'\\\\|\[]#', "\x20", $str); // Delete all '?' $str = str_replace('?', '', $str); // Trim white spaces at beginning and end of alias and make lowercase $str = trim(JString::strtolower($str)); // Remove any duplicate whitespace and replace whitespaces by hyphens $str = preg_replace('#\x20+#', '-', $str); return $str; } /** * Replaces & with & for XHTML compliance * * @param string $text Text to process * * @return string Processed string. * * @since 11.1 * * @todo There must be a better way??? */ public static function ampReplace($text) { $text = str_replace('&&', '*--*', $text); $text = str_replace('&#', '*-*', $text); $text = str_replace('&', '&', $text); $text = preg_replace('|&(?![\w]+;)|', '&', $text); $text = str_replace('*-*', '&#', $text); $text = str_replace('*--*', '&&', $text); return $text; } /** * Callback method for replacing & with & in a string * * @param string $m String to process * * @return string Replaced string * * @since 11.1 */ public static function _ampReplaceCallback($m) { $rx = '&(?!amp;)'; return preg_replace('#' . $rx . '#', '&', $m[0]); } /** * Cleans text of all formatting and scripting code * * @param string &$text Text to clean * * @return string Cleaned text. * * @since 11.1 */ public static function cleanText(&$text) { $text = preg_replace("'<script[^>]*>.*?</script>'si", '', $text); $text = preg_replace('/<a\s+.*?href="([^"]+)"[^>]*>([^<]+)<\/a>/is', '\2 (\1)', $text); $text = preg_replace('/<!--.+?-->/', '', $text); $text = preg_replace('/{.+?}/', '', $text); $text = preg_replace('/ /', ' ', $text); $text = preg_replace('/&/', ' ', $text); $text = preg_replace('/"/', ' ', $text); $text = strip_tags($text); $text = htmlspecialchars($text, ENT_COMPAT, 'UTF-8'); return $text; } /** * Strip img-tags from string * * @param string $string Sting to be cleaned. * * @return string Cleaned string * * @since 11.1 */ public static function stripImages($string) { return preg_replace('#(<[/]?img.*>)#U', '', $string); } }
©
2018.