ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: /home/niphet/public_html/wp-content/plugins/deepseek/src/Markdown.php
<?php

namespace AiBuddy;

use Parsedown;

class Markdown {

	private Parsedown $parsedown;
    private Options $options;

    public function __construct( Parsedown $parsedown, Options $options) {
		$this->parsedown = $parsedown;
        $this->options = $options;
	}

	public function to_html( string $text ): string {
		if($this->should_format()) {
            $text = $this->cleanup_sources($text);
            return $this->parsedown->text( $text );
        }

        return $text;
	}

    public function should_format(): bool {
        return $this->options->get( 'chatbot.formatting', false );
    }

    public function cleanup_sources( string $text ): string {
        $re = '/【.*?】/mu';

        return preg_replace( $re, '', $text );
    }
}