Server : LiteSpeed
System : Linux premium152.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User : idesfsze ( 1473)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /home/idesfsze/pandaexpressketo.com/wp-content/plugins/jnews-split/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : /home/idesfsze/pandaexpressketo.com/wp-content/plugins/jnews-split/class.jnews-split-tree-node.php
<?php
/**
 * @author : Jegtheme
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class Tree Node
 */
class JNews_Split_Tree_Node {
	public $tag;
	public $start;
	public $end;

	/**
	 * @var array JNews_Split_Tree_Node
	 */
	public $child = array();
	public $parent;

	public static $self_closing = array(
		'area',
		'base',
		'br',
		'col',
		'command',
		'embed',
		'hr',
		'img',
		'input',
		'keygen',
		'link',
		'menuitem',
		'meta',
		'param',
		'source',
		'track',
		'wbr',
	);

	public function __construct( $tag = null, $start = null, $parent = null ) {
		$this->tag    = $tag;
		$this->start  = $start;
		$this->parent = $parent;
	}

	/**
	 * @param $tag
	 * @param $start
	 *
	 * @return JNews_Split_Tree_Node
	 */
	public function create_child( $tag, $start ) {
		$total                 = sizeof( $this->child );
		$this->child[ $total ] = new JNews_Split_Tree_Node( $tag, $start, $this );

		if ( in_array( $tag, self::$self_closing ) ) {
			$this->end = $this->calculate_end_tag( $start, $this->child[ $total ] );

			return $this;
		} else {
			return $this->child[ $total ];
		}
	}

	/**
	 * @param $begin
	 * @param JNews_Split_Tree_Node $child
	 *
	 * @return int
	 */
	public function calculate_end_tag( $begin, $child = null ) {
		if ( $child === null ) {
			$end = strpos( JNews_Split_Content_Tag::get_content(), '>', $begin );
		} else {
			$end = strpos( JNews_Split_Content_Tag::get_content(), '>', $begin );
		}

		return ++ $end;
	}

	/**
	 * @param $end
	 *
	 * @return JNews_Split_Tree_Node
	 */
	public function end_child( $end ) {
		$this->end = $this->calculate_end_tag( $end );

		return $this->parent;
	}
}

F1le Man4ger