本文整理汇总了PHP中InputFilter类的典型用法代码示例。如果您正苦于以下问题:PHP InputFilter类的具体用法?PHP InputFilter怎么用?PHP InputFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InputFilter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run_create_translation
function run_create_translation($args, $opts)
{
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$opts = $filter->xssFilterHard($opts);
$args = $filter->xssFilterHard($args);
$rootDir = realpath(__DIR__."/../../../../");
$app = new Maveriks\WebApplication();
$app->setRootDir($rootDir);
$loadConstants = false;
$workspaces = get_workspaces_from_args($args);
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
$translation = new Translation();
CLI::logging("Updating labels Mafe ...\n");
foreach ($workspaces as $workspace) {
try {
echo "Updating labels for workspace " . pakeColor::colorize($workspace->name, "INFO") . "\n";
$translation->generateTransaltionMafe($lang);
} catch (Exception $e) {
echo "Errors upgrading labels for workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n";
}
}
CLI::logging("Create successful\n");
}
开发者ID:hpx2206,项目名称:processmaker-1,代码行数:28,代码来源:cliMafe.php
示例2: dump
/**
* Dump the contents of the file using fpassthru().
*
* @return void
* @throws Exception if no file or contents.
*/
function dump()
{
if (!$this->data) {
// hmmm .. must be a file that needs to read in
if ($this->inFile) {
$fp = @fopen($this->inFile, "rb");
if (!$fp) {
throw new Exception('Unable to open file: ' . $this->inFile);
}
fpassthru($fp);
@fclose($fp);
} else {
throw new Exception('No data to dump');
}
} else {
$realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
$docuroot = explode('/', $realdocuroot);
array_pop($docuroot);
$pathhome = implode('/', $docuroot) . '/';
array_pop($docuroot);
$pathTrunk = implode('/', $docuroot) . '/';
require_once $pathTrunk . 'gulliver/system/class.inputfilter.php';
$filter = new InputFilter();
$data = $filter->xssFilterHard($this->data);
echo $data;
}
}
开发者ID:emildev35,项目名称:processmaker,代码行数:33,代码来源:Blob.php
示例3: check
/** overloaded check function */
function check()
{
// filter malicious code
$ignoreList = array('params');
$this->filter($ignoreList);
// specific filters
$iFilter = new InputFilter();
if ($iFilter->badAttributeValue(array('href', $this->url))) {
$this->_error = 'Please provide a valid URL';
return false;
}
/** check for valid name */
if (trim($this->title) == '') {
$this->_error = _WEBLINK_TITLE;
return false;
}
if (!(preg_match('http://', $this->url) || preg_match('https://', $this->url) || preg_match('ftp://', $this->url))) {
$this->url = 'http://' . $this->url;
}
/** check for existing name */
$query = "SELECT id" . "\n FROM #__weblinks " . "\n WHERE title = " . $this->_db->Quote($this->title) . "\n AND catid = " . (int) $this->catid;
$this->_db->setQuery($query);
$xid = intval($this->_db->loadResult());
if ($xid && $xid != intval($this->id)) {
$this->_error = _WEBLINK_EXIST;
return false;
}
return true;
}
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:30,代码来源:weblinks.class.php
示例4: getInputFilter
public function getInputFilter()
{
if (!$this->inputFilter) {
$inputFilter = new InputFilter();
$inputFilter->add(array('name' => 'id', 'required' => 'true', 'filters' => array(array('name' => 'Int'))));
$inputFilter->add(array('name' => 'jenis', 'required' => 'true', 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => array('encoding' => 'UTF-8', 'min' => 1, 'max' => 100)))));
$inputFilter->add(array('name' => 'inmission', 'required' => 'true'));
}
return $inputFilter;
}
开发者ID:ibnuda,项目名称:SayaSakit,代码行数:10,代码来源:Senjata.php
示例5: getInputFilter
public function getInputFilter()
{
if (!$this->inputFilter) {
$inputFilter = new InputFilter();
$factory = new InputFactory();
$inputFilter->add($factory->createInput(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => array('encoding' => 'UTF-8', 'min' => 1, 'max' => 100))))));
$inputFilter->add($factory->createInput(array('name' => 'password', 'required' => true)));
$this->inputFilter = $inputFilter;
}
return $this->inputFilter;
}
开发者ID:bladehr8,项目名称:bowhunter2015,代码行数:11,代码来源:Player.php
示例6: getInputFilter
public function getInputFilter($data)
{
$inputFilter = new InputFilter();
$factory = new InputFactory();
$inputFilter->add($factory->createInput(array('name' => 'id', 'required' => false)));
$validator = new \DoctrineModule\Validator\NoObjectExists(array('object_repository' => $this->objectManager->getRepository($this->entityName), 'fields' => array('fullname')));
//use in check email exist when sign up
$filter = $validator->isValid(array('fullname' => $data['fullName']));
// dumps 'true' if an entity matches
return $filter;
}
开发者ID:binnguyen,项目名称:kaffacoffee,代码行数:11,代码来源:userModel.php
示例7: filter
/**
* Filters public properties
* @access protected
* @param array List of fields to ignore
*/
function filter($ignoreList = null)
{
$ignore = is_array($ignoreList);
$iFilter = new InputFilter();
foreach ($this->getPublicProperties() as $k) {
if ($ignore && in_array($k, $ignoreList)) {
continue;
}
$this->{$k} = $iFilter->process($this->{$k});
}
}
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:16,代码来源:tikitable.php
示例8: validate_url
/**
* A validation function that returns an error if the value passed in is not a valid URL.
*
* @param string $text A string to test if it is a valid URL
* @param FormControl $control The control that defines the value
* @param FormContainer $form The container that holds the control
* @param string $warning An optional error message
* @return array An empty array if the string is a valid URL, or an array with strings describing the errors
*/
public static function validate_url($text, $control, $form, $warning = null, $schemes = array('http', 'https'), $guess = true)
{
if (!empty($text)) {
$parsed = InputFilter::parse_url($text);
if ($parsed['is_relative']) {
if ($guess) {
// guess if they meant to use an absolute link
$parsed = InputFilter::parse_url('http://' . $text);
if ($parsed['is_error']) {
// disallow relative URLs
$warning = empty($warning) ? _t('Relative urls are not allowed') : $warning;
return array($warning);
} else {
$warning = empty($warning) ? _t('Relative urls are not allowed') : $warning;
return array($warning);
}
}
}
if ($parsed['is_pseudo'] || !in_array($parsed['scheme'], $schemes)) {
// allow only http(s) URLs
$warning = empty($warning) ? _t('Only %s urls are allowed', array(Format::and_list($schemes))) : $warning;
return array($warning);
}
}
return array();
}
开发者ID:habari,项目名称:system,代码行数:35,代码来源:formvalidators.php
示例9: process
function process()
{
$input_filter = new InputFilter();
$input_filter->process($this);
if (!is_null($this->request->get("method"))) {
$basic = array('reqip' => $this->request->userip . ':' . $this->request->clientip, 'uri' => $this->request->url, 'method' => $this->request->get("method"), 'logid' => $this->requestId);
} else {
$basic = array('reqip' => $this->request->userip . ':' . $this->request->clientip, 'uri' => $this->request->url, 'logid' => $this->requestId);
}
kc_log_addbasic($basic);
$dispatch = new Dispatch($this);
App::getTimer()->set('framework prepare');
$dispatch->dispatch_url($this->request->url);
$this->response->send();
KC_LOG_TRACE('[TIME COST STATISTIC] [ ' . App::getTimer()->getString() . ' ].');
}
开发者ID:hfutxrl2011,项目名称:KCframwork,代码行数:16,代码来源:kcmvc.php
示例10: rangeDownload
function rangeDownload($location, $mimeType)
{
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$location = $filter->xssFilterHard($location, "path");
if (!file_exists($location)) {
header("HTTP/1.0 404 Not Found");
return;
}
$size = filesize($location);
$time = date('r', filemtime($location));
$fm = @fopen($location, 'rb');
if (!$fm) {
header("HTTP/1.0 505 Internal server error");
return;
}
$begin = 0;
$end = $size - 1;
if (isset($_SERVER['HTTP_RANGE'])) {
if (preg_match('/bytes=\\h*(\\d+)-(\\d*)[\\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)) {
$begin = intval($matches[1]);
if (!empty($matches[2])) {
$end = intval($matches[2]);
}
}
}
header('HTTP/1.0 206 Partial Content');
header("Content-Type: {$mimeType}");
header('Cache-Control: public, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Accept-Ranges: bytes');
header('Content-Length:' . ($end - $begin + 1));
if (isset($_SERVER['HTTP_RANGE'])) {
header("Content-Range: bytes {$begin}-{$end}/{$size}");
}
header("Content-Disposition: inline; filename={$location}");
header("Content-Transfer-Encoding: binary");
header("Last-Modified: {$time}");
$cur = $begin;
fseek($fm, $begin, 0);
while (!feof($fm) && $cur <= $end && connection_status() == 0) {
set_time_limit(0);
print fread($fm, min(1024 * 16, $end - $cur + 1));
$cur += 1024 * 16;
flush();
}
}
开发者ID:emildev35,项目名称:processmaker,代码行数:47,代码来源:casesStreamingFile.php
示例11: filter
/**
* returns a filter object to use for this
*
* @param string $name
* @return InputFilter
*/
public final function filter($name)
{
if ($this->_input_filter !== null) {
return $this->_input_filter->filter($name);
}
App::getInstance()->includeFile('Sonic/InputFilter.php');
$this->_input_filter = new InputFilter($this->request());
return $this->_input_filter->filter($name);
}
开发者ID:NePTeR,项目名称:sonic,代码行数:15,代码来源:Controller.php
示例12: test_parse_url_sanitization_javascript
public function test_parse_url_sanitization_javascript()
{
$urls = array('javascript:alert(0);', 'javascript:alert(0);', 'java	script:alert(0);', '	javascript:alert(0);', 'java
script:alert(0);', '
javascript:alert(0);', 'java
script:alert(0);', '
javascript:alert(0);');
foreach ($urls as $url) {
$url = html_entity_decode($url, null, 'UTF-8');
$parsed = InputFilter::parse_url($url);
$this->assert_equal($parsed['scheme'], 'javascript', $url . ' != ' . $parsed['scheme']);
}
}
开发者ID:habari,项目名称:tests,代码行数:9,代码来源:test_inputfilter.php
示例13: execute
public function execute($method, $url, $headers, $body, $config)
{
$merged_headers = array();
foreach ($headers as $k => $v) {
$merged_headers[] = $k . ': ' . $v;
}
// parse out the URL so we can refer to individual pieces
$url_pieces = InputFilter::parse_url($url);
// set up the options we'll use when creating the request's context
$options = array('http' => array('method' => $method, 'header' => implode("\n", $merged_headers), 'timeout' => $config['timeout'], 'follow_location' => $this->can_followlocation, 'max_redirects' => $config['max_redirects'], 'verify_peer' => $config['ssl']['verify_peer'], 'cafile' => $config['ssl']['cafile'], 'capath' => $config['ssl']['capath'], 'local_cert' => $config['ssl']['local_cert'], 'passphrase' => $config['ssl']['passphrase']));
if ($method == 'POST') {
$options['http']['content'] = $body;
}
if ($config['proxy']['server'] != '' && !in_array($url_pieces['host'], $config['proxy']['exceptions'])) {
$proxy = $config['proxy']['server'] . ':' . $config['proxy']['port'];
if ($config['proxy']['username'] != '') {
$proxy = $config['proxy']['username'] . ':' . $config['proxy']['password'] . '@' . $proxy;
}
$options['http']['proxy'] = 'tcp://' . $proxy;
}
// create the context
$context = stream_context_create($options);
// perform the actual request - we use fopen so stream_get_meta_data works
$fh = @fopen($url, 'r', false, $context);
if ($fh === false) {
throw new Exception(_t('Unable to connect to %s', array($url_pieces['host'])));
}
// read in all the contents -- this is the same as file_get_contens, only for a specific stream handle
$body = stream_get_contents($fh);
// get meta data
$meta = stream_get_meta_data($fh);
// close the connection before we do anything else
fclose($fh);
// did we timeout?
if ($meta['timed_out'] == true) {
throw new RemoteRequest_Timeout(_t('Request timed out'));
}
// $meta['wrapper_data'] should be a list of the headers, the same as is loaded into $http_response_header
$headers = array();
foreach ($meta['wrapper_data'] as $header) {
// break the header up into field and value
$pieces = explode(': ', $header, 2);
if (count($pieces) > 1) {
// if the header was a key: value format, store it keyed in the array
$headers[$pieces[0]] = $pieces[1];
} else {
// some headers (like the HTTP version in use) aren't keyed, so just store it keyed as itself
$headers[$pieces[0]] = $pieces[0];
}
}
$this->response_headers = $headers;
$this->response_body = $body;
$this->executed = true;
return true;
}
开发者ID:ringmaster,项目名称:system,代码行数:55,代码来源:socketrequestprocessor.php
示例14: actionUpdate
/**
* Updates a particular model.
* @param integer $_GET['id'] the ID of the model to be updated
* @return updated comment text
*/
public function actionUpdate()
{
Yii::app()->end();
//disalow updates
// get Comments object from $id parameter
$model = $this->loadModel($_GET['id']);
// if Comments form exist and was called via ajax
if (isset($_POST['Comments']) && isset($_POST['ajax'])) {
// set form elements to Users model attributes
$model->attributes = $_POST['Comments'];
// clear tag from text
Yii::import('application.extensions.InputFilter.InputFilter');
$filter = new InputFilter(array('br', 'pre'));
$model->comment_text = $filter->process($model->comment_text);
// update comment
$model->save(false);
echo $model->comment_text;
}
Yii::app()->end();
}
开发者ID:lanzelotik,项目名称:celestic-community,代码行数:25,代码来源:CommentsController.php
示例15: DumpHeaders
function DumpHeaders($filename)
{
global $root_path;
if (!$filename) {
return;
}
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
$isIE = 0;
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false && strstr($HTTP_USER_AGENT, 'Opera') === false) {
$isIE = 1;
}
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE 6') !== false && strstr($HTTP_USER_AGENT, 'Opera') === false) {
$isIE6 = 1;
}
$aux = preg_replace('[^-a-zA-Z0-9\\.]', '_', $filename);
$aux = explode('_', $aux);
$downloadName = $aux[count($aux) - 1];
// $downloadName = $filename;
//$downloadName = ereg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
if ($isIE && !isset($isIE6)) {
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
// Do not have quotes around filename, but that applied to
// "attachment"... does it apply to inline too?
// This combination seems to work mostly. IE 5.5 SP 1 has
// known issues (see the Microsoft Knowledge Base)
header("Content-Disposition: inline; filename={$downloadName}");
// This works for most types, but doesn't work with Word files
header("Content-Type: application/download; name=\"{$downloadName}\"");
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
} else {
header("Content-Disposition: attachment; filename=\"{$downloadName}\"");
header("Content-Type: application/octet-stream; name=\"{$downloadName}\"");
}
//$filename = PATH_UPLOAD . "$filename";
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$filename = $filter->xssFilterHard($filename, 'path');
readfile($filename);
}
开发者ID:emildev35,项目名称:processmaker,代码行数:41,代码来源:users_ViewPhoto.php
示例16: test_complete_filtering_run
function test_complete_filtering_run()
{
$this->assert_equal(InputFilter::filter('<p>I am <div><script src=\\"ohnoes\\" /><a>not a paragraph.</a><p CLASS=old><span> Or am I?</span>'), '<p>I am <div><a>not a paragraph.</a><p><span> Or am I?</span>');
$this->assert_equal(InputFilter::filter('<p onClick=\\"window.alert(\'stole yer cookies!\');\\">Do not click here.</p>\\n<script>alert(\\"See this?\\")</script>'), '<p>Do not click here.</p>\\n');
// http://ha.ckers.org/blog/20070124/stopping-xss-but-allowing-html-is-hard/
$this->assert_equal(InputFilter::filter('<IMG src=\\"http://ha.ckers.org/\\" style\\"=\\"style=\\"a/onerror=alert(String.fromCharCode(88,83,83))//\\" &gt;`>'), 'onerror=alert(String.fromCharCode(88,83,83))//\\" &`>');
$this->assert_equal(InputFilter::filter('<b>Hello world</b>\\n\\nThis is a <test>test</test> post.\\n\\nHere\'s a first XSS attack. <<SCRIPT>alert(\'XSS\');//<</SCRIPT>\\n\\nHere\'s a second try at a <a href=\\"#\\">second link</a>.\\n\\nHere\'s a second XSS attack. <IMG SRC=\\"  javascript:alert(\'XSS\');\\">\\n\\nHere\'s a third link hopefully <a href=\\"#\\">it won\'t get removed</a>.\\n\\n<em>Thanks!</em>'), '<b>Hello world</b>\\n\\nThis is a post.\\n\\nHere\'s a first XSS attack. ');
$this->assert_equal(InputFilter::filter('<<test>script>alert(\'boom\');</test>'), '');
$this->assert_equal(InputFilter::filter('<<test></test>script>alert(\'boom\');'), '');
$this->assert_equal(InputFilter::filter('<<test><</test>script>alert(\'boom\');'), '');
$this->assert_equal(InputFilter::filter('<ScRIpT>alert(\'whee\');</SCRiPT>'), '');
}
开发者ID:psaintlaurent,项目名称:Habari,代码行数:12,代码来源:test_inputfilter.php
示例17: externalCallCheck
/**
* @package Mambo
* @author Mambo Foundation Inc see README.php
* @copyright Mambo Foundation Inc.
* See COPYRIGHT.php for copyright notices and details.
* @license GNU/GPL Version 2, see LICENSE.php
* Mambo is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*/
function externalCallCheck($path, $secret)
{
if (isset($_COOKIE['mostlyce']['startup_key']) && isset($_COOKIE['mostlyce']['usertype'])) {
require_once $path . '/includes/phpInputFilter/class.inputfilter.php';
$iFilter = new InputFilter(null, null, 1, 1);
$startupKey = trim($iFilter->process($_COOKIE['mostlyce']['startup_key']));
//The MOStlyCE rebuild key should match this
$usertype = strtolower(str_replace(' ', '', trim($iFilter->process($_COOKIE['mostlyce']['usertype']))));
} else {
return false;
}
$env = md5($_SERVER['HTTP_USER_AGENT']);
$rebuildKey = md5($secret . $env . $_SERVER['REMOTE_ADDR']);
if ($rebuildKey !== $startupKey) {
return false;
}
//Valid user types
$vUsers = array('author', 'editor', 'publisher', 'manager', 'administrator', 'superadministrator');
if (!in_array($usertype, $vUsers)) {
return false;
}
return true;
}
开发者ID:jwest00724,项目名称:mambo,代码行数:33,代码来源:auth_check.php
示例18: fetch_backtype
protected static function fetch_backtype($url)
{
$backtype = array();
$cacheName = "backtype-{$url}";
if (Cache::has($cacheName)) {
foreach (Cache::get($cacheName) as $cachedBacktype) {
$cachedBacktype->date = HabariDateTime::date_create($cachedBacktype->date);
$backtype[] = $cachedBacktype;
}
return $backtype;
}
$connectData = json_decode(file_get_contents("http://api.backtype.com/comments/connect.json?url={$url}&key=key&itemsperpage=10000"));
if (isset($connectData->comments)) {
foreach ($connectData->comments as $dat) {
$comment = new StdClass();
switch ($dat->entry_type) {
case 'tweet':
$comment->id = 'backtype-twitter-' . $dat->tweet_id;
$comment->url = 'http://twitter.com/' . $dat->tweet_from_user . '/status/' . $dat->tweet_id;
$comment->name = '@' . $dat->tweet_from_user . ' (via Backtype: Twitter)';
$comment->content_out = InputFilter::filter($dat->tweet_text);
$comment->date = $dat->tweet_created_at;
break;
case 'comment':
$comment->id = 'backtype-comment-' . $dat->comment->id;
$comment->url = $dat->comment->url;
$comment->name = $dat->author->name . ' (via Backtype: ' . InputFilter::filter($dat->blog->title) . ')';
$comment->content_out = InputFilter::filter($dat->comment->content);
$comment->date = $dat->comment->date;
break;
}
if (!$comment) {
continue;
}
$comment->status = Comment::STATUS_APPROVED;
$comment->type = Comment::TRACKBACK;
$comment->email = null;
$backtype[] = $comment;
}
}
Cache::set($cacheName, $backtype);
return $backtype;
}
开发者ID:habari-extras,项目名称:backtype,代码行数:43,代码来源:backtype.plugin.php
示例19: dispatch
/**
* Dispatch a request from Apache
*
* Called from file dispatch.php, which is invoked by
* {@link http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html Apache mod_rewrite}
* whenever a client makes a request. Actions:
* <ol>
* <li>Remove forbidden tags and attributes from
* {@link http://www.php.net/reserved.variables#reserved.variables.get $_GET},
* {@link http://www.php.net/reserved.variables#reserved.variables.post $_POST} and
* {@link http://www.php.net/reserved.variables#reserved.variables.request $_REQUEST}.
</li>
* <li>Start a session to keep track of state between requests from
* the client.</li>
* <li>Construct an ActionController to process the action.</li>
* <li>Process the route</li>
* </ol>
* @uses ActionController::__construct()
* @uses ActionController::process_route()
* @uses ActionController::process_with_exception()
* @uses InputFilter::process_all()
* @uses Session::start()
*/
function dispatch()
{
if (TRAX_ENV != 'production') {
$start = microtime(true);
}
try {
InputFilter::process_all();
Session::start();
$ac = new ActionController();
$ac->process_route();
} catch (Exception $e) {
ActionController::process_with_exception($e);
}
if (TRAX_ENV != 'production') {
$duration = "(" . round((microtime(true) - $start) * 1000, 1) . "ms)";
$url = parse_url($_SERVER['REQUEST_URI']);
Trax::log("[1mRendered {$url['path']} {$duration}[0m");
}
}
开发者ID:phpontrax,项目名称:trax,代码行数:42,代码来源:dispatcher.php
示例20: startCase
function startCase()
{
G::LoadClass('case');
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$_POST = $filter->xssFilterHard($_POST);
$_REQUEST = $filter->xssFilterHard($_REQUEST);
$_SESSION = $filter->xssFilterHard($_SESSION);
/* GET , POST & $_SESSION Vars */
/* unset any variable, because we are starting a new case */
if (isset($_SESSION['APPLICATION'])) {
unset($_SESSION['APPLICATION']);
}
if (isset($_SESSION['PROCESS'])) {
unset($_SESSION['PROCESS']);
}
if (isset($_SESSION['TASK'])) {
unset($_SESSION['TASK']);
}
if (isset($_SESSION['INDEX'])) {
unset($_SESSION['INDEX']);
}
if (isset($_SESSION['STEP_POSITION'])) {
unset($_SESSION['STEP_POSITION']);
}
/* Process */
try {
$oCase = new Cases();
lookinginforContentProcess($_POST['processId']);
$aData = $oCase->startCase($_REQUEST['taskId'], $_SESSION['USER_LOGGED']);
$aData = $filter->xssFilterHard($aData);
$_SESSION['APPLICATION'] = $aData['APPLICATION'];
$_SESSION['INDEX'] = $aData['INDEX'];
$_SESSION['PROCESS'] = $aData['PROCESS'];
$_SESSION['TASK'] = $_REQUEST['taskId'];
$_SESSION['STEP_POSITION'] = 0;
$_SESSION['CASES_REFRESH'] = true;
/*----------------------------------********---------------------------------*/
$oCase = new Cases();
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
$aNextStep['PAGE'] = 'open?APP_UID=' . $aData['APPLICATION'] . '&DEL_INDEX=' . $aData['INDEX'] . '&action=draft';
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
$aData['openCase'] = $aNextStep;
$aData['status'] = 'success';
print G::json_encode($aData);
} catch (Exception $e) {
$aData['status'] = 'failure';
$aData['message'] = $e->getMessage();
print_r(G::json_encode($aData));
}
}
开发者ID:emildev35,项目名称:processmaker,代码行数:51,代码来源:casesStartPage_Ajax.php
注:本文中的InputFilter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论