Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-30-2013, 05:13 PM
JfoxEdge JfoxEdge is offline
 
Join Date: Apr 2012
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Avatars randomly won't display

vBulletin 4.1.12. Avatars are stored in the database.

Some avatars display, others do not. It appears that file format doesn't matter, I have some JPG and some PNG with the problem, while others display fine.

The data is being output to the browser by image.php. I modified image.php and inserted the following line:

Code:
file_put_contents($imageinfo['filename'],$imageinfo['filedata']);
Before the following section:

Code:
($hook = vBulletinHook::fetch_hook('image_exists')) ? eval($hook) : false;
header('Pragma:'); // VBIV-8269 
header('Cache-control: max-age=31536000');
header('Expires: ' . gmdate('D, d M Y H:i:s', (TIMENOW + 31536000)) . ' GMT');
header('Content-disposition: inline; filename=' . $imageinfo['filename']);
header('Content-transfer-encoding: binary');
header('Content-Length: ' . strlen($imageinfo['filedata']));
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $imageinfo['dateline']) . ' GMT');
header('ETag: "' . $imageinfo['dateline'] . '-' . $vbulletin->GPC['userid'] . '"');
This causes image.php to save the database data to a file.

On a given avatar, the saved file is 6474 bytes, called "header.png", and is a valid PNG file that can be viewed successfully, either by accessing through a browser (at "/forums/header.png") or by downloading the file with FTP and then viewing.

When trying to open the image at /forums/image.php?u=14548&dateline=1362221067, you get a file size of 6480 bytes, and the browser says the file contains errors. When saving the image from the browser, you get a 6480 byte file that is not a valid PNG. The saved file contains many different looking characters.

So I've got two files, the one that image.php saved on the server with file_put_contents and the one downloaded from the browser. You see the difference in the very beginning of the file.

When opened in notepad, the good file that was saved on the server looks like this:

?PNG

The file being output by image.php to the browser looks like this:

�PNG

In addition, the one output by image.php is full of those characters with a ? inside a diamond.

So what could be wrong? This seems to have just happened all-of-a-sudden a few days ago, with no changes that I'm aware of at all. And even more confusing is that it's not all avatar images, just some of them.

Any suggestions would be appreciated.

Thanks.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06113 seconds
  • Memory Usage 2,252KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete