Bug 32 & 64: Added version comparison function and append full hostname to stream sources.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1450 e3e1d417-86f3-4887-817a-d78f3d33393f
pull/27/merge
stan 2005-06-12 16:52:03 +00:00
parent be97ba2911
commit 64b3b45cc7
1 changed files with 24 additions and 2 deletions

View File

@ -105,10 +105,10 @@ function getStreamSrc( $args )
{
if ( version_compare( phpversion(), "4.1.0", "<") )
{
global $_SESSION;
global $_SESSION, $_SERVER;
}
$stream_src = ZM_PATH_ZMS;
$stream_src = "http://".$_SERVER['HTTP_HOST'].ZM_PATH_ZMS;
if ( ZM_OPT_USE_AUTH )
{
@ -979,4 +979,26 @@ function sidField()
<?php
}
}
function verNum( $version )
{
$vNum = "";
$maxFields = 3;
$vFields = explode( ".", $version );
array_splice( $vFields, $maxFields );
while ( count($vFields) < $maxFields )
{
$vFields[] = 0;
}
foreach ( $vFields as $vField )
{
$vField = sprintf( "%02d", $vField );
while ( strlen($vField) < 2 )
{
$vField = "0".$vField;
}
$vNum .= $vField;
}
return( $vNum );
}
?>