HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/RDamen/damenbeletteringen.nl/wwwroot/admin/system/cms/helpers/plugin_helper.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * Plugin Helpers
 *
 * @author   PyroCMS Dev Team
 * @package  PyroCMS\Core\Helpers
 */

/**
 * Converts {{ }} to proper entities to prevent parsing
 * 
 * @param string $string
 * @return string
 */
if ( ! function_exists('no_parse') ) {
	function no_parse($string = '') {
		return str_replace(array('{{','}}'), array('&#123;&#123;','&#125;&#125;'), $string);
	}
}


/**
 * Converts various string bools to a true bool
 * 
 * @param string $value
 * @param bool   $strict  Value has to match a truthy string
 * @return bool
 */
if ( ! function_exists('str_to_bool') ) {
	function str_to_bool($value = '', $strict = false) {
		if ( is_bool($value) ) {
			return $value;
		}
		elseif ( in_array(strtolower($value), array('no', 'n', 'false', '0')) ) {
			$bool = false;
		}
		elseif ($strict) {
			$bool = in_array(strtolower($value), array('yes', 'y', 'true', '1'));
		}
		else {
			$bool = true;
		}
		return $bool;
	}
}

/* EOF */