$supp_id = '';
if (strpos($atts, ' id=') === false)
$atts .= ' id="fn' . $fnid . '"';
else
$supp_id = ' id="fn' . $fnid . '"';
if (strpos($atts, 'class=') === false)
$atts .= ' class="footnote"';
$sup = (strpos($att, '^') === false) ? $this->formatFootnote($fns[1], $supp_id) : $this->formatFootnote(''.$fns[1] .'', $supp_id);
$content = $sup . ' ' . $content;
}
if ($tag == "bq") {
$cite = $this->shelveURL($cite);
$cite = ($cite != '') ? ' cite="' . $cite . '"' : '';
$o1 = "\t\n";
$o2 = "\t\tpba($att, '', 0).">";
$c2 = "
";
$c1 = "\n\t
";
}
elseif ($tag == 'bc') {
$o1 = "";
$o2 = "";
$c2 = "
";
$c1 = "
";
$content = $this->shelve($this->r_encode_html(rtrim($content, "\n")."\n"));
}
elseif ($tag == 'notextile') {
$content = $this->shelve($content);
$o1 = $o2 = '';
$c1 = $c2 = '';
}
elseif ($tag == 'pre') {
$content = $this->shelve($this->r_encode_html(rtrim($content, "\n")."\n"));
$o1 = "";
$o2 = $c2 = '';
$c1 = "
";
}
elseif ($tag == '###') {
$eat = true;
}
else {
$o2 = "\t<$tag$atts>";
$c2 = "$tag>";
}
$content = (!$eat) ? $this->graf($content) : '';
return array($o1, $o2, $content, $c2, $c1, $eat);
}
// -------------------------------------------------------------
function fParseHTMLComments($m)
{
list( , $content ) = $m;
if( $this->restricted )
$content = $this->shelve($this->r_encode_html($content));
else
$content = $this->shelve($content);
return "";
}
function getHTMLComments($text)
{
$text = preg_replace_callback("/
\ # end
/sx", array(&$this, "fParseHTMLComments"), $text);
return $text;
}
// -------------------------------------------------------------
function graf($text)
{
// handle normal paragraph text
if (!$this->lite) {
$text = $this->noTextile($text);
$text = $this->code($text);
}
$text = $this->getHTMLComments($text);
$text = $this->getRefs($text);
$text = $this->links($text);
if (!$this->noimage)
$text = $this->image($text);
if (!$this->lite) {
$text = $this->table($text);
$text = $this->redcloth_lists($text);
$text = $this->lists($text);
}
$text = $this->span($text);
$text = $this->footnoteRef($text);
$text = $this->noteRef($text);
$text = $this->glyphs($text);
return rtrim($text, "\n");
}
// -------------------------------------------------------------
function span($text)
{
$qtags = array('\*\*','\*','\?\?','-','__','_','%','\+','~','\^');
$pnct = ".,\"'?!;:‹›«»„“”‚‘’";
$this->span_depth++;
if( $this->span_depth <= $this->max_span_depth )
{
foreach($qtags as $f)
{
$text = preg_replace_callback("/
(^|(?<=[\s>$pnct\(])|[{[]) # pre
($f)(?!$f) # tag
({$this->c}) # atts
(?::(\S+))? # cite
([^\s$f]+|\S.*?[^\s$f\n]) # content
([$pnct]*) # end
$f
($|[\[\]}<]|(?=[$pnct]{1,2}|\s|\))) # tail
/x".$this->regex_snippets['mod'], array(&$this, "fSpan"), $text);
}
}
$this->span_depth--;
return $text;
}
// -------------------------------------------------------------
function fSpan($m)
{
$qtags = array(
'*' => 'strong',
'**' => 'b',
'??' => 'cite',
'_' => 'em',
'__' => 'i',
'-' => 'del',
'%' => 'span',
'+' => 'ins',
'~' => 'sub',
'^' => 'sup',
);
list(, $pre, $tag, $atts, $cite, $content, $end, $tail) = $m;
$tag = $qtags[$tag];
$atts = $this->pba($atts);
$atts .= ($cite != '') ? 'cite="' . $cite . '"' : '';
$content = $this->span($content);
$opentag = '<'.$tag.$atts.'>';
$closetag = ''.$tag.'>';
$tags = $this->storeTags($opentag, $closetag);
$out = "{$tags['open']}{$content}{$end}{$tags['close']}";
if (($pre and !$tail) or ($tail and !$pre))
$out = $pre.$out.$tail;
return $out;
}
// -------------------------------------------------------------
function storeTags($opentag,$closetag='')
{
$key = ($this->tag_index++);
$key = str_pad( (string)$key, 10, '0', STR_PAD_LEFT ); # $key must be of fixed length to allow proper matching in retrieveTags
$this->tagCache[$key] = array('open'=>$opentag, 'close'=>$closetag);
$tags = array(
'open' => "textileopentag{$key} ",
'close' => " textileclosetag{$key}",
);
return $tags;
}
// -------------------------------------------------------------
function retrieveTags($text)
{
$text = preg_replace_callback('/textileopentag([\d]{10}) /' , array(&$this, 'fRetrieveOpenTags'), $text);
$text = preg_replace_callback('/ textileclosetag([\d]{10})/', array(&$this, 'fRetrieveCloseTags'), $text);
return $text;
}
// -------------------------------------------------------------
function fRetrieveOpenTags($m)
{
list(, $key ) = $m;
return $this->tagCache[$key]['open'];
}
// -------------------------------------------------------------
function fRetrieveCloseTags($m)
{
list(, $key ) = $m;
return $this->tagCache[$key]['close'];
}
// -------------------------------------------------------------
function placeNoteLists($text)
{
extract($this->regex_snippets);
# Sequence all referenced definitions...
if( !empty($this->notes) ) {
$o = array();
foreach( $this->notes as $label=>$info ) {
$i = isset($info['seq']) ? $info['seq'] : '';
if( !empty($i) ) {
$info['seq'] = $label;
$o[$i] = $info;
} else {
$this->unreferencedNotes[] = $info; # unreferenced definitions go here for possible future use.
}
}
if( !empty($o) ) ksort($o);
$this->notes = $o;
}
# Replace list markers...
$text = preg_replace_callback("@notelist({$this->c})(?:\:([$wrd|{$this->syms}]))?([\^!]?)(\+?)\.?[\s]*
@U$mod", array(&$this, "fNoteLists"), $text );
return $text;
}
// -------------------------------------------------------------
function fNoteLists($m)
{
list(, $att, $start_char, $g_links, $extras) = $m;
if( !$start_char ) $start_char = 'a';
$index = $g_links.$extras.$start_char;
if( empty($this->notelist_cache[$index]) ) { # If not in cache, build the entry...
$o = array();
if( !empty($this->notes)) {
foreach($this->notes as $seq=>$info) {
$links = $this->makeBackrefLink($info, $g_links, $start_char );
$atts = '';
if( !empty($info['def'])) {
$id = $info['id'];
extract($info['def']);
$o[] = "\t".''.$links.' '.$content.'';
} else {
$o[] = "\t".''.$links.' Undefined Note [#'.$info['seq'].'].';
}
}
}
if( '+' == $extras && !empty($this->unreferencedNotes) ) {
foreach($this->unreferencedNotes as $seq=>$info) {
if( !empty($info['def'])) {
extract($info['def']);
$o[] = "\t".''.$content.'';
}
}
}
$this->notelist_cache[$index] = join("\n",$o);
}
$_ = ($this->notelist_cache[$index]) ? $this->notelist_cache[$index] : '';
if( !empty($_) ) {
$list_atts = $this->pba($att);
$_ = "\n$_\n
";
}
return $_;
}
// -------------------------------------------------------------
function makeBackrefLink( &$info, $g_links, $i )
{
$atts = $content = $id = $link = '';
@extract( $info['def'] );
$backlink_type = ($link) ? $link : $g_links;
$allow_inc = (false === strpos( $this->syms, $i ) );
$i_ = strtr( $this->encode_high($i) , array('&'=>'', ';'=>'', '#'=>''));
$decode = (strlen($i) !== strlen($i_));
if( $backlink_type === '!' )
return '';
elseif( $backlink_type === '^' )
return ''.$i.'';
else {
$_ = array();
foreach( $info['refids'] as $id ) {
$_[] = ''. ( ($decode) ? $this->decode_high(''.$i_.';') : $i_ ) .'';
if( $allow_inc )
$i_++;
}
$_ = join( ' ', $_ );
return $_;
}
}
// -------------------------------------------------------------
function fParseNoteDefs($m)
{
list(, $label, $link, $att, $content) = $m;
# Assign an id if the note reference parse hasn't found the label yet.
$id = isset($this->notes[$label]['id']) ? $this->notes[$label]['id'] : '';
if( !$id )
$this->notes[$label]['id'] = uniqid(rand());
if( empty($this->notes[$label]['def']) ) # Ignores subsequent defs using the same label
{
$this->notes[$label]['def'] = array(
'atts' => $this->pba($att),
'content' => $this->graf($content),
'link' => $link,
);
}
return '';
}
// -------------------------------------------------------------
function noteRef($text)
{
$text = preg_replace_callback("/
\[ # start
({$this->c}) # !atts
\#
([^\]!]+?) # !label
([!]?) # !nolink
\]
/Ux", array(&$this, "fParseNoteRefs"), $text);
return $text;
}
// -------------------------------------------------------------
function fParseNoteRefs($m)
{
# By the time this function is called, all the defs will have been processed
# into the notes array. So now we can resolve the link numbers in the order
# we process the refs...
list(, $atts, $label, $nolink) = $m;
$atts = $this->pba($atts);
$nolink = ($nolink === '!');
# Assign a sequence number to this reference if there isn't one already...
$num = isset($this->notes[$label]['seq']) ? $this->notes[$label]['seq'] : '';
if( !$num )
$num = $this->notes[$label]['seq'] = ($this->note_index++);
# Make our anchor point & stash it for possible use in backlinks when the
# note list is generated later...
$this->notes[$label]['refids'][] = $refid = uniqid(rand());
# If we are referencing a note that hasn't had the definition parsed yet, then assign it an ID...
$id = isset($this->notes[$label]['id']) ? $this->notes[$label]['id'] : '';
if( !$id )
$id = $this->notes[$label]['id'] = uniqid(rand());
# Build the link (if any)...
$_ = ''.$num.'';
if( !$nolink )
$_ = ''.$_.'';
# Build the reference...
$_ = $this->replaceMarkers( txt_nl_ref_pattern, array( 'atts' => $atts, 'marker' => $_ ) );
return $_;
}
// -------------------------------------------------------------
/**
* Parse URI
*
* Regex taken from the RFC at http://tools.ietf.org/html/rfc3986#appendix-B
**/
function parseURI( $uri, &$m )
{
$r = "@^((?P[^:/?#]+):)?(//(?P[^/?#]*))?(?P[^?#]*)(\?(?P[^#]*))?(#(?P.*))?@";
# 12 3 4 5 6 7 8 9
#
# scheme = $2
# authority = $4
# path = $5
# query = $7
# fragment = $9
$ok = preg_match( $r, $uri, $m );
return $ok;
}
function addPart( &$mask, $name, &$parts ) {
return (in_array($name, $mask) && isset( $parts[$name]) && '' !== $parts[$name]);
}
// -------------------------------------------------------------
/**
* Rebuild a URI from parsed parts and a mask.
*
* Algorithm based on example from http://tools.ietf.org/html/rfc3986#section-5.3
**/
function rebuildURI( $parts, $mask='scheme,authority,path,query,fragment', $encode=true )
{
$mask = explode( ',', $mask );
$out = '';
if( $this->addPart( $mask, 'scheme', $parts ) ) {
$out .= $parts['scheme'] . ':';
}
if( $this->addPart( $mask, 'authority', $parts) ) {
$out .= '//' . $parts['authority'];
}
if( $this->addPart( $mask, 'path', $parts ) ) {
if( !$encode )
$out .= $parts['path'];
else {
$pp = explode( '/', $parts['path'] );
foreach( $pp as &$p ) {
$p = strtr( rawurlencode( $p ), array( '%40' => '@' ) );
}
$pp = implode( '/', $pp );
$out .= $pp;
}
}
if( $this->addPart( $mask, 'query', $parts ) ) {
$out .= '?' . $parts['query'];
}
if( $this->addPart( $mask, 'fragment', $parts ) ) {
$out .= '#' . $parts['fragment'];
}
return $out;
}
// -------------------------------------------------------------
function links($text)
{
return preg_replace_callback('/
(^|(?<=[\s>.\(])|[{[]) # $pre
" # start
(' . $this->c . ') # $atts
([^"]+?) # $text
(?:\(([^)]+?)\)(?="))? # $title
":
('.$this->urlch.'+?) # $url
(\/)? # $slash
([^'.$this->regex_snippets['wrd'].'\/;]*?) # $post
([\]}]|(?=\s|$|\))) # $tail
/x'.$this->regex_snippets['mod'], array(&$this, "fLink"), $text);
}
// -------------------------------------------------------------
function fLink($m)
{
list(, $pre, $atts, $text, $title, $url, $slash, $post, $tail) = $m;
$uri_parts = array();
$this->parseURI( $url, $uri_parts );
$scheme = $uri_parts['scheme'];
$scheme_in_list = in_array( $scheme, $this->url_schemes );
$scheme_ok = '' === $scheme || $scheme_in_list;
if( !$scheme_ok )
return $m[0];
if( '$' === $text ) {
if( $scheme_in_list )
$text = ltrim( $this->rebuildURI( $uri_parts, 'authority,path,query,fragment', false ), '/' );
else
$text = $url;
}
$atts = $this->pba($atts);
$atts .= ($title != '') ? ' title="' . $this->encode_html($title) . '"' : '';
if (!$this->noimage)
$text = $this->image($text);
$text = $this->span($text);
$text = $this->glyphs($text);
$url = $this->shelveURL( $this->rebuildURI( $uri_parts ) . $slash );
$opentag = 'rel . '>';
$closetag = '';
$tags = $this->storeTags($opentag, $closetag);
$out = $tags['open'].trim($text).$tags['close'];
if (($pre and !$tail) or ($tail and !$pre))
{
$out = $pre.$out.$post.$tail;
$post = '';
}
return $this->shelve($out).$post;
}
// -------------------------------------------------------------
function getRefs($text)
{
if( $this->restricted )
$pattern = "/^\[(.+)\]((?:http:\/\/|https:\/\/|\/)\S+)(?=\s|$)/Um";
else
$pattern = "/^\[(.+)\]((?:http:\/\/|https:\/\/|tel:|file:|ftp:\/\/|sftp:\/\/|mailto:|callto:|\/)\S+)(?=\s|$)/Um";
return preg_replace_callback( $pattern, array(&$this, "refs"), $text);
}
// -------------------------------------------------------------
function refs($m)
{
list(, $flag, $url) = $m;
$uri_parts = array();
$this->parseURI( $url, $uri_parts );
$url = ltrim( $this->rebuildURI( $uri_parts ) ); // encodes URL if needed.
$this->urlrefs[$flag] = $url;
return '';
}
// -------------------------------------------------------------
function shelveURL($text)
{
if ('' === $text) return '';
$ref = md5($text);
$this->urlshelf[$ref] = $text;
return 'urlref:'.$ref;
}
// -------------------------------------------------------------
function retrieveURLs($text)
{
return preg_replace_callback('/urlref:(\w{32})/',
array(&$this, "retrieveURL"), $text);
}
// -------------------------------------------------------------
function retrieveURL($m)
{
$ref = $m[1];
if (!isset($this->urlshelf[$ref]))
return $ref;
$url = $this->urlshelf[$ref];
if (isset($this->urlrefs[$url]))
$url = $this->urlrefs[$url];
return $this->r_encode_html($this->relURL($url));
}
// -------------------------------------------------------------
function relURL($url)
{
$parts = @parse_url(urldecode($url));
if ((empty($parts['scheme']) or @$parts['scheme'] == 'http') and
empty($parts['host']) and
preg_match('/^\w/', @$parts['path']))
$url = $this->hu.$url;
if ($this->restricted and !empty($parts['scheme']) and
!in_array($parts['scheme'], $this->url_schemes))
return '#';
return $url;
}
// -------------------------------------------------------------
function isRelURL($url)
{
$parts = @parse_url($url);
return (empty($parts['scheme']) and empty($parts['host']));
}
// -------------------------------------------------------------
function image($text)
{
return preg_replace_callback("/
(?:[[{])? # pre
\! # opening !
(\<|\=|\>)? # optional alignment atts
($this->c) # optional style,class atts
(?:\. )? # optional dot-space
([^\s(!]+) # presume this is the src
\s? # optional space
(?:\(([^\)]+)\))? # optional title
\! # closing
(?::(\S+))? # optional href
(?:[\]}]|(?=\s|$|\))) # lookahead: space or end of string
/x", array(&$this, "fImage"), $text);
}
// -------------------------------------------------------------
function fImage($m)
{
list(, $algn, $atts, $url) = $m;
$url = htmlspecialchars($url);
$extras = $align = '';
if( '' !== $algn ) {
$vals = array(
'<' => 'left',
'=' => 'center',
'>' => 'right');
if ( isset($vals[$algn]) ) {
if( 'html5' === $this->doctype )
$extras = "align-{$vals[$algn]}";
else
$align = " align=\"{$vals[$algn]}\"";
}
}
$atts = $this->pba($atts , '' , 1 , $extras) . $align;
if(isset($m[4]))
{
$m[4] = htmlspecialchars($m[4]);
$atts .= ' title="' . $m[4] . '" alt="' . $m[4] . '"';
}
else
$atts .= ' alt=""';
$size = false;
if ($this->isRelUrl($url))
$size = @getimagesize(realpath($this->doc_root.ltrim($url, $this->ds)));
if ($size) $atts .= " $size[3]";
$href = (isset($m[5])) ? $this->shelveURL($m[5]) : '';
$url = $this->shelveURL($url);
$out = array(
($href) ? 'rel .'>' : '',
'
',
($href) ? '' : ''
);
return $this->shelve(join('',$out));
}
// -------------------------------------------------------------
function code($text)
{
$text = $this->doSpecial($text, '', '
', 'fCode');
$text = $this->doSpecial($text, '@', '@', 'fCode');
$text = $this->doSpecial($text, '', '
', 'fPre');
return $text;
}
// -------------------------------------------------------------
function fCode($m)
{
list(, $before, $text, $after) = array_pad($m, 4, '');
return $before.$this->shelve(''.$this->r_encode_html($text).'
').$after;
}
// -------------------------------------------------------------
function fPre($m)
{
list(, $before, $text, $after) = array_pad($m, 4, '');
return $before.''.$this->shelve($this->r_encode_html($text)).'
'.$after;
}
// -------------------------------------------------------------
function shelve($val)
{
$i = uniqid(rand());
$this->shelf[$i] = $val;
return $i;
}
// -------------------------------------------------------------
function retrieve($text)
{
if (is_array($this->shelf))
do {
$old = $text;
$text = strtr($text, $this->shelf);
} while ($text != $old);
return $text;
}
// -------------------------------------------------------------
// NOTE: deprecated
function incomingEntities($text)
{
return preg_replace("/&(?![#a-z0-9]+;)/i", "x%x%", $text);
}
// -------------------------------------------------------------
// NOTE: deprecated
function encodeEntities($text)
{
return (function_exists('mb_encode_numericentity'))
? $this->encode_high($text)
: htmlentities($text, ENT_NOQUOTES, "utf-8");
}
// -------------------------------------------------------------
// NOTE: deprecated
function fixEntities($text)
{
/* de-entify any remaining angle brackets or ampersands */
return str_replace(array(">", "<", "&"),
array(">", "<", "&"), $text);
}
// -------------------------------------------------------------
function cleanWhiteSpace($text)
{
$out = preg_replace("/^\xEF\xBB\xBF|\x1A/", '', $text); # Byte order mark (if present)
$out = preg_replace("/\r\n?/", "\n", $out); # DOS and MAC line endings to *NIX style endings
$out = preg_replace("/^[ \t]*\n/m", "\n", $out); # lines containing only whitespace
$out = preg_replace("/\n{3,}/", "\n\n", $out); # 3 or more line ends
$out = preg_replace("/^\n*/", "", $out); # leading blank lines
return $out;
}
// -------------------------------------------------------------
function doSpecial($text, $start, $end, $method='fSpecial')
{
return preg_replace_callback('/(^|\s|[[({>])'.preg_quote($start, '/').'(.*?)'.preg_quote($end, '/').'(\s|$|[\])}])?/ms',
array(&$this, $method), $text);
}
// -------------------------------------------------------------
function fSpecial($m)
{
// A special block like notextile or code
list(, $before, $text, $after) = array_pad($m, 4, '');
return $before.$this->shelve($this->encode_html($text)).$after;
}
// -------------------------------------------------------------
function noTextile($text)
{
$text = $this->doSpecial($text, '', '', 'fTextile');
return $this->doSpecial($text, '==', '==', 'fTextile');
}
// -------------------------------------------------------------
function fTextile($m)
{
list(, $before, $notextile, $after) = array_pad($m, 4, '');
#$notextile = str_replace(array_keys($modifiers), array_values($modifiers), $notextile);
return $before.$this->shelve($notextile).$after;
}
// -------------------------------------------------------------
function footnoteRef($text)
{
return preg_replace_callback('/(?<=\S)\[([0-9]+)([\!]?)\](\s)?/U', array(&$this, 'footnoteID'), $text);
}
// -------------------------------------------------------------
function footnoteID($m)
{
list(, $id, $nolink, $t) = array_pad($m, 4, '');
$backref = ' ';
if (empty($this->fn[$id])) {
$this->fn[$id] = $a = uniqid(rand());
$backref = ' id="fnrev'.$a.'" ';
}
$fnid = $this->fn[$id];
$footref = ( '!' == $nolink ) ? $id : ''.$id.'';
$backref .= 'class="footnote"';
$footref = $this->formatFootnote( $footref, $backref, false );
return $footref;
}
// -------------------------------------------------------------
function glyphs($text)
{
// fix: hackish -- adds a space if final char of text is a double quote.
$text = preg_replace('/"\z/', "\" ", $text);
$text = preg_split("@(<[\w/!?].*>)@Us", $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$i = 0;
foreach($text as $line) {
// text tag text tag text ...
if (++$i % 2) {
// raw < > & chars are already entity encoded in restricted mode
if (!$this->restricted) {
$line = $this->encode_raw_amp($line);
$line = $this->encode_lt_gt($line);
}
$line = preg_replace($this->glyph_search, $this->glyph_replace, $line);
}
$glyph_out[] = $line;
}
return join('', $glyph_out);
}
// -------------------------------------------------------------
function replaceGlyphs($text)
{
return preg_replace('/glyph:([^<]+)/','$1',$text);
}
// -------------------------------------------------------------
function hAlign($in)
{
$vals = array(
'<' => 'left',
'=' => 'center',
'>' => 'right',
'<>' => 'justify');
return (isset($vals[$in])) ? $vals[$in] : '';
}
// -------------------------------------------------------------
function vAlign($in)
{
$vals = array(
'^' => 'top',
'-' => 'middle',
'~' => 'bottom');
return (isset($vals[$in])) ? $vals[$in] : '';
}
// -------------------------------------------------------------
// NOTE: used in notelists
function encode_high($text, $charset = "UTF-8")
{
return mb_encode_numericentity($text, $this->cmap(), $charset);
}
// -------------------------------------------------------------
// NOTE: used in notelists
function decode_high($text, $charset = "UTF-8")
{
return mb_decode_numericentity($text, $this->cmap(), $charset);
}
// -------------------------------------------------------------
function cmap()
{
$f = 0xffff;
$cmap = array(
0x0080, 0xffff, 0, $f);
return $cmap;
}
// -------------------------------------------------------------
function encode_raw_amp($text)
{
return preg_replace('/&(?!#?[a-z0-9]+;)/i', '&', $text);
}
// -------------------------------------------------------------
function encode_lt_gt($text)
{
return strtr($text, array('<' => '<', '>' => '>'));
}
// -------------------------------------------------------------
function encode_quot($text)
{
return str_replace('"', '"', $text);
}
// -------------------------------------------------------------
function encode_html($str, $quotes=1)
{
$a = array(
'&' => '&',
'<' => '<',
'>' => '>',
);
if ($quotes) $a = $a + array(
"'" => ''', // numeric, as in htmlspecialchars
'"' => '"',
);
return strtr($str, $a);
}
// -------------------------------------------------------------
function r_encode_html($str, $quotes=1)
{
// in restricted mode, all input but quotes has already been escaped
if ($this->restricted)
return $this->encode_quot($str);
return $this->encode_html($str, $quotes);
}
// -------------------------------------------------------------
function textile_popup_help($name, $helpvar, $windowW, $windowH)
{
return ' ' . $name . '
';
}
// -------------------------------------------------------------
// NOTE: deprecated
function txtgps($thing)
{
if (isset($_POST[$thing])) {
if (get_magic_quotes_gpc()) {
return stripslashes($_POST[$thing]);
}
else {
return $_POST[$thing];
}
}
else {
return '';
}
}
// -------------------------------------------------------------
// NOTE: deprecated
function dump()
{
static $bool = array( 0=>'false', 1=>'true' );
foreach (func_get_args() as $a)
echo "\n",(is_array($a)) ? print_r($a) : ((is_bool($a)) ? $bool[(int)$a] : $a), "
\n";
return $this;
}
// -------------------------------------------------------------
function blockLite($text)
{
$this->btag = array('bq', 'p');
return $this->block($text."\n\n");
}
} // end class