Trigger censoring.

@param string $content
@return string
13362
protected function _censor($content) {
        $pattern = implode('|', array_map(array($this, '_prepareRegex'), $this->getBlacklist()));
        $content = preg_replace_callback('/(?:^|\b)(?:' . $pattern . ')(?:\b|$)/is', array($this, '_censorCallback'), $content);

        return $content;
    }
1134326
private function clean($content)
    {
        // line feed
        $content = str_replace("\r\n", "\n", $content);
     
        // trailing whitespaces
        $content = preg_replace('/[ \t]*$/m', '', $content);

        // indentation
        $content = preg_replace_callback('/^([ \t]+)/m', function ($matches) use ($content) {
            return str_replace("\t", '    ', $matches[0]);
        }, $content);

        // Unused "use" statements
        preg_match_all('/^use (?P<class>[^\s;]+)(?:\s+as\s+(?P<alias>.*))?;/m', $content, $matches, PREG_SET_ORDER);
        foreach ($matches as $match) {
            if (isset($match['alias'])) {
                $short = $match['alias'];
            } else {
                $parts = explode('\\', $match['class']);
                $short = array_pop($parts);
            }

            preg_match_all('/\b'.$short.'\b/i', str_replace($match[0]."\n", '', $content), $m);
            if (!count($m[0])) {
                $content = str_replace($match[0]."\n", '', $content);
            }
        }

        // end of line
        if (strlen($content) && "\n" != substr($content, -1)) {
            $content = $content."\n";
        }

        return $content;
    }
1191257
protected function replacePath($content)
    {
        $path = is_null($this->urlGenerator) === false
            ? $this->urlGenerator->route(Arr::get($this->config, 'route.as').'bar')
            : null;

        return is_null($path) === false
            ? str_replace('?_tracy_bar', $path.'?_tracy_bar', $content)
            : $content;
    }
499507
function Censoring() {

    /**
     * The string to replaces found matches with. Defaults to ***
     *
     * @type {String}
     */
    this.replacementString = '***';

    /**
     * The color used for highlighting
     *
     * @type {string}
     */
    this.highlightColor = 'F2B8B8';

    /**
     * Holds the currently matched text.
     *
     * @type {{replace: string, hasMatches: boolean}}
     */
    this.currentMatch = {
      replace: '',
      hasMatches: false,
      matches: []
    };

    /**
     * The available patterns. These are as follows:
     *  [name]              [description]
     *  - long_number       ; Matches long, consecutive numbers
     *  - phone_number      ; Matches phone numbers.
     *  - email_address     ; Matches email addresses in many formats.
     *  - url               ; Matches URL patterns/
     *  - words             ; Finds words, even when in disguise.
     *
     * @type {{long_number: {pattern: RegExp, enabled: boolean}, phone_number: {pattern: RegExp, enabled: boolean}, email_address: {pattern: RegExp, enabled: boolean}, url: {pattern: RegExp, enabled: boolean}, words: {enabled: boolean, pattern: Array}}}
     */
    this.patterns = {
      long_number: {
        pattern: /\d{8,}/,
        enabled: false
      },
      phone_number: {
        pattern: /([+-]?[\d]{1,}[\d\s-]+|\([\d]+\))[-\d.\s]{8,}/gi,
        enabled: false
      },
      email_address: {
        pattern: /[\w._%+-]+(@|\[at\]|\(at\))[\w.-]+(\.|\[dot\]|\(dot\)|\(punt\)|\[punt\])[a-zA-Z]{2,4}/gi,
        enabled: false
      },
      url: {
        pattern: /((https?:\/{1,2})?([-\w]\.{0,1}){2,}(\.|\[dot\]|\(dot\)|\(punt\)|\[punt\])([a-zA-Z]{2}\.[a-zA-Z]{2,3}|[a-zA-Z]{2,4}).*?(?=$|[^\w\/-]))/gi,
        enabled: false
      },
      words: {
        pattern: [],
        enabled: false
      }
    };

    /**
     * A mapping that maps regular characters to 1337 characters.
     *
     * @type {{o: string, g: string, b: Array, t: string, s: string, a: string, e: string, z: string, i: string, l: string}}
     */
    this.map1337 = {
      o: '0',
      g: '9',
      b: ['8', '6'],
      t: '7',
      s: '5',
      a: '4',
      e: '3',
      z: '2',
      i: '1',
      l: '1'
    };
  }
1316060
public function generateSearchText($content)
    {
        $content = $this->_defaultData($content);
        $searchText = $this->_generateSearchText($content->selected, $content->price);
        return parent::generateSearchText($searchText);
    }
254833
public function parseNoTemplate($content) {
        $this->_content = $content;
        $this->_parseDebugStart();
        $this->_parseExtend();
        $this->_parseInclude();
        $this->_parsePath();
        $this->_parseGravatar();
        $this->_parseAsset();
        $this->_parseUrl();
        $this->_parsePhp();
        $this->_parseLang();
        $this->_parseForeach();
        $this->_parseFor();
        $this->_parseVar();
        $this->_parseVarFunc();
        $this->_parseCondition();
        $this->_parseFunction();
        $this->_parseException();
        $this->_parseMinify();
        $this->_parseDebugEnd();

        return $this->_content;
    }
550938
protected function notifyDanger($content) {
        $notification = NotificationFactory::newDangerNotification($content);
        return $this->notify(NotificationEvents::NOTIFICATION_DANGER, $notification);
    }
848704
public function limitChar($content, $limit = 100)
    {
        if (strlen($content) <= $limit) {
            return $content;
        } else {
            $hasil = substr($content, 0, $limit);
            return $hasil . "...";
        }
    }
749844
public static function getIndent($content)
    {
        $indent = self::DEFAULT_INDENT;
        preg_match(self::INDENT_REGEX, trim($content), $matches);

        if (!empty($matches)) {
            $indent = \strlen($matches[1]);
        }

        return $indent;
    }
239975
protected function sanitizeContent($content) {
    $regex = '/^\n' . preg_quote($this->blockStart, '/') . ".*?" . preg_quote($this->blockEnd, '/') . '\n/sm';
    return preg_replace($regex, '', $content);
  }
959930
public static function escapeAndMarkdown(?string $content): string
    {
        return $content ? C::getMarkdown()->text(Html::escape($content)) : (string) $content;
    }
1107722
protected function notifySuccess($content) {
        $notification = NotificationFactory::newSuccessNotification($content);
        return $this->notify(NotificationEvents::NOTIFICATION_SUCCESS, $notification);
    }
1280738
public function removeContent( ...$content ) {
		if ( is_array( $content[ 0 ] ) ) {
			$content = $content[ 0 ];
		}
		foreach ( $content as $item ) {
			if ( !is_string( $item ) ) {
				// Use strict type comparions so we don't
				// compare objects with existing strings
				$index = array_search( $item, $this->content, true );
				if ( $index !== false ) {
					array_splice( $this->content, $index, 1 );
				}
			}
		}
		return $this;
	}
890765
private function removeHeaders($content)
        {
            $content = str_replace('<?xml encoding="UTF-8">', "", $content);
            $content = str_replace('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">', "", $content);
            $content = str_replace('<html><body>', "", $content);
            $content = str_replace('</body></html>', "", $content);

            return $content;
        }
746028
public function processContent(string $content): string
    {
        $matches = Strings::matchAll($content, '#\[' . RegexPattern::PR_OR_ISSUE . '\]#m');
        foreach ($matches as $match) {
            $link = sprintf('[#%d]: %s/pull/%d', $match['id'], $this->repositoryUrl, $match['id']);
            $this->linkAppender->add($match['id'], $link);
        }

        return $content;
    }
1052761
protected function _get_permalink( $content ) {
		preg_match( '/<meta +?property=["\']og:url["\'][^\/>]*? content=["\']([^"\']+?)["\'].*?\/?>/si', $content, $reg );
		if ( ! empty( $reg[1] ) ) {
			return $reg[1];
		}

		return $this->url;
	}
1366128
private function detectMimeBySniffingContent(string $content): string
    {
        if (preg_match('/^\\{.*\\}$/is', $content)) {
            return 'application/json';
        }
        if (preg_match('/^([^=&])+=[^=&]+(&[^=&]+=[^=&]+)*$/', $content)) {
            return 'application/x-www-form-urlencoded';
        }
        if (preg_match('/^<.*>$/s', $content)) {
            return 'text/xml';
        }

        return 'application/octet-stream';
    }