当前位置: 首页>>代码示例>>PHP>>正文


PHP string::stripscript方法代码示例

本文整理汇总了PHP中string::stripscript方法的典型用法代码示例。如果您正苦于以下问题:PHP string::stripscript方法的具体用法?PHP string::stripscript怎么用?PHP string::stripscript使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在string的用法示例。


在下文中一共展示了string::stripscript方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dodefault

 function dodefault()
 {
     if (!isset($this->post['submit'])) {
         $this->view->assign("relatedoc", $this->setting['relateddoc']);
         $this->view->assign("isrelate", $this->setting['isrelate']);
         $this->view->display("admin_relation");
         exit;
     }
     $isrelate = $this->post['isrelate'];
     $setting = array();
     $relatedoc = trim($this->post['relatedoc']);
     $relatelist = array_unique(explode(';', $relatedoc));
     foreach ($relatelist as $relate) {
         $relate = trim($relate);
         $relate = string::stripscript($relate);
         if (empty($relate)) {
             unset($relate);
         } else {
             $relate = string::haddslashes($relate);
             $relatelists[] = $relate;
         }
     }
     if (count($relatelist) > 10) {
         $this->message($this->view->lang['relatedtitlemore'], 'index.php?admin_relation');
     }
     $setting['relateddoc'] = implode(";", $relatelists);
     $setting['isrelate'] = $isrelate;
     $_ENV['setting']->update_setting($setting);
     $this->cache->removecache('setting');
     $this->message($this->view->lang['relatedtitlesuccess'], 'index.php?admin_relation');
 }
开发者ID:meiwenhui,项目名称:hdwiki,代码行数:31,代码来源:admin_relation.php

示例2: doadd

 /**
  * 添加
  */
 function doadd()
 {
     if (!isset($this->post['submit'])) {
         $navmodellist = $_ENV['navmodel']->get_all(array('status' => 1));
         $this->view->assign("navmodellist", $navmodellist);
         $this->view->display('admin_navmodeladd');
     } else {
         $name = string::stripscript(trim($this->post['name']));
         if (!$name) {
             $this->message('JAVASCRIPT脚本会被过滤,过滤后名称不能为空!', 'BACK');
         }
         $code = trim($this->post['content']);
         if ($_ENV['navmodel']->get_by_navname($name)) {
             $this->message('该导航模块模型名称已经存在!', 'BACK');
         }
         $nav = array('name' => $name, 'code' => $code, 'status' => 1);
         $_ENV['navmodel']->add($nav);
         $this->message('添加成功', 'index.php?admin_navmodel');
     }
 }
开发者ID:meiwenhui,项目名称:hdwiki,代码行数:23,代码来源:admin_navmodel.php

示例3: doadd

 /**
  * 添加
  */
 function doadd()
 {
     $step = isset($this->get[2]) ? intval($this->get[2]) : 1;
     switch ($step) {
         case 1:
             $navmodellist = $_ENV['navmodel']->get_all(array('status' => 1));
             $this->view->assign("navmodellist", $navmodellist);
             break;
         case 2:
             $navname = string::stripscript(trim($this->post['navname']));
             if (!$navname) {
                 $this->message('该导航模块名称不能为空!', 'BACK');
             }
             if ($_ENV['nav']->get_by_navname($navname)) {
                 $this->message('该导航名称已经存在!', 'BACK');
             }
             //取分类信息
             $this->load('category');
             $all_category = $_ENV['category']->get_category_cache();
             $catstr = $_ENV['category']->get_categrory_tree($all_category);
             $content = trim($this->post['content']);
             $position = intval($this->post['position']);
             $nav = array('name' => $navname, 'position' => $position, 'code' => $content, 'time' => $this->time, 'lastedit' => $this->time, 'lasteditor' => $this->user['username'], 'lasteditorid' => $this->user['uid']);
             $navid = $_ENV['nav']->add($nav);
             $this->view->assign("navid", $navid);
             $this->view->assign("catstr", $catstr);
             break;
         case 3:
             $navid = intval($this->post['navid']);
             $content = trim($this->post['content']);
             $docs = explode(';', $content);
             $_ENV['nav']->addlink($navid, $docs);
             $this->message('添加成功', 'index.php?admin_nav');
             break;
         default:
             break;
     }
     $this->view->assign("step", $step);
     $this->view->display('admin_navadd');
 }
开发者ID:meiwenhui,项目名称:hdwiki,代码行数:43,代码来源:admin_nav.php

示例4: doedit

 function doedit()
 {
     if (isset($this->post['submit'])) {
         $cid = intval($this->post['catid']);
         $pid = intval($this->post['pcid']);
         $catname = $this->post['catname'];
         $ico = '';
         $discrib = '';
         $allcategory = $_ENV['category']->get_category_cache();
         $subcid = substr($_ENV['category']->get_all_subcate($cid, $allcategory), 1);
         if ($cid == $pid || $subcid && in_array($pid, explode(",", $subcid))) {
             $this->message($this->view->lang['editCateWrong'], 'BACK');
         }
         $catname = string::stripscript($catname);
         $_ENV['category']->edit_category($cid, $pid, $catname, $ico, $discrib);
         $this->cache->removecache('category');
         $this->message($this->view->lang['editCateSuccess'], 'index.php?admin_category-list-' . $pid);
     } else {
         $cid = intval($this->get[2]);
         $pid = intval($this->get[3]);
         if (!$cid) {
             $this->message($this->view->lang['CateParaWrong'], 'index.php?admin_category-list');
         }
         $cat = $_ENV['category']->get_category($cid);
         $cats = $_ENV['category']->get_all_category();
         $cats = $_ENV['category']->get_categrory_tree($cats);
         $this->view->assign('pid', $pid);
         $this->view->assign('cat', $cat);
         $this->view->assign('cats', $cats);
         $this->view->display('admin_editcategory');
     }
 }
开发者ID:meiwenhui,项目名称:hdwiki,代码行数:32,代码来源:admin_category.php

示例5: doedit

 function doedit()
 {
     $id = $this->post['id'];
     if (empty($id)) {
         $this->message($this->view->lang['commentError'], '', 2);
     }
     $comment = trim($this->post['comment']);
     if (WIKI_CHARSET == 'GBK') {
         $comment = string::hiconv($comment);
     }
     $comment = string::stripscript($_ENV['doc']->replace_danger_word($comment));
     $_ENV["comment"]->edit_comment_by_id($id, $comment);
     $this->message(1, '', 2);
 }
开发者ID:meiwenhui,项目名称:hdwiki,代码行数:14,代码来源:comment.php

示例6: doblacklist

 function doblacklist()
 {
     if (isset($this->post['blacklist'])) {
         $blacklist = htmlspecialchars(string::stripscript($this->post['blacklist']));
         if (empty($blacklist)) {
             $result = $_ENV['pms']->remove_blacklist($this->user['uid']);
         } else {
             $result = $_ENV['pms']->add_blacklist($blacklist, $this->user['uid']);
         }
         $message = $result ? 1 : 2;
         $this->message($message, '', 2);
     } else {
         $this->view->assign('blacklist', $_ENV['pms']->get_blacklist($this->user['uid']));
         //$this->view->display('blacklist');
         $_ENV['block']->view('blacklist');
     }
 }
开发者ID:meiwenhui,项目名称:hdwiki,代码行数:17,代码来源:pms.php

示例7: dochangename

 function dochangename()
 {
     $ajaxtitle = trim($this->post['newname']);
     if (string::hstrtoupper(WIKI_CHARSET) == 'GBK') {
         $ajaxtitle = string::hiconv($ajaxtitle, 'gbk', 'utf-8', 'true');
     }
     $title = string::substring(string::stripscript($_ENV['doc']->replace_danger_word(trim($ajaxtitle))), 0, 80);
     if (@(!is_numeric($this->post['did']))) {
         $this->message("-1", "", 2);
     } elseif ($ajaxtitle != string::stripscript($ajaxtitle)) {
         $this->message("-3", "", 2);
     } elseif (!$title) {
         $this->message("-4", "", 2);
     } elseif (@(bool) $this->db->fetch_by_field('doc', 'title', $title)) {
         $this->message("-2", "", 2);
     } elseif ($_ENV['doc']->change_name($this->post['did'], $title)) {
         $_ENV['synonym']->synonym_change_doc($this->post['did'], $title);
         // 云搜索通知
         if (1 == $this->setting['cloud_search']) {
             // 编辑标题 通知云搜索
             $_ENV['search']->cloud_change(array('dids' => $this->post['did'], 'mode' => '2'));
         }
         $this->message("1", "", 2);
     } else {
         $this->message("0", "", 2);
     }
 }
开发者ID:meiwenhui,项目名称:hdwiki,代码行数:27,代码来源:doc.php


注:本文中的string::stripscript方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。