403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.217.154
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /inetpub/wwwroot/icd/libraries/pattemplate/patTemplate/Modifier/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /inetpub/wwwroot/icd/libraries/pattemplate/patTemplate/Modifier/Truncate.php
<?php
/**
 * patTemplate modifier Truncate
 *
 * Truncate a string variable to fixed length and add a suffix if it was truncated.
 * It can also start from an offset and add a prefix.
 *
 * @package     patTemplate
 * @subpackage  Modifiers
 * @author      Rafa Couto <rafacouto@yahoo.com>
 */

// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();

/**
 * patTemplate modifier Truncate
 *
 * Truncate a string variable to fixed length and add a suffix if it was truncated.
 * It can also start from an offset and add a prefix.
 *
 * Possible attributes are:
 * - length (integer)
 * - suffix (string)
 * - start
 * - prefix (string)
 *
 * @package     patTemplate
 * @subpackage  Modifiers
 * @author      Rafa Couto <rafacouto@yahoo.com>
 */
class patTemplate_Modifier_Truncate extends patTemplate_Modifier
{

	/**
	* modify the value
	*
	* @access  public
	* @param  string    value
	* @return  string    modified value
	*/
	function modify($value, $params = array())
	{
		// length
		if (!isset( $params['length'])) {
			return $value;
		}
		settype($params['length'], 'integer');

    	$decode = isset( $params['htmlsafe'] );
   		if (function_exists( 'html_entity_decode' ) && $decode) {
	    	$value = html_entity_decode( $value );
    	}

        // start
		if (isset($params['start'])) {
			settype( $params['start'], 'integer' );
		} else {
			$params['start'] = 0;
		}

		// prefix
		if (isset($params['prefix'])) {
			$prefix = ($params['start'] == 0 ? '' : $params['prefix']);
		} else {
			$prefix = '';
		}

		// suffix
		if (isset($params['suffix'])) {
			$suffix = $params['suffix'];
		} else {
			$suffix = '';
		}

		$initial_len = strlen($value);
		$value = substr($value, $params['start'], $params['length']);

		if ($initial_len <= strlen($value)) {
			$suffix = '';
		}

        $value = $prefix.$value.$suffix;

        return $decode ? htmlspecialchars( $value, ENT_QUOTES ) : $value;
	}
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit