uawdijnntqw1x1x1
IP : 216.73.216.84
Hostname : webm003.cluster107.gra.hosting.ovh.net
Kernel : Linux webm003.cluster107.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
OS : Linux
PATH:
/
home
/
opticamezl
/
.
/
www
/
newok
/
assets
/
..
/
layouts
/
..
/
logs
/
..
/
plugins
/
system
/
rereplacer
/
src
/
Tag.php
/
/
<?php /** * @package ReReplacer * @version 14.4.1 * * @author Peter van Westen <info@regularlabs.com> * @link https://regularlabs.com * @copyright Copyright © 2025 Regular Labs All Rights Reserved * @license GNU General Public License version 2 or later */ namespace RegularLabs\Plugin\System\ReReplacer; defined('_JEXEC') or die; use RegularLabs\Library\Document as RL_Document; use RegularLabs\Library\RegEx as RL_RegEx; class Tag { public static function getAreaByType(&$string, $area_type = '') { if ( ! $string || ! $area_type) { return []; } self::tagAreaByType($string, $area_type); $start = '<!-- START: RR_' . strtoupper($area_type) . ' -->'; $end = '<!-- END: RR_' . strtoupper($area_type) . ' -->'; $matches = explode($start, $string); array_shift($matches); foreach ($matches as $i => $match) { $orig = $start . $match; $text = $match; if (str_contains($text, $end)) { $text = substr($text, 0, strrpos($text, $end)); $orig = $start . $text . $end; } $matches[$i] = [$orig, $text]; } return $matches; } public static function tagArea(&$string, $area_type = '') { if ( ! $string || ! $area_type) { return false; } $start = '<!-- START: RR_' . strtoupper($area_type) . ' -->'; $end = '<!-- END: RR_' . strtoupper($area_type) . ' -->'; $string = $start . $string . $end; if ($area_type == 'article_text') { $string = RL_RegEx::replace('(<hr class="system-pagebreak".*?>)', $end . '\1' . $start, $string); } return true; } private static function tagAreaByType(&$string, $area_type) { switch ($area_type) { case 'component': self::tagComponent($string); break; case 'body': self::tagBody($string); break; case 'head': self::tagHead($string); break; default: break; } } private static function tagBody(&$string) { if ( ! $string) { return; } $start = '<!-- START: RR_BODY -->'; if (str_contains($string, $start)) { return; } if (str_contains($string, '<body') && str_contains($string, '</body>')) { self::tagByTagType($string, 'body', 'body'); return; } if (str_contains($string, '<item') && str_contains($string, '</item>')) { self::tagByTagType($string, 'item', 'body'); return; } self::tagArea($string, 'body'); } private static function tagByTagType(&$string, $tag, $area_type) { if ( ! $string) { return; } $start = '<!-- START: RR_' . strtoupper($area_type) . ' -->'; $end = '<!-- END: RR_' . strtoupper($area_type) . ' -->'; $string = RL_RegEx::replace('(<' . $tag . '(\s[^>]*)?>)', '\1' . $start, $string); $string = str_replace('</' . $tag . '>', $end . '</' . $tag . '>', $string); } private static function tagComponent(&$string) { if ( ! $string) { return; } $start = '<!-- START: RR_COMPONENT -->'; if (RL_Document::isFeed()) { self::tagByTagType($string, 'item', 'component'); } if ( ! str_contains($string, $start)) { self::tagArea($string, 'component'); } } private static function tagHead(&$string) { if ( ! $string) { return; } if ( ! str_contains($string, '</head>')) { return; } self::tagByTagType($string, 'head', 'head'); } }
/home/opticamezl/./www/newok/assets/../layouts/../logs/../plugins/system/rereplacer/src/Tag.php