Source code for file /joomla/filter/output.php
Documentation is available at output.php
* @version $Id: functions.php 4277 2006-07-19 20:35:35Z friesengeist $
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* @package Joomla.Framework
* Makes an object safe to display in forms
* Object parameters that are non-string, array, object or start with underscore
* @param object An object to be parsed
* @param int The optional quote style for the htmlspecialchars function
* @param string|arrayAn optional single field name or array of field names not
* to be parsed (eg, for a textarea)
function objectHTMLSafe( &$mixed, $quote_style=
ENT_QUOTES, $exclude_keys=
'' )
if (is_string( $exclude_keys ) &&
$k ==
$exclude_keys) {
* This method processes a string and replaces all instances of & with & in links only
* @param string $input String to process
* @return string Processed string
$regex =
'href="([^"]*(&(amp;){0})[^"]*)*?"';
* This method processes a string all replaces all accented UTF-8 characters by unaccented
* ASCII-7 "equivalents", whitespaces are replaced by hyphens and the string is lowercased.
* @param string $input String to process
* @return string Processed string
array('/ß/','/&(..)lig;/', '/&([aouAOU])uml;/','/&(.)[^;]*;/'),
array('ss',"$1","$1".
'e',"$1"),
// remove any duplicate whitespace, and ensure all characters are alphanumeric
$str =
preg_replace(array('/\s+/','/[^A-Za-z0-9\-]/'), array('-',''), $str);
* Replaces & with & for xhtml compliance
* @todo There must be a better way???
* Callback method for replacing & with & in a string
* @param string $m String to process
* @return string Replaced string
* Cleans text of all formating and scripting code
$text =
preg_replace( "'<script[^>]*>.*?</script>'si", '', $text );
$text =
preg_replace( '/<a\s+.*?href="([^"]+)"[^>]*>([^<]+)<\/a>/is', '\2 (\1)', $text );