Jack Phoenix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327926 )

Change subject: Version 0.6.2 from ShoutWiki: HHVM compatibility fix, i18n 
loading fix
......................................................................

Version 0.6.2 from ShoutWiki: HHVM compatibility fix, i18n loading fix

Change-Id: I07fcce5c7a7dae53a567620129b203979e24a69c
---
M EnhanceContactForm.php
1 file changed, 16 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EnhanceContactForm 
refs/changes/26/327926/1

diff --git a/EnhanceContactForm.php b/EnhanceContactForm.php
index 4e05db1..d70b011 100644
--- a/EnhanceContactForm.php
+++ b/EnhanceContactForm.php
@@ -24,11 +24,13 @@
 // Extension credits that will show up on Special:Version
 $wgExtensionCredits['other'][] = array(
        'name' => 'EnhanceContactForm',
-       'version' => '0.6',
+       'version' => '0.6.2',
        'author' => 'Jack Phoenix',
        'url' => 'https://www.mediawiki.org/wiki/Extension:EnhanceContactForm',
        'descriptionmsg' => 'enhancecontactform-desc',
 );
+
+$wgMessagesDirs['EnhanceContactForm'] = __DIR__ . '/i18n';
 
 $wgHooks['ContactForm'][] = 'enhanceContactForm';
 
@@ -46,8 +48,20 @@
        $text .= 'IP address of the reporter: ' . $wgRequest->getIP() . "\n";
 
        if ( class_exists( 'MyInfo' ) ) {
+               global $IP;
+               require_once $IP . '/extensions/MyInfo/browser_detector.php';
                $myinfo = new MyInfo();
-               $myinfo->browser = get_browser( null, true );
+
+               // Stupid hack for HHVM since HHVM doesn't implement PHP's 
native get_browser() :-(
+               // @see http://docs.hhvm.com/manual/en/function.get-browser.php
+               // @see https://github.com/facebook/hhvm/issues/2541
+               if ( get_cfg_var( 'browscap' ) ) {
+                       $myinfo->browser = get_browser( null, true );
+               } else {
+                       require_once $IP . 
'/extensions/MyInfo/php-local-browscap.php';
+                       $myinfo->browser = get_browser_local( null, true );
+               }
+
                $myinfo->info = browser_detection( 'full' );
                $myinfo->info[] = browser_detection( 'moz_version' );
                $text .= 'Browser: ' . $myinfo->getBrowser() . "\n";

-- 
To view, visit https://gerrit.wikimedia.org/r/327926
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07fcce5c7a7dae53a567620129b203979e24a69c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EnhanceContactForm
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to