Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications
Lowercase a-f in IPv6 Addresses Details »»
Lowercase a-f in IPv6 Addresses
Version: 1.00, by JamesC70 JamesC70 is offline
Developer Last Online: May 2020 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.11 Rating:
Released: 01-14-2018 Last Update: Never Installs: 1
Re-useable Code Code Changes Translations  
No support by the author.

I upgraded my forum from vB 3.8.9PL1 to 3.8.11, and noticed that 3.8.11 displays IPv6 addresses with uppercase letters on Who's Online.

3.8.9PL1 didn't do this, and none of the other websites I visit use uppercase letters in IPv6 addresses.

I looked into it, and RFC5952 Section 4.3 says that IPv6 addresses are to use lowercase letters a-f.

So, if this irritates you as much as it did me, here's the fix.

1. Open includes/class_core.php and search for function compress_ip. It should appear at line 3982.

2. 24 lines below, at line 4006, you should see:
PHP Code:
return strtoupper(inet_ntop($ipx)); 

Change "upper" to "lower", so that line 4006 now reads:
PHP Code:
return strtolower(inet_ntop($ipx)); 
3. FTP the edited file to your server, and inspect any IPv6 address you may see on Who's Online to verify that it now displays a-f as lowercase letters.

Note, this will not fix any IPv6 hostname lookup issues you may experience. That is a webhost issue; if your webhost doesn't yet support IPv6 then their hands are also tied. I can post a workaround if anyone needs one, but it doesn't fully integrate into Who's Online.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-15-2018, 12:45 PM
Stingray27 Stingray27 is offline
 
Join Date: Jan 2006
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That RFC is only a recommendation, and conflicts with the full RFC 4291.

https://tools.ietf.org/html/rfc4291 (IP Version 6 Addressing Architecture)

Section 2.2
Reply With Quote
  #3  
Old 01-15-2018, 02:03 PM
JamesC70 JamesC70 is offline
 
Join Date: Jun 2007
Posts: 219
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stingray27 View Post
That RFC is only a recommendation, and conflicts with the full RFC 4291.
The second line of 4291, just below where you can choose text or PDF, says "Updated by: 5952".

If we read the Abstract of 5952, it is written to correct the problems of 4291.

The IETF clearly intends 5952 to supersede 4291. Whether you follow 5952 is your choice (5952 requires all systems to accept a valid IPv6 address if it conforms with 4291) but vBulletin should have been 5952 compliant from the start of its IPv6 support.
Reply With Quote
  #4  
Old 01-15-2018, 04:35 PM
Stingray27 Stingray27 is offline
 
Join Date: Jan 2006
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It may intend to replace it [at some point] but it doesnt atm.
Why whould vb comply with something thats just a proposed recommendation ?

As far as I can tell from 5952, the whole "use lowercase" is just a 50/50 random choice based on the fact unix systems are case sensitive. Uppercase would be equally valid.

As long as your software (e.g. vBulletin) is consistant in its use of one or the other, it doesnt really matter which way you go.

Its all just preference really, I find lowercase looks really horrible & odd.
Reply With Quote
  #5  
Old 01-15-2018, 06:50 PM
JamesC70 JamesC70 is offline
 
Join Date: Jun 2007
Posts: 219
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stingray27 View Post
As long as your software (e.g. vBulletin) is consistant in its use of one or the other, it doesnt really matter which way you go.

Its all just preference really, I find lowercase looks really horrible & odd.
I have two vB 3.8 forums, and it bothered me that one shows lowercase IPv6 but the other shows uppercase on Who's Online. This inconsistency is what bothered me; if I only had one forum then I may never have noticed the change.

But if IB ever releases a hypothetical 3.8.13 (intentionally skipping 3.8.12) that reverts IPv6 to lowercase, now you know how to change it back to uppercase.

All good?
Reply With Quote
  #6  
Old 04-19-2018, 08:17 PM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Posting here to say that you can do the same modification in vbulletin 4 forums.

This will be on line 6436

PHP Code:
return strtoupper(inet_ntop($ipx)); 
Replace it with the code above

PHP Code:
return strtolower(inet_ntop($ipx)); 
JamesC70, feel free to post this to the vbulletin 4 mods section if you like.
Reply With Quote
Благодарность от:
JamesC70
Reply

Thread Tools

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 09:35 AM.


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.04345 seconds
  • Memory Usage 2,272KB
  • Queries Executed 20 (?)
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
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (1)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (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_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • 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
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete