Thread: Forum Display Enhancements - GLA - Geographic Location Awareness for vBulletin
View Single Post
  #32  
Old 07-12-2007, 12:18 PM
mfyvie mfyvie is offline
 
Join Date: Mar 2007
Location: Zurich, Switzerland
Posts: 336
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've discovered a very minor flaw.

Impact: If a user's IP isn't found in the database, GLA functions will be disabled for that user. For example, they won't be able to see the who's online list. Whenever that person loads any page on the forum, 1 extra query will be executed - for most people that wouldn't be the end of the world, but I have tried to make GLA as efficient as possible.

What you need to do: Download the .zip file again, you do not need to reinstall the whole package, just replace your includes/gla.php file that you uploaded earlier.

Why this happened: People not interested in the programmer's explanation may skip this next part - show's over folks.. When someone's IP address isn't found we write a null value to the session variable. We use isset() to later check if we've already executed the query, but if the null value is written to the database it doesn't come back on the next page load, therefore the isset() we expected to be true is really false. This is solved by writing an unknown entry to the database as ' ' (space character), GLA then trims anything that comes from the session table the first time it loads - effectively nullifying the variable again. Thereore developers can still use isset() before their GLA compatible plugins (to test if GLA is present at all), and != null to test to see if a country has been found.

What if I do nothing? Well it won't be the end of the world, but it might mean that some users (who have IP addresses that aren't in the database) might not be able to use features which rely on GLA. I'd therefore prefer it if everyone replaced their gla.php file - just to ensure no support issues come up in the future.

Who should do this? Anyone who downloaded and installed GLA before the date of this post. Anyone who has installed GLA after the date of this post can safely ignore this whole post!
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01392 seconds
  • Memory Usage 1,762KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete