�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`� 0x0x
PHP 8.1.34
Preview: html-to-markdown.php Size: 13.68 KB
/home2/astrociv/public_html/wp-content/plugins/elementor/modules/markdown-render/html-to-markdown.php
<?php
namespace Elementor\Modules\MarkdownRender;

use WP_HTML_Processor;

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

class Html_To_Markdown {

	const SAFE_URL_SCHEMES = [ 'http', 'https', 'mailto', 'tel', 'ftp', 'ftps' ];

	const SAFE_DATA_PREFIXES = [ 'data:image/png', 'data:image/jpeg', 'data:image/jpg', 'data:image/gif', 'data:image/webp', 'data:image/svg+xml' ];

	const ESCAPABLE_MARKDOWN_CHARS = [ '\\', '`', '*', '_', '[', ']' ];

	const VOID_TAGS = [ 'br', 'hr', 'img', 'input', 'meta', 'link', 'area', 'base', 'col', 'embed', 'param', 'source', 'track', 'wbr' ];

	private $output = '';

	private $inline_buffer = '';

	private $list_stack = [];

	private $blockquote_depth = 0;

	private $in_pre = false;

	private $pre_buffer = '';

	private $pre_language = '';

	private $in_code = false;

	private $in_link = false;

	private $link_href = '';

	private $link_buffer = '';

	private $in_table = false;

	private $table_headers = [];

	private $table_rows = [];

	private $current_row = [];

	private $current_cell = '';

	private $in_table_head = false;

	private $row_is_header = false;

	private $heading_level = 0;

	public static function convert( string $html ): string {
		if ( '' === $html ) {
			return '';
		}

		$instance = new self();

		return $instance->run( $html );
	}

	private function run( string $html ): string {
		$html = $this->normalize_html( $html );

		$processor = WP_HTML_Processor::create_full_parser( $html );

		if ( null === $processor ) {
			return $this->fallback( $html );
		}

		try {
			$this->walk( $processor );
		} catch ( \Exception $e ) {
			return $this->fallback( $html );
		}

		$this->flush_inline();

		$output = $this->output;
		$output = preg_replace( "/[ \t]+\n/", "\n", $output );
		$output = preg_replace( "/\n{3,}/", "\n\n", $output );

		return trim( $output );
	}

	private function fallback( string $html ): string {
		$text = wp_strip_all_tags( $html );
		$text = html_entity_decode( $text, ENT_QUOTES, 'UTF-8' );

		return trim( preg_replace( "/\n{3,}/", "\n\n", $text ) );
	}

	private function normalize_html( string $html ): string {
		$html = preg_replace( '/\r\n?/', "\n", $html );
		$html = preg_replace( '#<script\b[^>]*>.*?</script>#is', '', $html );
		$html = preg_replace( '#<style\b[^>]*>.*?</style>#is', '', $html );
		$html = str_replace( "\xE2\x80\x8B", '', $html );

		return $html;
	}

	private function walk( WP_HTML_Processor $p ): void {
		while ( $p->next_token() ) {
			$type = $p->get_token_type();

			if ( '#text' === $type ) {
				$this->handle_text( $p->get_modifiable_text() );
				continue;
			}

			if ( '#tag' !== $type ) {
				continue;
			}

			$tag = strtolower( (string) $p->get_tag() );
			$is_closer = $p->is_tag_closer();
			$is_void = in_array( $tag, self::VOID_TAGS, true );

			if ( $is_closer ) {
				$this->handle_close( $tag );
				continue;
			}

			$this->handle_open( $tag, $p );

			if ( $is_void ) {
				$this->handle_close( $tag );
			}
		}
	}

	private function handle_text( string $text ): void {
		if ( '' === $text ) {
			return;
		}

		if ( $this->in_pre ) {
			$this->pre_buffer .= $text;
			return;
		}

		if ( $this->in_table ) {
			$this->current_cell .= $this->escape_text( $text, false );
			return;
		}

		$collapsed = preg_replace( '/[ \t\n]+/', ' ', $text );
		$escaped = $this->escape_text( $collapsed, $this->in_code );

		if ( $this->in_link ) {
			$this->link_buffer .= $escaped;
			return;
		}

		$this->inline_buffer .= $escaped;
	}

	private function handle_open( string $tag, WP_HTML_Processor $p ): void {
		switch ( $tag ) {
			case 'p':
			case 'div':
			case 'section':
			case 'article':
			case 'header':
			case 'footer':
			case 'main':
			case 'aside':
			case 'figure':
				$this->flush_inline();
				return;

			case 'h1':
			case 'h2':
			case 'h3':
			case 'h4':
			case 'h5':
			case 'h6':
				$this->flush_inline();
				$this->heading_level = (int) $tag[1];
				$this->inline_buffer = str_repeat( '#', $this->heading_level ) . ' ';
				return;

			case 'br':
				if ( $this->in_table ) {
					$this->current_cell .= ' ';
					return;
				}
				if ( $this->heading_level > 0 ) {
					$this->inline_buffer .= ' ';
					return;
				}
				$this->inline_buffer .= "\n";
				return;

			case 'hr':
				$this->flush_inline();
				$this->output .= "\n\n---\n\n";
				return;

			case 'strong':
			case 'b':
				$this->append_inline( '**' );
				return;

			case 'em':
			case 'i':
				$this->append_inline( '*' );
				return;

			case 'del':
			case 's':
			case 'strike':
				$this->append_inline( '~~' );
				return;

			case 'code':
				if ( $this->in_pre ) {
					$lang = (string) $p->get_attribute( 'class' );
					if ( preg_match( '/language-([A-Za-z0-9_+\-]+)/', $lang, $m ) ) {
						$this->pre_language = $m[1];
					}
					return;
				}
				$this->in_code = true;
				$this->append_inline( '`CODE_OPEN`' );
				return;

			case 'pre':
				$this->flush_inline();
				$this->in_pre = true;
				$this->pre_buffer = '';
				$this->pre_language = '';
				return;

			case 'a':
				$href = (string) $p->get_attribute( 'href' );
				$this->in_link = true;
				$this->link_href = $href;
				$this->link_buffer = '';
				return;

			case 'img':
				$this->emit_image( $p );
				return;

			case 'ul':
			case 'ol':
				if ( ! empty( $this->list_stack ) && '' !== trim( $this->inline_buffer ) ) {
					$this->emit_list_item();
				} else {
					$this->flush_inline();
				}
				$this->list_stack[] = [
					'type' => $tag,
					'index' => 1,
				];
				return;

			case 'li':
				$this->flush_inline();
				return;

			case 'blockquote':
				$this->flush_inline();
				$this->blockquote_depth++;
				return;

			case 'table':
				$this->flush_inline();
				$this->in_table = true;
				$this->table_headers = [];
				$this->table_rows = [];
				return;

			case 'thead':
				$this->in_table_head = true;
				return;

			case 'tr':
				if ( ! $this->in_table ) {
					return;
				}
				$this->current_row = [];
				$this->row_is_header = $this->in_table_head;
				return;

			case 'th':
				$this->row_is_header = true;
				$this->current_cell = '';
				return;

			case 'td':
				$this->current_cell = '';
				return;
		}
	}

	private function handle_close( string $tag ): void {
		switch ( $tag ) {
			case 'p':
			case 'div':
			case 'section':
			case 'article':
			case 'header':
			case 'footer':
			case 'main':
			case 'aside':
			case 'figure':
				$this->flush_inline();
				return;

			case 'h1':
			case 'h2':
			case 'h3':
			case 'h4':
			case 'h5':
			case 'h6':
				$this->inline_buffer = preg_replace( '/[ \t]+/', ' ', $this->inline_buffer );
				$this->flush_inline();
				$this->heading_level = 0;
				return;

			case 'strong':
			case 'b':
				$this->append_inline( '**' );
				return;

			case 'em':
			case 'i':
				$this->append_inline( '*' );
				return;

			case 'del':
			case 's':
			case 'strike':
				$this->append_inline( '~~' );
				return;

			case 'code':
				if ( $this->in_pre ) {
					return;
				}
				$this->append_inline( '`CODE_CLOSE`' );
				$this->in_code = false;
				return;

			case 'pre':
				$this->emit_pre();
				$this->in_pre = false;
				$this->pre_buffer = '';
				$this->pre_language = '';
				return;

			case 'a':
				$this->emit_link();
				$this->in_link = false;
				$this->link_href = '';
				$this->link_buffer = '';
				return;

			case 'ul':
			case 'ol':
				$this->flush_inline();
				array_pop( $this->list_stack );
				if ( empty( $this->list_stack ) ) {
					$this->output .= "\n\n";
				}
				return;

			case 'li':
				$this->emit_list_item();
				return;

			case 'blockquote':
				$this->flush_inline();
				$this->blockquote_depth = max( 0, $this->blockquote_depth - 1 );
				if ( 0 === $this->blockquote_depth ) {
					$this->output .= "\n";
				}
				return;

			case 'table':
				$this->emit_table();
				$this->in_table = false;
				$this->table_headers = [];
				$this->table_rows = [];
				return;

			case 'thead':
				$this->in_table_head = false;
				return;

			case 'tr':
				if ( ! $this->in_table ) {
					return;
				}
				if ( $this->row_is_header && empty( $this->table_headers ) ) {
					$this->table_headers = $this->current_row;
				} else {
					$this->table_rows[] = $this->current_row;
				}
				$this->current_row = [];
				$this->row_is_header = false;
				return;

			case 'th':
			case 'td':
				$this->current_row[] = trim( preg_replace( '/\s+/', ' ', $this->current_cell ) );
				$this->current_cell = '';
				return;
		}
	}

	private function append_inline( string $marker ): void {
		if ( $this->in_link ) {
			$this->link_buffer .= $marker;
			return;
		}

		$this->inline_buffer .= $marker;
	}

	private function emit_link(): void {
		$text = $this->link_buffer;
		$href = $this->link_href;

		if ( '' === $href || '#' === $href ) {
			$this->inline_buffer .= $text;
			return;
		}

		if ( ! $this->is_safe_url( $href ) ) {
			$this->inline_buffer .= $text;
			return;
		}

		$href = $this->escape_url_for_markdown( $href );

		$this->inline_buffer .= '[' . $text . '](' . $href . ')';
	}

	private function emit_image( WP_HTML_Processor $p ): void {
		$src = (string) $p->get_attribute( 'src' );
		$alt = (string) $p->get_attribute( 'alt' );

		if ( '' === $src ) {
			return;
		}

		if ( ! $this->is_safe_url( $src ) ) {
			return;
		}

		$alt = $this->escape_text( $alt, false );
		$src = $this->escape_url_for_markdown( $src );

		$this->inline_buffer .= '![' . $alt . '](' . $src . ')';
	}

	private function emit_pre(): void {
		$content = html_entity_decode( $this->pre_buffer, ENT_QUOTES, 'UTF-8' );
		$content = rtrim( $content, "\n" );

		$this->output .= "\n\n```" . $this->pre_language . "\n" . $content . "\n```\n\n";
	}

	private function emit_list_item(): void {
		$content = trim( $this->inline_buffer );
		$this->inline_buffer = '';

		if ( '' === $content ) {
			return;
		}

		$top = end( $this->list_stack );

		if ( false === $top ) {
			$this->output .= $content . "\n";
			return;
		}

		$depth = count( $this->list_stack ) - 1;
		$indent = str_repeat( '  ', $depth );

		if ( 'ol' === $top['type'] ) {
			$marker = $top['index'] . '. ';
			$this->list_stack[ array_key_last( $this->list_stack ) ]['index']++;
		} else {
			$marker = '- ';
		}

		$lines = explode( "\n", $content );
		$first = array_shift( $lines );
		$rendered = $indent . $marker . $first;

		foreach ( $lines as $line ) {
			$rendered .= "\n" . $indent . '  ' . $line;
		}

		$this->output .= $this->prefix_blockquote( $rendered ) . "\n";
	}

	private function emit_table(): void {
		if ( empty( $this->table_headers ) && empty( $this->table_rows ) ) {
			return;
		}

		if ( empty( $this->table_headers ) && ! empty( $this->table_rows ) ) {
			$this->table_headers = array_fill( 0, count( $this->table_rows[0] ), '' );
		}

		$column_count = count( $this->table_headers );
		$lines = [];
		$lines[] = '| ' . implode( ' | ', array_map( [ $this, 'escape_table_cell' ], $this->table_headers ) ) . ' |';
		$lines[] = '|' . str_repeat( ' --- |', $column_count );

		foreach ( $this->table_rows as $row ) {
			$row = array_pad( $row, $column_count, '' );
			$row = array_slice( $row, 0, $column_count );
			$lines[] = '| ' . implode( ' | ', array_map( [ $this, 'escape_table_cell' ], $row ) ) . ' |';
		}

		$this->output .= "\n\n" . implode( "\n", $lines ) . "\n\n";
	}

	private function escape_table_cell( string $value ): string {
		return str_replace( [ '|', "\n" ], [ '\\|', ' ' ], $value );
	}

	private function flush_inline(): void {
		if ( '' === $this->inline_buffer ) {
			return;
		}

		$content = $this->finalize_inline( $this->inline_buffer );
		$this->inline_buffer = '';

		$content = trim( $content );

		if ( '' === $content ) {
			return;
		}

		if ( ! empty( $this->list_stack ) ) {
			$this->inline_buffer = $content;
			return;
		}

		$content = $this->prefix_blockquote( $content );

		$this->output .= "\n\n" . $content . "\n\n";
	}

	private function finalize_inline( string $buffer ): string {
		return preg_replace_callback(
			'/`CODE_OPEN`(.*?)`CODE_CLOSE`/s',
			function ( $matches ) {
				return $this->render_inline_code( $matches[1] );
			},
			$buffer
		);
	}

	private function render_inline_code( string $content ): string {
		$content = preg_replace( '/\s+/', ' ', $content );

		preg_match_all( '/`+/', $content, $runs );
		$max = 0;

		foreach ( $runs[0] as $run ) {
			$max = max( $max, strlen( $run ) );
		}

		$fence = str_repeat( '`', $max + 1 );
		$pad = ( '' !== $content && ( '`' === $content[0] || '`' === substr( $content, -1 ) ) ) ? ' ' : '';

		return $fence . $pad . $content . $pad . $fence;
	}

	private function prefix_blockquote( string $content ): string {
		if ( 0 === $this->blockquote_depth ) {
			return $content;
		}

		$prefix = str_repeat( '> ', $this->blockquote_depth );
		$lines = explode( "\n", $content );

		return implode( "\n", array_map(
			function ( $line ) use ( $prefix ) {
				return $prefix . $line;
			},
			$lines
		) );
	}

	private function escape_text( string $text, bool $in_code ): string {
		$text = html_entity_decode( $text, ENT_QUOTES, 'UTF-8' );

		if ( $in_code ) {
			return $text;
		}

		$replacements = [];

		foreach ( self::ESCAPABLE_MARKDOWN_CHARS as $char ) {
			$replacements[ $char ] = '\\' . $char;
		}

		return strtr( $text, $replacements );
	}

	private function escape_url_for_markdown( string $url ): string {
		return strtr( $url, [
			' ' => '%20',
			'(' => '%28',
			')' => '%29',
			'<' => '%3C',
			'>' => '%3E',
		] );
	}

	private function is_safe_url( string $url ): bool {
		$url = trim( $url );

		if ( '' === $url ) {
			return false;
		}

		if ( '#' === $url[0] || '/' === $url[0] || '?' === $url[0] ) {
			return true;
		}

		$lower = strtolower( $url );

		foreach ( self::SAFE_DATA_PREFIXES as $prefix ) {
			if ( 0 === strpos( $lower, $prefix ) ) {
				return true;
			}
		}

		if ( ! preg_match( '#^([a-z][a-z0-9+.\-]*):#i', $url, $m ) ) {
			return true;
		}

		return in_array( strtolower( $m[1] ), self::SAFE_URL_SCHEMES, true );
	}
}

Directory Contents

Dirs: 0 × Files: 3
Name Size Perms Modified Actions
13.68 KB lrwxr-xr-x 2026-09-08 12:13:51
Edit Download
2.83 KB lrwxr-xr-x 2026-09-08 12:13:51
Edit Download
5.84 KB lrwxr-xr-x 2026-09-08 12:13:51
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 0xNothings — Secure File Manager. All rights reserved. Built with ❤️ & Tailwind x Dark UI