Lines Matching defs:text
704 * returns true if the text contains any bad words
719 * @param string $text - optional text to check, if not given the globals are used
725 function checkwordblock($text = '')
738 if (!$text) $text = "$PRE $TEXT $SUF $SUM";
740 // we prepare the text a tiny bit to prevent spammers circumventing URL checks
742 $text = preg_replace(
745 $text
763 if (count($re) && preg_match('#(' . implode('|', $re) . ')#si', $text, $matches)) {
1002 * also makes sure the given text is valid UTF-8
1004 * @param string $text
1010 function cleanText($text)
1012 $text = preg_replace("/(\015\012)|(\015)/", "\012", $text);
1014 // if the text is not valid UTF-8 we simply assume latin1
1017 if (!Clean::isUtf8($text)) $text = utf8_encode($text);
1019 return $text;
1023 * Prepares text for print in Webforms by encoding special chars.
1027 * @param string $text
1033 function formText($text)
1035 $text = str_replace("\012", "\015\012", $text ?? '');
1036 return htmlspecialchars($text);
1040 * Returns the specified local text in raw format
1085 'tpl' => '', // the text used as template
1086 'tplfile' => '', // the file above text was/should be loaded from
1135 * @var string $tpl the text used as template
1136 * @var string $tplfile the file above text was/should be loaded from
1137 * @var bool $doreplace should wildcard replacements be done on the text?
1219 $text = io_readWikiPage(wikiFN($id, $rev), $id, $rev);
1225 $to = $to ? $to - 1 : (strlen($text));
1228 $slices[0] = substr($text, 0, $from);
1229 $slices[1] = substr($text, $from, $to - $from);
1230 $slices[2] = substr($text, $to);
1235 * Joins wiki text slices
1237 * function to join the text slices.
1242 * @param string $text text in the middle
1249 function con($pre, $text, $suf, $pretty = false)
1254 !str_starts_with($text, "\n")
1259 $suf !== '' && !str_ends_with($text, "\n") &&
1262 $text .= "\n";
1266 return $pre . $text . $suf;
1291 * @param string $text wikitext being saved
1292 * @param string $summary summary of text update
1298 function saveWikiText($id, $text, $summary, $minor = false)
1302 $data = (new PageFile($id))->saveWikiText($text, $summary, $minor);
1641 * @param bool $textonly true returns only plain text, true allows returning html
1642 * @return string html or plain text(not escaped) of formatted user name
1655 * @param bool $textonly true returns only plain text, true allows returning html
1656 * @return string html or plain text(not escaped) of formatted user name
1901 * @param string $exc The text of the raised exception
2001 * Strips source mapping declarations from given text #601
2003 * @param string &$text reference to the CSS or JavaScript code to clean
2005 function stripsourcemaps(&$text)
2007 $text = preg_replace('/^(\/\/|\/\*)[@#]\s+sourceMappingURL=.*?(\*\/)?$/im', '\\1\\2', $text);