|
From: Paul S. O. <ps...@us...> - 2002-01-28 00:57:30
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv27784/includes
Modified Files:
sql_parse.php
Log Message:
preg_quote lines for /* comment parsed SQL ... was causing failure on install for mssql ...
Index: sql_parse.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/sql_parse.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** sql_parse.php 2001/10/01 21:19:02 1.5
--- sql_parse.php 2002/01/28 00:57:27 1.6
***************
*** 33,62 ****
// specifically for mssql and postgres type files in the install....
//
! function remove_comments($sql)
{
! $lines = explode("\n", $sql);
// try to keep mem. use down
- $sql = "";
$linecount = count($lines);
! $output = "";
$in_comment = false;
for($i = 0; $i < $linecount; $i++)
{
! if( ereg("^\/\*", $lines[$i]) )
{
$in_comment = true;
}
! if( ereg("\*\/$", $lines[$i]) )
{
! $in_comment = false;
! $i++;
}
! if(!$in_comment)
{
! $output .= $lines[$i] . "\n";
}
- $lines[$i] = '';
}
return $output;
}
--- 33,64 ----
// specifically for mssql and postgres type files in the install....
//
! function remove_comments(&$output)
{
! $lines = explode("\n", $output);
! $output = "";
// try to keep mem. use down
$linecount = count($lines);
!
$in_comment = false;
for($i = 0; $i < $linecount; $i++)
{
! if( preg_match("/^\/\*/", preg_quote($lines[$i])) )
{
$in_comment = true;
}
!
! if( !$in_comment )
{
! $output .= $lines[$i] . "\n";
}
!
! if( preg_match("/\*\/$/", preg_quote($lines[$i])) )
{
! $in_comment = false;
}
}
+
+ unset($lines);
return $output;
}
|