aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Text.php
blob: f593f9dd66b74a3c32c1edfd8a0e8e5e7504b7ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

namespace Zotlabs\Lib;

class Text {

	/**
	 * use this on "body" or "content" input where angle chars shouldn't be removed,
	 * and allow them to be safely displayed.
	 *
	 * @param string $string
	 *
	 * @return string
	 */

	public static function escape_tags(string $string): string {
		if (!$string) {
			return EMPTY_STR;
		}

		return htmlspecialchars($string, ENT_COMPAT, 'UTF-8', false);
	}

}