phpBB

Code Changes

File: includes/functions_admin.php

  Unmodified   Added   Modified   Removed
Line 2296Line 2296
/**
* remove_comments will strip the sql comment lines out of an uploaded sql file
* specifically for mssql and postgres type files in the install....

/**
* remove_comments will strip the sql comment lines out of an uploaded sql file
* specifically for mssql and postgres type files in the install....

 
*
* @deprecated Use phpbb_remove_comments() instead.

*/
function remove_comments(&$output)
{

*/
function remove_comments(&$output)
{

	$lines = explode("\n", $output);
$output = '';

// try to keep mem. use down
$linecount = sizeof($lines);

$in_comment = false;
for ($i = 0; $i < $linecount; $i++)
{
if (trim($lines[$i]) == '/*')
{
$in_comment = true;
}

if (!$in_comment)
{
$output .= $lines[$i] . "\n";
}

if (trim($lines[$i]) == '*/')
{
$in_comment = false;
}
}

	// Remove /* */ comments (http://ostermiller.org/findcomment.html)
$output = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $output);



























	unset($lines);

	// Return by reference and value.

	return $output;
}


	return $output;
}


Line 2592Line 2572
		{
$sql_keywords .= $db->sql_in_set('l.log_operation', $operations) . ' OR ';
}

		{
$sql_keywords .= $db->sql_in_set('l.log_operation', $operations) . ' OR ';
}

		$sql_keywords .= 'LOWER(l.log_data) ' . implode(' OR LOWER(l.log_data) ', $keywords) . ')';


		$sql_lower = $db->sql_lower_text('l.log_data');
$sql_keywords .= "$sql_lower " . implode(" OR $sql_lower ", $keywords) . ')';

	}

if ($log_count !== false)

	}

if ($log_count !== false)

Line 3076Line 3057
		case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':

		case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':

 
			$sql = 'SELECT @@VERSION AS mssql_version';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);


			$sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
FROM sysfiles';

			$sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
FROM sysfiles';

 

if ($row)
{
// Azure stats are stored elsewhere
if (strpos($row['mssql_version'], 'SQL Azure') !== false)
{
$sql = 'SELECT ((SUM(reserved_page_count) * 8.0) * 1024.0) as dbsize
FROM sys.dm_db_partition_stats';
}
}


			$result = $db->sql_query($sql, 7200);
$database_size = ($row = $db->sql_fetchrow($result)) ? $row['dbsize'] : false;
$db->sql_freeresult($result);

			$result = $db->sql_query($sql, 7200);
$database_size = ($row = $db->sql_fetchrow($result)) ? $row['dbsize'] : false;
$db->sql_freeresult($result);

Line 3140Line 3137

if ($fsock = @fsockopen($host, $port, $errno, $errstr, $timeout))
{


if ($fsock = @fsockopen($host, $port, $errno, $errstr, $timeout))
{

		@fputs($fsock, "GET $directory/$filename HTTP/1.1\r\n");

		@fputs($fsock, "GET $directory/$filename HTTP/1.0\r\n");

		@fputs($fsock, "HOST: $host\r\n");
@fputs($fsock, "Connection: close\r\n\r\n");


		@fputs($fsock, "HOST: $host\r\n");
@fputs($fsock, "Connection: close\r\n\r\n");


Line 3338Line 3335
		$info = get_remote_file('version.phpbb.com', '/phpbb',
((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);


		$info = get_remote_file('version.phpbb.com', '/phpbb',
((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);


		if ($info === false)

		if (empty($info))

		{
$cache->destroy('versioncheck');
if ($warn_fail)

		{
$cache->destroy('versioncheck');
if ($warn_fail)

Line 3362Line 3359
 * @param int		$flag			The binary flag which is OR-ed with the current column value
* @param string $sql_more This string is attached to the sql query generated to update the table.
*

 * @param int		$flag			The binary flag which is OR-ed with the current column value
* @param string $sql_more This string is attached to the sql query generated to update the table.
*

 * @return void

 * @return null

 */
function enable_bitfield_column_flag($table_name, $column_name, $flag, $sql_more = '')
{

 */
function enable_bitfield_column_flag($table_name, $column_name, $flag, $sql_more = '')
{