***
This method cleans a raw value according to your parameters and
returns it.

@static
@public
Clean - Clean( string value, array opt )
@return string $output
***
333992
public static function Clean($value = false, $opt = array())
        {

            // Making a copy of the original $value
            $original = $value;

            // Setting the output var
            $output = $original;

            // If $opt exists, verify the following options
            if ($opt):

                // Should this method remove HTML code from the value?
                if (isset($opt["strip_tags"])):
                    $output = strip_tags($output);
            endif;

                // Should this method trim the value?
                if (isset($opt["trim"])):
                    $output = trim($output);
            endif;

                // Should this method add slashes do the value?
                if (isset($opt["addslashes"])):
                    $output = addslashes($output);
            endif;

                // Should this method remove slashes do the value?
                if (isset($opt["removeslashes"])):
                    $output = stripslashes($output);
            endif;

            endif;

            // Return the new value
            return $output;
        }
398643
def clean(self, value):
        """"""

        if isinstance(value, six.string_types):
            return value
        elif isinstance(value, numbers.Number):
            return str(value)

        raise ParameterNotValidError
232487
protected function cleanObject($input)
	{
		// add to the cleaned list
		$this->parent->isClean($input);

		foreach ($value as $k => $v)
		{
			$value->{$k} = $this->clean($v);
		}
		return $input;
	}
1209331
protected function cleanOutput($output)
    {
        $output = str_replace($this->extraOutput, null, $output);

        return strtr($output, [
            'stdin: is not a tty' => null,
        ]);
    }
872059
public function clean() {
		if (!empty($this->args[0])) {
			$folder = realpath($this->args[0]);
		} elseif ($this->params['plugin']) {
			$folder = Plugin::path(Inflector::classify($this->params['plugin']));
		} else {
			$folder = APP;
		}
		$App = new Folder($folder);
		$this->out('Checking *.php in ' . $folder);

		$files = $App->findRecursive('.*\.php');
		$this->out('Found ' . count($files) . ' files.');

		$action = $this->in('Continue? [y]/[n]', ['y', 'n'], 'n');
		if ($action !== 'y') {
			$this->abort('Aborted');
		}

		$folders = [];

		foreach ($files as $file) {
			$errors = [];
			$action = '';
			$this->out('Processing ' . $file, 1, Shell::VERBOSE);

			$c = file_get_contents($file);
			if (preg_match('/^[\n\r|\n|\r|\s]+\<\?php/', $c)) {
				$errors[] = 'leading';
			}
			if (preg_match('/\?\>[\n\r|\n|\r|\s]+$/', $c)) {
				$errors[] = 'trailing';
			}

			if (!$errors) {
				continue;
			}
			foreach ($errors as $e) {
				$this->report[$e][0]++;
			}
			$this->out('');
			$this->out('contains ' . implode(' and ', $errors) . ' whitespaces: ' . $this->shortPath($file));

			$dirname = dirname($file);
			if (in_array($dirname, $folders)) {
				$action = 'y';
			}

			while (!$action) {
				$action = $this->in('Remove? [y]/[n], [a] for all in this folder, [r] for all below, [*] for all files(!), [q] to quit', ['y', 'n', 'r', 'a', 'q', '*'], 'q');
			}

			if ($action === '*') {
				$action = 'y';

			} elseif ($action === 'a') {
				$action = 'y';
				$folders[] = $dirname;
				$this->out('All: ' . $dirname);
			}

			if ($action === 'q') {
				$this->abort('Abort... Done');
			}

			if ($action === 'y') {
				if (in_array('leading', $errors)) {
					$c = preg_replace('/^\s+\<\?php/', '<?php', $c);
				}
				if (in_array('trailing', $errors)) {
					$c = preg_replace('/\?\>\s+$/', '?>', $c);
				}

				file_put_contents($file, $c);
				foreach ($errors as $e) {
					$this->report[$e][1]++;
				}
				$this->out('fixed ' . implode(' and ', $errors) . ' whitespaces: ' . $this->shortPath($file));
			}
		}

		// Report.
		$this->out('--------');
		$this->out('found ' . $this->report['leading'][0] . ' leading, ' . $this->report['trailing'][0] . ' trailing ws');
		$this->out('fixed ' . $this->report['leading'][1] . ' leading, ' . $this->report['trailing'][1] . ' trailing ws');
	}
1291538
public function clean()
	{
		if ($this->output->isInteractive())
		{
			$performed = 0;
			$proceed   = $this->output->getResponse('Do you want to purge all rollback points except the latest? [y|n]');

			if ($proceed == 'y' || $proceed == 'yes')
			{
				$this->mechanism->purgeRollbackPoints();
				$this->output->addLine('Purging rollback points.');
				$performed++;
			}

			$proceed = $this->output->getResponse('Do you want to purge all stashed changes? [y|n]');

			if ($proceed == 'y' || $proceed == 'yes')
			{
				$this->mechanism->purgeStash();
				$this->output->addLine('Purging repository stash.');
				$performed++;
			}

			$this->output->addLine("Clean up complete. Performed ({$performed}/2) cleanup operations available.");
		}
		else
		{
			$didSomething = false;
			if ($this->arguments->getOpt('purge-rollback-points'))
			{
				$this->mechanism->purgeRollbackPoints();
				$this->output->addLine('Purging rollback points.');
				$didSomething = true;
			}

			if ($this->arguments->getOpt('purge-stash'))
			{
				$this->mechanism->purgeStash();
				$this->output->addLine('Purging repository stash.');
				$didSomething = true;
			}

			if (!$didSomething)
			{
				$this->output->addLine('Please specify which cleanup operations to perform');
			}
		}
	}
83979
public function clean($options = array()) {
        $return= false;
        if ($cache = $this->getCacheProvider($this->getOption(xPDO::OPT_CACHE_KEY, $options), $options)) {
            $return= $cache->flush($options);
        }
        return $return;
    }
1009626
function clean(obj, opts) {
  if (null == obj) return obj

  var out = Array.isArray(obj) ? [] : {}

  var pn = Object.getOwnPropertyNames(obj)
  for (var i = 0; i < pn.length; i++) {
    var p = pn[i]

    if ('$' != p[p.length - 1]) {
      out[p] = obj[p]
    }
  }

  if (opts && false !== opts.proto) {
    //out.__proto__ = obj.__proto__
  }

  return out
}
985357
public function clean($string)
    {
        if (!empty($string)) {
            $string = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $string);
            $string = htmlspecialchars(strip_tags($string, $this->_allowableTags));
            $string = str_replace('href=', 'rel="nofollow" href=', $string);

            return $string;
        }
        return false;
    }
711514
protected function processOutput($output, $array = false, $trim = true)
    {
        // Remove polluting strings
        $output = $this->cleanOutput($output);

        // Explode output if necessary
        if ($array) {
            $delimiter = $this->environment->getLineEndings() ?: PHP_EOL;
            $output = explode($delimiter, $output);
        }

        // Trim output
        if ($trim) {
            $output = is_array($output)
                ? array_filter($output)
                : trim($output);
        }

        return $output;
    }
130806
private function cleanInputData($str) {
        if (is_array($str)) {
            $new_array = [];
            foreach ($str as $key => $val) {
                $new_array [ $this->cleanInputKeys($key) ] = $this->cleanInputData($val);
            }

            return $new_array;
        }
        $str = self::$xss_cleaner->xss_clean($str);
        // Standardize newlines
        if (strpos($str, "\r") !== false) {
            $str = str_replace(["\r\n", "\r"], "\n", $str);
        }

        return $str;
    }
575611
public function clean($value)
  {
    if ($value==='' || $value===null || $value===false)
    {
      return null;
    }

    $tmp = PruneWhitespaceCleaner::get()->clean($value);
    if ($tmp==='' || $tmp===null)
    {
      return null;
    }

    return mb_substr($tmp, 0, $this->maxLength);
  }
1030554
public function cleanOptions($options = [])
    {
        // If item is null or empty we will remove them.
        return collect($options)->reject(function ($item) {
            return empty($item) || is_null($item);
        })->all();
    }
1016607
public static function clean_vars($value){
        if(is_array($value)){
            foreach($value as $key => $val) {
                $value[$key] = self::clean_vars($val);
            }
        }
        else{
            $value= self::filter_simple_xss($value);
        }
        return $value;
    }
1006909
protected function _cleanCurrent() {
        if($this->_current) {
            $current = $this->_current;
            $this->_current = null;
            return $this->formatTemplate($current.'End', []);
        }
        return '';
    }
1012316
public function clean()
    {
        try {
            $result = [
                'result'        => isset($this->cacheInstance) && is_object($this->cacheInstance) ? $this->cacheInstance->clear() : FALSE,
                'commit'        => isset($this->cacheInstance) && is_object($this->cacheInstance) ? $this->cacheInstance->commit() : NULL,
                'getDriverName' => isset($this->cacheInstance) && is_object($this->cacheInstance) ? $this->cacheInstance->getDriverName() : NULL,
                'getStats'      => isset($this->cacheInstance) && is_object($this->cacheInstance) ? $this->cacheInstance->getStats() : NULL,
                'getConfig'     => isset($this->cacheInstance) && is_object($this->cacheInstance) ? $this->cacheInstance->getConfig() : NULL,
            ];
            $this->debug->debug(__FUNCTION__, 'Clear Cache from Handler: ' . json_encode($this->cacheHandle) . ' -> Result: ' . json_encode($result));

            return $result;
        }
        catch (\Exception $e) {
            $message = 'Error File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
            $this->debug->error(__FUNCTION__, $message);

            return $message;
        }
    }
238174
protected function _cleanupData(array $data = array())
    {
        $clean = array();

        foreach ($data as $key => $value)
        {
            if (!empty($value)) {
                $clean[$key] = $value;
            }
        }

        return $clean;
    }