zm_reg.patch

Patch for ereg/split - bobmyth, 08/01/2011 07:57 pm

Download (7.8 kB)

 
zm/zm_actions.php 2011-04-19 07:53:03.000000000 -0700
850 850
                if ( @socket_connect( $socket, $sock_file ) )
851 851
                {
852 852
                    $options = array();
853
                    foreach ( split( " ", $ctrl_command ) as $option )
853
                    foreach ( preg_split( "/ /", $ctrl_command ) as $option )
854 854
                    {
855 855
                        if ( preg_match( '/--([^=]+)(?:=(.+))?/', $option, $matches ) )
856 856
                        {
......
879 879
		{
880 880
			$zmu_command = getZmuCommand( " -m $mid -B$new_brightness -C$new_contrast -H$new_hue -O$new_colour" );
881 881
			$zmu_output = exec( escapeshellcmd( $zmu_command ) );
882
			list( $brightness, $contrast, $hue, $colour ) = split( ' ', $zmu_output );
882
			list( $brightness, $contrast, $hue, $colour ) = preg_split( '/ /', $zmu_output );
883 883
            dbQuery( "update Monitors set Brightness = '$brightness', Contrast = '$contrast', Hue = '$hue', Colour = '$colour' where Id = '$mid'" );
884 884
		}
885 885
	}
zm/zm_funcs.php 2011-04-19 07:51:14.000000000 -0700
438 438
{
439 439
	global $user;
440 440

  
441
	return( empty($user['MonitorIds']) || in_array( $mid, split( ',', $user['MonitorIds'] ) ) );
441
	return( empty($user['MonitorIds']) || in_array( $mid, preg_split( '/,/', $user['MonitorIds'] ) ) );
442 442
}
443 443

  
444 444
function canView( $area, $mid=false )
......
700 700
		global $_SERVER;
701 701
	}
702 702

  
703
	if (ereg( 'MSIE ([0-9].[0-9]{1,2})',$_SERVER['HTTP_USER_AGENT'],$log_version))
703
	if (preg_match( '/MSIE ([0-9].[0-9]{1,2})/',$_SERVER['HTTP_USER_AGENT'],$log_version))
704 704
	{
705 705
		$version = $log_version[1];
706 706
		$browser = 'ie';
707 707
	}
708
	elseif (ereg( 'Safari/([0-9.]+)',$_SERVER['HTTP_USER_AGENT'],$log_version))
708
	elseif (preg_match( '!Safari/([0-9.]+)!',$_SERVER['HTTP_USER_AGENT'],$log_version))
709 709
	{
710 710
		$version = $log_version[1];
711 711
		$browser = 'safari';
712 712
	}
713
        elseif (ereg( 'Konqueror/([0-9.]+)',$_SERVER['HTTP_USER_AGENT'],$log_version))
713
        elseif (preg_match( '!Konqueror/([0-9.]+)!',$_SERVER['HTTP_USER_AGENT'],$log_version))
714 714
        {
715 715
                $version = $log_version[1];
716 716
                $browser = 'konqueror';
717 717
        }
718
	elseif (ereg( 'Opera ([0-9].[0-9]{1,2})',$_SERVER['HTTP_USER_AGENT'],$log_version))
718
	elseif (preg_match( '/Opera ([0-9].[0-9]{1,2})/',$_SERVER['HTTP_USER_AGENT'],$log_version))
719 719
	{
720 720
		$version = $log_version[1];
721 721
		$browser = 'opera';
722 722
	}
723
	elseif (ereg( 'Mozilla/([0-9].[0-9]{1,2})',$_SERVER['HTTP_USER_AGENT'],$log_version))
723
	elseif (preg_match( '!Mozilla/([0-9].[0-9]{1,2})!',$_SERVER['HTTP_USER_AGENT'],$log_version))
724 724
	{
725 725
		$version = $log_version[1];
726 726
		$browser = 'mozilla';
......
1416 1416
{
1417 1417
	if ( SID )
1418 1418
	{
1419
		list( $sessname, $sessid ) = split( "=", SID );
1419
		list( $sessname, $sessid ) = preg_split("/=/", SID );
1420 1420
?>
1421 1421
<input type="hidden" name="<?= $sessname ?>" value="<?= $sessid ?>"/>
1422 1422
<?php
......
1883 1883

  
1884 1884
            $x10_output = exec( escapeshellcmd( $command ) );
1885 1885
        }
1886
        foreach ( split( "\n", $x10_output ) as $x10_response )
1886
        foreach ( preg_split( "/\n/", $x10_output ) as $x10_response )
1887 1887
        {
1888 1888
            if ( preg_match( "/^(\d+)\s+(.+)$/", $x10_response, $matches ) )
1889 1889
            {
zm/zm_html_view_monitor.php 2011-04-19 07:53:41.000000000 -0700
102 102
if ( !isset( $new_monitor ) )
103 103
{
104 104
	$new_monitor = $monitor;
105
	$new_monitor['Triggers'] = split( ',', isset($monitor['Triggers'])?$monitor['Triggers']:"" );
105
	$new_monitor['Triggers'] = preg_split( '/,/', isset($monitor['Triggers'])?$monitor['Triggers']:"" );
106 106
	$new_x10_monitor = isset($x10_monitor)?$x10_monitor:array();
107 107
}
108 108
if ( !empty($preset) )
zm/zm_html_view_montagestatus.php 2011-04-19 07:54:03.000000000 -0700
26 26

  
27 27
$zmu_command = getZmuCommand( " -m $mid -s -f" );
28 28
$zmu_output = exec( escapeshellcmd( $zmu_command ) );
29
list( $status, $fps ) = split( ' ', $zmu_output );
29
list( $status, $fps ) = preg_split( '/ /', $zmu_output );
30 30
$status_string = $zmSlangUnknown;
31 31
$fps_string = "--.--";
32 32
$class = "text";
zm/zm_html_view_options.php 2011-04-19 07:54:31.000000000 -0700
241 241
?>
242 242
<td align="left" class="text"><nobr>
243 243
<?php
244
			$options = split( "\|", $value['Hint'] );
244
			$options = preg_split( "/\|/", $value['Hint'] );
245 245
			if ( count( $options ) > 3 )
246 246
			{
247 247
?>
zm/zm_html_view_settings.php 2011-04-19 07:56:01.000000000 -0700
27 27

  
28 28
$zmu_command = getZmuCommand( " -m $mid -B -C -H -O" );
29 29
$zmu_output = exec( escapeshellcmd( $zmu_command ) );
30
list( $brightness, $contrast, $hue, $colour ) = split( ' ', $zmu_output );
30
list( $brightness, $contrast, $hue, $colour ) = preg_split( '/ /', $zmu_output );
31 31

  
32 32
$monitor['Brightness'] = $brightness;
33 33
$monitor['Contrast'] = $contrast;
zm/zm_html_view_watchstatus.php 2011-04-19 07:54:48.000000000 -0700
38 38
}
39 39

  
40 40
$zmu_output = exec( escapeshellcmd( $zmu_command ) );
41
list( $status, $fps ) = split( ' ', $zmu_output );
41
list( $status, $fps ) = preg_split( '/ /', $zmu_output );
42 42
$status_string = $zmSlangUnknown;
43 43
$fps_string = "--.--";
44 44
$class = "text";
zm/zm_request_control.php 2011-04-19 07:55:13.000000000 -0700
985 985
    if ( @socket_connect( $socket, $sock_file ) )
986 986
    {
987 987
        $options = array();
988
        foreach ( split( " ", $ctrl_command ) as $option )
988
        foreach ( preg_split( "/ /", $ctrl_command ) as $option )
989 989
        {
990 990
            if ( preg_match( '/--([^=]+)(?:=(.+))?/', $option, $matches ) )
991 991
            {
zm/zm_xhtml_view_montage.php 2011-04-19 07:55:28.000000000 -0700
33 33
	{
34 34
		continue;
35 35
	}
36
    if ( $group && $group['MonitorIds'] && !in_array( $row['Id'], split( ',', $group['MonitorIds'] ) ) )
36
    if ( $group && $group['MonitorIds'] && !in_array( $row['Id'], preg_split( '/,/', $group['MonitorIds'] ) ) )
37 37
	{
38 38
		continue;
39 39
	}
zm/zm_xhtml_view_watch.php 2011-04-19 07:55:42.000000000 -0700
28 28

  
29 29
$zmu_command = getZmuCommand( " -m $mid -s -f" );
30 30
$zmu_output = exec( escapeshellcmd( $zmu_command ) );
31
list( $status, $fps ) = split( ' ', $zmu_output );
31
list( $status, $fps ) = preg_split( '/ /', $zmu_output );
32 32
$status_string = $zmSlangUnknown;
33 33
$fps_string = "--.--";
34 34
$class = "text";