| 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/plugins/system/nnframework/helpers/assignments/ |
Upload File : |
<?php
/**
* NoNumber! Framework Helper File: Assignments: Browsers
*
* @package NoNumber! Framework
* @version 11.9.1
*
* @author Peter van Westen <peter@nonumber.nl>
* @link http://www.nonumber.nl
* @copyright Copyright © 2011 NoNumber! All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
// No direct access
defined( '_JEXEC' ) or die();
/**
* Assignments: Browsers
*/
class NNFrameworkAssignmentsBrowsers
{
var $_version = '11.9.1';
/**
* passBrowsers
* @param <object> $params
* @param <array> $selection
* @param <string> $assignment
* @return <bool>
*/
function passBrowsers( &$main, &$params, $selection = array(), $assignment = 'all' )
{
$pass = 0;
$selection = $main->makeArray( $selection );
if ( !empty( $selection ) ) {
jimport( 'joomla.environment.browser' );
$browser =& JBrowser::getInstance();
$b = $browser->getAgentString();
if ( !( strpos( $b, 'Chrome' ) === false ) ) {
$b = preg_replace( '#(Chrome/.*)Safari/[0-9\.]*#s', '\1', $b );
} else if ( !( strpos( $b, 'Opera' ) === false ) ) {
$b = preg_replace( '#(Opera/.*)Version/#s', '\1Opera/', $b );
}
foreach ( $selection as $sel ) {
if ( $sel && !( strpos( $b, $sel ) === false ) ) {
$pass = 1;
break;
}
}
}
if ( $pass ) {
return ( $assignment == 'include' );
} else {
return ( $assignment == 'exclude' );
}
}
}