2012-10-04 13:20 UTC+0200 Viktor Szakats (harbour syenar.net)
- tests/testtok.prg
- deleted obsolete token test code
* contrib/hbformat/hbfmtcls.prg
* contrib/hbgd/tests/test_out.prg
* contrib/hbhttpd/core.prg
* contrib/hbmxml/tests/custom.prg
* contrib/hbmxml/tests/testmxml.prg
* contrib/hbnf/ftround.prg
* contrib/hbpgsql/tpostgre.prg
* contrib/hbtip/ftpcli.prg
* extras/gfspell/spell.prg
* extras/gtwvw/tests/ebtest7.prg
* extras/hbvpdf/hbvpdf.prg
* extras/hbvpdf/hbvpdft.prg
* extras/httpsrv/cgifunc.prg
* extras/httpsrv/session.prg
* extras/httpsrv/uhttpd.prg
* src/debug/dbgtmenu.prg
* src/debug/debugger.prg
* tests/db_brows.prg
* tests/inherit.prg
* tests/rto_tb.prg
* tests/stripem.prg
* utils/hbi18n/hbi18n.prg
! fixed/avoided != operator on strings
This commit is contained in:
@@ -680,8 +680,8 @@ STATIC FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd)
|
||||
dEnd := DATE()
|
||||
ENDIF
|
||||
|
||||
iif( VALTYPE(cTimeStart) != 'C', cTimeStart := '00:00:00', )
|
||||
iif( VALTYPE(cTimeEnd) != 'C', cTimeEnd := '00:00:00', )
|
||||
iif( ! HB_ISSTRING( cTimeStart ), cTimeStart := '00:00:00', )
|
||||
iif( ! HB_ISSTRING( cTimeEnd ) , cTimeEnd := '00:00:00', )
|
||||
|
||||
nTotalSec := (dEnd - dStart) * 86400 + ;
|
||||
VAL(cTimeEnd) * 3600 + ;
|
||||
@@ -779,7 +779,7 @@ RETURN hExeFile:FULLNAME
|
||||
|
||||
FUNCTION uhttpd_CStrToVal( cExp, cType )
|
||||
|
||||
IF ValType( cExp ) != 'C'
|
||||
IF ! HB_ISSTRING( cExp )
|
||||
Throw( ErrorNew( "CSTR", 0, 3101, ProcName(), "Argument error", { cExp, cType } ) )
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -253,11 +253,10 @@ METHOD Start( cSID ) CLASS uhttpd_Session
|
||||
// // Check whether the current request was referred to by
|
||||
// // an external site which invalidates the previously found ID
|
||||
// $url = parse_url($GLOBALS['HTTP_REFERER']);
|
||||
// if (trim($url['host']) != $GLOBALS['SERVER_NAME']) {
|
||||
// unset($session->id);
|
||||
// $send_cookie = true;
|
||||
// $define_sid = true;
|
||||
// }
|
||||
// IF !(trim($url['host']) == $GLOBALS['SERVER_NAME'])
|
||||
// unset(session->id)
|
||||
// send_cookie := .T.
|
||||
// define_sid := .T.
|
||||
ENDIF
|
||||
|
||||
// Do we have an existing session ID?
|
||||
@@ -751,8 +750,8 @@ STATIC FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd)
|
||||
dEnd := DATE()
|
||||
ENDIF
|
||||
|
||||
iif( VALTYPE(cTimeStart) != 'C', cTimeStart := '00:00:00', )
|
||||
iif( VALTYPE(cTimeEnd) != 'C', cTimeEnd := '00:00:00', )
|
||||
iif( ! HB_ISSTRING(cTimeStart), cTimeStart := '00:00:00', )
|
||||
iif( ! HB_ISSTRING(cTimeEnd) , cTimeEnd := '00:00:00', )
|
||||
|
||||
nTotalSec := (dEnd - dStart) * 86400 + ;
|
||||
VAL(cTimeEnd) * 3600 + ;
|
||||
|
||||
@@ -407,7 +407,7 @@ FUNCTION Main( ... )
|
||||
IF HB_ISSTRING( cApplicationRoot )
|
||||
cI := cApplicationRoot
|
||||
IF HB_DirExists( cI )
|
||||
IF RIGHT( cI, 1 ) == "/" .AND. LEN(cI) > 2 .AND. SUBSTR( cI, LEN( cI ) - 2, 1 ) != ":"
|
||||
IF RIGHT( cI, 1 ) == "/" .AND. LEN(cI) > 2 .AND. !( SUBSTR( cI, LEN( cI ) - 2, 1 ) == ":" )
|
||||
s_cApplicationRoot := LEFT( cI, LEN( cI ) - 1 )
|
||||
ELSE
|
||||
s_cApplicationRoot := cI
|
||||
@@ -431,7 +431,7 @@ FUNCTION Main( ... )
|
||||
//cI := STRTRAN( SUBSTR( cDocumentRoot, 2 ), "\", "/" )
|
||||
cI := cDocumentRoot
|
||||
IF HB_DirExists( cI )
|
||||
IF RIGHT( cI, 1 ) == "/" .AND. LEN(cI) > 2 .AND. SUBSTR( cI, LEN( cI ) - 2, 1 ) != ":"
|
||||
IF RIGHT( cI, 1 ) == "/" .AND. LEN(cI) > 2 .AND. !( SUBSTR( cI, LEN( cI ) - 2, 1 ) == ":" )
|
||||
s_cDocumentRoot := LEFT( cI, LEN( cI ) - 1 )
|
||||
ELSE
|
||||
s_cDocumentRoot := cI
|
||||
@@ -1120,8 +1120,9 @@ STATIC FUNCTION ParseRequest( cRequest )
|
||||
WriteToConsole( aRequest[ 1 ] )
|
||||
aLine := uhttpd_split( " ", aRequest[ 1 ] )
|
||||
IF LEN( aLine ) != 3 .OR. ;
|
||||
( aLine[1] != "GET" .AND. aLine[ 1 ] != "POST" ) .OR. ; // Sorry, we support GET and POST only
|
||||
LEFT( aLine[ 3 ], 5 ) != "HTTP/"
|
||||
( !( Left( aLine[ 1 ], 3 ) == "GET" ) .AND. ;
|
||||
!( Left( aLine[ 1 ], 4 ) == "POST" ) ) .OR. ; // Sorry, we support GET and POST only
|
||||
!( LEFT( aLine[ 3 ], 5 ) == "HTTP/" )
|
||||
// Set status code
|
||||
t_nStatusCode := 501 // Not Implemented
|
||||
RETURN .F.
|
||||
@@ -1619,10 +1620,10 @@ STATIC FUNCTION CGIKill( hProc, hmtxCGIKill )
|
||||
********************************************************************/
|
||||
|
||||
FUNCTION uhttpd_OSFileName( cFileName )
|
||||
IF hb_ps() != "/"
|
||||
RETURN STRTRAN( cFileName, "/", hb_ps() )
|
||||
IF hb_ps() == "/"
|
||||
RETURN cFileName
|
||||
ENDIF
|
||||
RETURN cFileName
|
||||
RETURN STRTRAN( cFileName, "/", hb_ps() )
|
||||
|
||||
PROCEDURE uhttpd_SetStatusCode(nStatusCode)
|
||||
t_nStatusCode := nStatusCode
|
||||
@@ -1888,7 +1889,7 @@ STATIC FUNCTION uproc_default()
|
||||
ELSEIF HB_DirExists( uhttpd_OSFileName( cFileName ) )
|
||||
|
||||
// if it exists as folder and it is missing trailing slash I add it and redirect to it
|
||||
IF RIGHT( cFileName, 1 ) != "/"
|
||||
IF !( RIGHT( cFileName, 1 ) == "/" )
|
||||
uhttpd_SetHeader( "Location", "http://" + _SERVER[ "HTTP_HOST" ] + _SERVER[ "SCRIPT_NAME" ] + "/" )
|
||||
RETURN MakeResponse()
|
||||
ENDIF
|
||||
|
||||
Reference in New Issue
Block a user