ed tags to original * * @param string $string * @param array $tags */ public static function unprotectForm(&$string, $tags = []) { // Protect entire form if (empty($tags)) { self::unprotect($string); return; } self::unprotectTags($string, $tags); } /** * Replace any protected text to original * * @param string $string */ public static function unprotectHtmlSafe(&$string) { $string = str_replace( [ self::$html_safe_start, self::$html_safe_end, self::$html_safe_tags_start, self::$html_safe_tags_end, ], [ self::$protect_start, self::$protect_end, self::$protect_tags_start, self::$protect_tags_end, ], $string ); self::unprotect($string); } /** * Replace any protected tags to original * * @param string $string * @param array $unprotected * @param array $protected */ public static function unprotectInString(&$string, $unprotected = [], $protected = []) { $protected = ! empty($protected) ? $protected : self::protectArray($unprotected); $string = str_replace($protected, $unprotected, $string); } /** * Decode string * * @param string $string * @param int $is_tag * * @return string */ public static function unprotectString($string, $is_tag = false) { if ($is_tag) { return self::$protect_tags_start . base64_decode($string) . self::$protect_tags_end; } return self::$protect_start . base64_decode($string) . self::$protect_end; } /** * Replace any protected tags to original * * @param string $string * @param array $tags * @param bool $include_closing_tags */ public static function unprotectTags(&$string, $tags = [], $include_closing_tags = true) { [$tags, $protected] = self::prepareTags($tags, $include_closing_tags); $string = str_replace($protected, $tags, $string); } /** * Wraps a style or javascript declaration with comment tags * * @param string $content * @param string $name * @param string $type * @param bool $minify */ public static function wrapDeclaration($content = '', $name = '', $type = 'styles', $minify = true) { if (empty($name)) { return $content; } [$start, $end] = self::getInlineCommentTags($name, $type); $spacer = $minify ? ' ' : "\n"; return $start . $spacer . $content . $spacer . $end; } /** * Wrap string in comment tags * * @param string $name * @param string $comment * * @return string */ public static function wrapInCommentTags($name, $string) { [$start, $end] = self::getCommentTags($name); return $start . $string . $end; } /** * Wraps a javascript declaration with comment tags * * @param string $content * @param string $name * @param bool $minify */ public static function wrapScriptDeclaration($content = '', $name = '', $minify = true) { return self::wrapDeclaration($content, $name, 'scripts', $minify); } /** * Wraps a stylesheet declaration with comment tags * * @param string $content * @param string $name * @param bool $minify */ public static function wrapStyleDeclaration($content = '', $name = '', $minify = true) { return self::wrapDeclaration($content, $name, 'styles', $minify); } /** * Check if the string contains certain substrings to protect * * @param string $string * @param array $search_strings * * @return bool */ private static function containsStringsToProtect($string, $search_strings = []) { if ( empty($string) || ( strpos($string, 'exists()) { return $cache->get(); } foreach ($tags as $i => $tag) { if (StringHelper::is_alphanumeric($tag[0])) { $tag = '{' . $tag; } $tags[$i] = $tag; if ($include_closing_tags) { $tags[] = RegEx::replace('^([^a-z0-9]+)', '\1/', $tag); } } return $cache->set([$tags, self::protectArray($tags, 1)]); } /** * Protect the input fields in the string * * @param string $string */ private static function protectFieldsInputFields(&$string) { if (strpos($string, '' . '|' . ')\s*)+' ); } /** * Protect the fields in the string * * @param string $string */ private static function protectFieldsPart(&$string) { self::protectFieldsTextAreas($string); self::protectFieldsInputFields($string); } /** * Protect the textarea fields in the string * * @param string $string */ private static function protectFieldsTextAreas(&$string) { if (strpos($string, ']*)?)>(\s*)', '<' . $temp_tag . '\1>\2', $string ); self::protectByRegex( $string, '(?:' . '' . '\s*)+' ); // Replace back the temporarily replaced empty textareas $string = str_replace($temp_tag, 'textarea', $string); } /** * Protect part of the AdminForm * * @param string $string * @param array $tags * @param array $protected_tags */ private static function protectFormPart(&$string, $tags = [], $protected_tags = []) { if (strpos($string, '') === false) { return; } // Protect entire form if (empty($tags)) { $form_parts = explode('', $string, 2); $form_parts[0] = self::protectString($form_parts[0] . ''); $string = implode('', $form_parts); return; } $regex_tags = RegEx::quote($tags); if ( ! RegEx::match($regex_tags, $string)) { return; } $form_parts = explode('', $string, 2); // protect tags only inside form fields RegEx::matchAll( '(?:]*>.*?<\/textarea>|]*>)', $form_parts[0], $matches, null, PREG_PATTERN_ORDER ); if (empty($matches)) { return; } $matches = array_unique($matches[0]); foreach ($matches as $match) { $field = str_replace($tags, $protected_tags, $match); $form_parts[0] = str_replace($match, $field, $form_parts[0]); } $string = implode('', $form_parts); } /** * @param string $string * @param array $delimiters */ private static function unprotectByDelimiters(&$string, $delimiters) { if ( ! StringHelper::contains($string, $delimiters)) { return; } $regex = RegEx::preparePattern(RegEx::quote($delimiters), 's', $string); $parts = preg_split($regex, $string); foreach ($parts as $i => &$part) { if ($i % 2 == 0) { continue; } $part = base64_decode($part); } $string = implode('', $parts); } } 0 - Class 'RegularLabs\Library\Protect' not found
0 - Class 'RegularLabs\Library\Protect' not found

You may not be able to visit this page because of:

  1. an out-of-date bookmark/favourite
  2. a search engine that has an out-of-date listing for this site
  3. a mistyped address
  4. you have no access to this page
  5. The requested resource was not found.
  6. An error has occurred while processing your request.

Please try one of the following pages:

If difficulties persist, please contact the System Administrator of this site and report the error below.

Class 'RegularLabs\Library\Protect' not found