[ticket/9627] Prefix function names with 'phpbb_'.

PHPBB3-9627
This commit is contained in:
Andreas Fischer 2010-10-23 18:03:49 +02:00
parent afda5e2073
commit 0f49e52940
3 changed files with 11 additions and 11 deletions

View file

@ -275,7 +275,7 @@ if ($thumbnail)
{ {
$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename']; $attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
} }
else if (($display_cat == ATTACHMENT_CATEGORY_NONE/* || $display_cat == ATTACHMENT_CATEGORY_IMAGE*/) && !$attachment['is_orphan'] && !http_byte_range($attachment['filesize'])) else if (($display_cat == ATTACHMENT_CATEGORY_NONE/* || $display_cat == ATTACHMENT_CATEGORY_IMAGE*/) && !$attachment['is_orphan'] && !phpbb_http_byte_range($attachment['filesize']))
{ {
// Update download count // Update download count
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '

View file

@ -237,7 +237,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
if ($fp !== false) if ($fp !== false)
{ {
// Deliver file partially if requested // Deliver file partially if requested
if ($range = http_byte_range($size)) if ($range = phpbb_http_byte_range($size))
{ {
fseek($fp, $range['byte_pos_start']); fseek($fp, $range['byte_pos_start']);
@ -439,7 +439,7 @@ function file_gc()
* @return mixed false if the whole file has to be delivered * @return mixed false if the whole file has to be delivered
* associative array on success * associative array on success
*/ */
function http_byte_range($filesize) function phpbb_http_byte_range($filesize)
{ {
// Only call find_range_request() once. // Only call find_range_request() once.
static $request_array; static $request_array;
@ -451,10 +451,10 @@ function http_byte_range($filesize)
if (!isset($request_array)) if (!isset($request_array))
{ {
$request_array = find_range_request(); $request_array = phpbb_find_range_request();
} }
return (empty($request_array)) ? false : parse_range_request($request_array, $filesize); return (empty($request_array)) ? false : phpbb_parse_range_request($request_array, $filesize);
} }
/** /**
@ -464,7 +464,7 @@ function http_byte_range($filesize)
* array of strings containing the requested ranges otherwise * array of strings containing the requested ranges otherwise
* e.g. array(0 => '0-0', 1 => '123-125') * e.g. array(0 => '0-0', 1 => '123-125')
*/ */
function find_range_request() function phpbb_find_range_request()
{ {
$globals = array( $globals = array(
array('_SERVER', 'HTTP_RANGE'), array('_SERVER', 'HTTP_RANGE'),
@ -505,7 +505,7 @@ function find_range_request()
* bytes_requested the number of bytes requested * bytes_requested the number of bytes requested
* bytes_total the full size of the file * bytes_total the full size of the file
*/ */
function parse_range_request($request_array, $filesize) function phpbb_parse_range_request($request_array, $filesize)
{ {
// Go through all ranges // Go through all ranges
foreach ($request_array as $range_string) foreach ($request_array as $range_string)

View file

@ -16,15 +16,15 @@ class phpbb_download_http_byte_range_test extends phpbb_test_case
{ {
// Missing 'bytes=' prefix // Missing 'bytes=' prefix
$_SERVER['HTTP_RANGE'] = 'bztes='; $_SERVER['HTTP_RANGE'] = 'bztes=';
$this->assertEquals(false, find_range_request()); $this->assertEquals(false, phpbb_find_range_request());
unset($_SERVER['HTTP_RANGE']); unset($_SERVER['HTTP_RANGE']);
$_ENV['HTTP_RANGE'] = 'bztes='; $_ENV['HTTP_RANGE'] = 'bztes=';
$this->assertEquals(false, find_range_request()); $this->assertEquals(false, phpbb_find_range_request());
unset($_ENV['HTTP_RANGE']); unset($_ENV['HTTP_RANGE']);
$_SERVER['HTTP_RANGE'] = 'bytes=0-0,123-125'; $_SERVER['HTTP_RANGE'] = 'bytes=0-0,123-125';
$this->assertEquals(array('0-0', '123-125'), find_range_request()); $this->assertEquals(array('0-0', '123-125'), phpbb_find_range_request());
unset($_SERVER['HTTP_RANGE']); unset($_SERVER['HTTP_RANGE']);
} }
@ -33,7 +33,7 @@ class phpbb_download_http_byte_range_test extends phpbb_test_case
*/ */
public function test_parse_range_request($request_array, $filesize, $expected) public function test_parse_range_request($request_array, $filesize, $expected)
{ {
$this->assertEquals($expected, parse_range_request($request_array, $filesize)); $this->assertEquals($expected, phpbb_parse_range_request($request_array, $filesize));
} }
public function parse_range_request_data() public function parse_range_request_data()