本文整理汇总了PHP中strip_image_tags函数的典型用法代码示例。如果您正苦于以下问题:PHP strip_image_tags函数的具体用法?PHP strip_image_tags怎么用?PHP strip_image_tags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strip_image_tags函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: acceptData
function acceptData($value)
{
foreach ($value as $key => $val) {
$data[$val] = $this->SV->input->post($val, TRUE);
if (!is_array($data[$val])) {
$data[$val] = strip_image_tags($data[$val]);
$data[$val] = quotes_to_entities($data[$val]);
$data[$val] = encode_php_tags($data[$val]);
$data[$val] = trim($data[$val]);
}
}
return $data;
}
开发者ID:cristminix,项目名称:cGRhbXRrcg-,代码行数:13,代码来源:simplival.php
示例2: description
//.........这里部分代码省略.........
// remove code examples since they are handled by the example method
$this->_description = preg_replace('#<code>.+</code>#ms', '', $this->_description);
$this->_description = trim($this->_description);
} else {
$this->_description = $this->_text;
}
}
$desc = $this->_description;
$desc = $this->filter($desc);
// apply different formats
if ($format) {
if (is_string($format)) {
$format = (array) $format;
}
foreach ($format as $f) {
switch (strtolower($f)) {
case 'markdown':
// must escape underscores to prevent <em> tags
$desc = str_replace('_', '\\_', $desc);
$desc = markdown($desc);
// the we replace back any that didn't get processed'(e.g. ones inside links)
$desc = str_replace('\\_', '_', $desc);
break;
case 'short':
$desc_lines = explode(PHP_EOL, $desc);
$first_line = TRUE;
foreach ($desc_lines as $d) {
if (!empty($d)) {
if ($first_line) {
$first_line = FALSE;
$desc = $d;
break;
}
}
}
break;
case 'long':
$desc_lines = explode(PHP_EOL, $desc);
$new_desc = '';
$first_line = TRUE;
foreach ($desc_lines as $d) {
if (!empty($d)) {
if ($first_line) {
$first_line = FALSE;
continue;
} else {
$new_desc .= $d . ' ';
}
} else {
if (!$first_line) {
$new_desc .= "\n\n";
}
}
}
$desc = $new_desc;
break;
case 'one_line':
$desc = str_replace(PHP_EOL, ' ', $desc);
break;
case 'entities':
$desc = htmlentities($desc);
break;
case 'eval':
$desc = eval_string($desc);
break;
case 'periods':
$desc_lines = explode(PHP_EOL, $desc);
$lines = '';
$past_first = FALSE;
foreach ($desc_lines as $d) {
$d = trim($d);
if (!empty($d)) {
if (!$past_first) {
$d = preg_replace('#(.+[^\\.|>]\\s*)$#', '$1. ', $d);
}
$lines .= $d . ' ';
$past_first = TRUE;
} else {
if ($past_first) {
$lines .= "\n\n";
}
}
}
$lines = preg_replace('#(.+[^\\.|>]\\s*)$#', '$1. ', trim($lines));
$desc = $lines;
case 'ucfirst':
$desc = ucfirst($desc);
break;
}
}
}
// auto link
$desc = auto_link($desc);
// trim white space
$desc = trim($desc);
// clean
$desc = xss_clean($desc);
$desc = strip_image_tags($desc);
return $desc;
}
开发者ID:kbjohnson90,项目名称:FUEL-CMS,代码行数:101,代码来源:Inspection.php
示例3: _strip_image_tags
/**
* Strip Image Tags (prep)
*
* Strips the HTML from image tags leaving the raw URL.
* This replaces the version in CI_Form_validation.
*
* @ignore
*/
protected function _strip_image_tags($field)
{
$this->{$field} = strip_image_tags($this->{$field});
}
开发者ID:RVRKC,项目名称:Hackathon_2015,代码行数:12,代码来源:datamapper.php
示例4: _filter_comment
function _filter_comment($comment)
{
$this->load->helper('security');
$comment_attrs = array('content', 'author_name', 'author_email', 'author_website');
foreach ($comment_attrs as $filter) {
$text = $comment->{$filter};
// first remove any nofollow attributes to clean up... not perfect but good enough
$text = preg_replace('/<a(.+)rel=["\'](.+)["\'](.+)>/Umi', '<a$1rel="nofollow"$3>', $text);
// $text = str_replace('<a ', '<a rel="nofollow"', $text);
$text = strip_image_tags($text);
$comment->{$filter} = $text;
}
return $comment;
}
开发者ID:kieranklaassen,项目名称:FUEL-CMS,代码行数:14,代码来源:blog.php
示例5: decode_format
function decode_format($content)
{
$STB =& get_instance();
$STB->load->helper('security');
$content = strip_url_tags(strip_image_tags($content));
return $content;
}
开发者ID:stoneStyle,项目名称:startbbs,代码行数:7,代码来源:function_helper.php
示例6: _parse_single
public function _parse_single($key, $val, $string)
{
$newval = $val;
$find = "/" . $this->l_delim . "" . $key . ".*" . $this->r_delim . "/U";
preg_match($find, $string, $matches);
if (!empty($matches)) {
$temp = trim($matches[0], "{}");
$res = explode(":", $temp);
// var_dump($res);
if (count($res) > 1) {
switch ($res[1]) {
case "allcaps":
$newval = strtoupper($val);
break;
case "money":
$newval = number_format((int) $val, 2, ".", ",");
break;
case "caps":
$newval = ucwords(strtolower($val));
break;
case "nocaps":
$newval = strtolower($val);
break;
case "ucfirst":
$newval = ucfirst($val);
break;
case "bool1":
$newval = $val == 1 ? "True" : "False";
break;
case "bool2":
$newval = $val == 1 ? "Yes" : "No";
break;
case "bool3":
$newval = $val == 1 ? "Active" : "Inactive";
break;
case "climit":
$int = count($res) < 3 ? 128 : $res[2];
$newval = character_limiter($val, $int);
break;
case "htmlchars":
$newval = quotes_to_entities($val);
break;
case "wlimit":
$int = count($res) < 3 ? 25 : $res[2];
$newval = word_limiter($val, $int);
break;
case "wrap":
$int = count($res) < 3 ? 76 : $res[2];
$newval = word_wrap($val, $int);
break;
case "hilite":
$str = count($res) < 3 ? "" : $res[2];
$color = count($res) < 4 ? "#990000" : $res[3];
$newval = highlight_phrase($val, $str, "<span style=\"color:{$color}\">", "</span>");
break;
case "safe_mailto":
$alt_text = count($res) < 3 ? "" : $res[2];
$newval = safe_mailto($val, $alt_text);
break;
case "url_title":
$sep = count($res) < 3 ? "dash" : $res[2];
$newval = url_title($val, $sep);
break;
case "remove_img":
$newval = strip_image_tags($val);
break;
case "hash":
$hash = count($res) < 3 ? "md5" : $res[2];
$newval = dohash($val, $hash);
break;
case "stripslashes":
$newval = stripslashes($val);
break;
case "strip_tags":
$allowed = count($res) < 3 ? "" : $res[2];
$newval = strip_tags($val, $allowed);
break;
/** other output string format options here **/
}
return str_replace($matches[0], $newval, $string);
}
}
return parent::_parse_single($key, $val, $string);
}
开发者ID:silentworks,项目名称:vaspasian,代码行数:84,代码来源:Vaspasian_Parser.php
示例7: test_strip_image_tags
function test_strip_image_tags()
{
$this->assertEquals('http://example.com/spacer.gif', strip_image_tags('http://example.com/spacer.gif'));
$this->assertEquals('http://example.com/spacer.gif', strip_image_tags('<img src="http://example.com/spacer.gif" alt="Who needs CSS when you have a spacer.gif?" />'));
}
开发者ID:DavBfr,项目名称:BlogMVC,代码行数:5,代码来源:security_helper_test.php
示例8: get_content_formatted
function get_content_formatted($strip_images = FALSE)
{
$this->_CI->load->module_helper(FUEL_FOLDER, 'fuel');
$content = $this->content;
if ($strip_images) {
$CI->load->helper('security');
$content = strip_image_tags($this->content);
}
$content = $this->_format($content);
$content = $this->_parse($content);
return $content;
}
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:12,代码来源:blog_posts_model.php
示例9: security_clean
public function security_clean($q)
{
$this->load->helper('security');
//$this->load->library('security');
$q = str_replace("", "", $q);
$q = str_replace('\\0', "", $q);
$q = xss_clean($q);
//$q = $this->security->xss_clean($q);
$q = strip_image_tags($q);
$q = encode_php_tags($q);
$q = preg_replace(array("/select/si", "/delete/si", "/update/si", "/insert/si", "/from/si", "/alert/si", "/\\[removed\\]/si", "/script/si", "/\\*/si"), "", $q);
return $q;
}
开发者ID:phamhoaian,项目名称:ci-cms,代码行数:13,代码来源:MY_Controller.php
注:本文中的strip_image_tags函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论