Lines Matching defs:text
696 * returns true if the text contains any bad words
711 * @param string $text - optional text to check, if not given the globals are used
717 function checkwordblock($text = '')
730 if (!$text) $text = "$PRE $TEXT $SUF $SUM";
732 // we prepare the text a tiny bit to prevent spammers circumventing URL checks
734 $text = preg_replace(
737 $text
755 if (count($re) && preg_match('#(' . implode('|', $re) . ')#si', $text, $matches)) {
968 * also makes sure the given text is valid UTF-8
970 * @param string $text
976 function cleanText($text)
978 $text = preg_replace("/(\015\012)|(\015)/", "\012", $text);
980 // if the text is not valid UTF-8 we simply assume latin1
983 if (!Clean::isUtf8($text)) $text = Conversion::fromLatin1($text);
985 return $text;
989 * Prepares text for print in Webforms by encoding special chars.
993 * @param string $text
999 function formText($text)
1001 $text = str_replace("\012", "\015\012", $text ?? '');
1002 return htmlspecialchars($text);
1006 * Returns the specified local text in raw format
1051 'tpl' => '', // the text used as template
1052 'tplfile' => '', // the file above text was/should be loaded from
1101 * @var string $tpl the text used as template
1102 * @var string $tplfile the file above text was/should be loaded from
1103 * @var bool $doreplace should wildcard replacements be done on the text?
1185 $text = io_readWikiPage(wikiFN($id, $rev), $id, $rev);
1191 $to = $to ? $to - 1 : (strlen($text));
1194 $slices[0] = substr($text, 0, $from);
1195 $slices[1] = substr($text, $from, $to - $from);
1196 $slices[2] = substr($text, $to);
1201 * Joins wiki text slices
1203 * function to join the text slices.
1208 * @param string $text text in the middle
1215 function con($pre, $text, $suf, $pretty = false)
1220 !str_starts_with($text, "\n")
1225 $suf !== '' && !str_ends_with($text, "\n") &&
1228 $text .= "\n";
1232 return $pre . $text . $suf;
1257 * @param string $text wikitext being saved
1258 * @param string $summary summary of text update
1264 function saveWikiText($id, $text, $summary, $minor = false)
1268 $data = (new PageFile($id))->saveWikiText($text, $summary, $minor);
1607 * @param bool $textonly true returns only plain text, true allows returning html
1608 * @return string html or plain text(not escaped) of formatted user name
1621 * @param bool $textonly true returns only plain text, true allows returning html
1622 * @return string html or plain text(not escaped) of formatted user name
1867 * @param string $exc The text of the raised exception
1967 * Strips source mapping declarations from given text #601
1969 * @param string &$text reference to the CSS or JavaScript code to clean
1971 function stripsourcemaps(&$text)
1973 $text = preg_replace('/^(\/\/|\/\*)[@#]\s+sourceMappingURL=.*?(\*\/)?$/im', '\\1\\2', $text);