Public Member Functions | |
| TextFilter () | |
| filterHTML ($string) | |
| filterHTMLEntities ($string) | |
| filterXMLEntities ($string) | |
| filterCharacters ($string, $characters=Array()) | |
| texturize ($text) | |
| autoP ($pee, $br=1) | |
| balanceTags ($text, $is_comment=0) | |
| urlize ($string, $domainize=false) | |
| xhtmlize ($string) | |
| slugify ($string) | |
| recursiveStripSlashes ($obj) | |
Static Public Member Functions | |
| filterJavaScript ($text) | |
| filterAllHTML ($string) | |
| htmlDecode ($htmlString, $quote_style=ENT_QUOTES) | |
| normalizeText ($text) | |
| domainize ($string) | |
Public Attributes | |
| $htmlAllowedTags | |
Private Member Functions | |
| checkboxToBoolean ($value) | |
Definition at line 25 of file textfilter.class.php.
| TextFilter.TextFilter | ( | ) |
Constructor.
Definition at line 33 of file textfilter.class.php.
References $config, Config.getConfig(), and lt_include().
| TextFilter.filterJavaScript | ( | $ | text | ) | [static] |
Removes the Javascript code from a string. Original function from http://www.zend.com/tips/tips.php?id=124&single=1
| text | The text we want to filter |
copied from the original function
Definition at line 48 of file textfilter.class.php.
References $text.
Referenced by filterHTML().
| TextFilter.filterHTML | ( | $ | string | ) |
Filters a string with html code removing all the non-allowed tags (see the 'html_allowed_tags_in_comments' from the configuration file config.properties) It also removes the Javascript code if any.
| string | The text we would like to filter |
Definition at line 80 of file textfilter.class.php.
References filterJavaScript().
| TextFilter.filterAllHTML | ( | $ | string | ) | [static] |
Works like the one above but it simply removes *all* html code from a string
| string | The string we would like to filter |
Definition at line 97 of file textfilter.class.php.
Referenced by AdminPostsListView.render().
| TextFilter.filterHTMLEntities | ( | $ | string | ) |
Converts special characters to HTML entities Works as a wrapper to the htmlentities() function from the PHP API
| string | The string we would like to process |
Definition at line 112 of file textfilter.class.php.
Referenced by filterXMLEntities(), and Textfilter_Test.testHtmlDecode().
| TextFilter.filterXMLEntities | ( | $ | string | ) |
Alias for filterHTMLEntities
Definition at line 122 of file textfilter.class.php.
References filterHTMLEntities().
| TextFilter.filterCharacters | ( | $ | string, | |
| $ | characters = Array() | |||
| ) |
removes characters from a string based on the input array
| string | ||
| characters |
Definition at line 134 of file textfilter.class.php.
| TextFilter.texturize | ( | $ | text | ) |
Texturize function borrowed from http://photomatt.net/tools/texturize
Takes care of "beautifying" code typed by users.
Definition at line 148 of file textfilter.class.php.
| TextFilter.autoP | ( | $ | pee, | |
| $ | br = 1 | |||
| ) |
Texturize function borrowed from http://photomatt.net/tools/texturize
Takes care of "beautifying" text, by adding
tags to blocks of texts without the users needing to know any html.
| pee | ||
| br |
Definition at line 202 of file textfilter.class.php.
Referenced by BlogInfo.getAbout(), and UserInfo.getAboutMyself().
| TextFilter.htmlDecode | ( | $ | htmlString, | |
| $ | quote_style = ENT_QUOTES | |||
| ) | [static] |
This function works in the opposite way of htmlentities, by translating html entities into their character representations. PHP >= 4.3 has html_entity_decode() but this method below works fine regardless of the php version.
Obtained from http://fi.php.net/manual/en/function.html-entity-decode.php
| htmlString | The original string with html entities encoded | |
| quoteStyle |
Definition at line 229 of file textfilter.class.php.
References $config, and lt_include().
Referenced by normalizeText(), and Textfilter_Test.testHtmlDecode().
| TextFilter.normalizeText | ( | $ | text | ) | [static] |
Normalizes the given text. By 'normalizing', it means removing all html markup from the text as well as all punctuation signs, commas, colons, semicolons, ellipsis and everything else... This method is used when storing a normalized version of the text of a post, so that all these characters do not interfere with the search engine provided by mysql. Otherwise, searching for things like 'href' will return strange results (it will return all posts where there were html links), or things like "welcome!" or "whatever..." wouldn't be returned when searching for "welcome" and "whatever"
| text | The original text. |
Definition at line 274 of file textfilter.class.php.
References $result, $text, htmlDecode(), and lt_include().
Referenced by UserComment.setNormalizedText(), and UserComment.setNormalizedTopic().
| TextFilter.balanceTags | ( | $ | text, | |
| $ | is_comment = 0 | |||
| ) |
balanceTags
Balances Tags of string using a modified stack.
| text | Text to be balanced |
Definition at line 309 of file textfilter.class.php.
| TextFilter.urlize | ( | $ | string, | |
| $ | domainize = false | |||
| ) |
Given a string, convert it into something that can be used in a URL (it probably doesn't work very well with non iso-8859-X strings) It will remove the following characters:
; / ? : @ & = + $ ,
It will convert accented characters such as , , , etc to their non-accented counterparts (a, e, i) And any other non-alphanumeric character that hasn't been removed or replaced will be thrown away.
| string | The string that we wish to convert into something that can be used as a URL |
Definition at line 418 of file textfilter.class.php.
References $config, Config.getConfig(), and lt_include().
| TextFilter.domainize | ( | $ | string | ) | [static] |
Given a string, convert it into something that can be used in the domain part of a URL (it probably doesn't work very well with non iso-8859-X strings) It will remove the following characters:
; / ? : @ & = + $ ,
It will convert accented characters such as , , , etc to their non-accented counterparts (a, e, i) And any other non-alphanumeric character that hasn't been removed or replaced will be thrown away.
| string | The string that we wish to convert into something that can be used as a URL |
Definition at line 483 of file textfilter.class.php.
| TextFilter.xhtmlize | ( | $ | string | ) |
xhtml-izes a string. It uses the KSes filter for the task as long as the configuration parameter xhtml_converter_enabled is enabled. If xhtml_converter_aggreesive_mode_enabled is also enabled, KSes will be set into "aggressive" mode and it will try to fix even more problems with the XHTML markup (but it can also introduce more mistakes)
| string |
Definition at line 497 of file textfilter.class.php.
References $config, $result, Config.getConfig(), and lt_include().
| TextFilter.slugify | ( | $ | string | ) |
slugifies a string, which is to say that it urlizes it but additionally only uses characters allowed in a postname, as defined by the linkparser.
| string |
Definition at line 525 of file textfilter.class.php.
References $config, $regexp, Config.getConfig(), and lt_include().
| TextFilter.recursiveStripSlashes | ( | $ | obj | ) |
Definition at line 559 of file textfilter.class.php.
| TextFilter.checkboxToBoolean | ( | $ | value | ) | [private] |
Definition at line 575 of file textfilter.class.php.
Referenced by AdminPluginCenterAction.perform().
| TextFilter.$htmlAllowedTags |
Definition at line 28 of file textfilter.class.php.