Nuke reCAPTCHA OEM key during update and for new installations
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 4 Dec 2014 20:42:35 +0000 (21:42 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 4 Dec 2014 20:43:49 +0000 (21:43 +0100)
com.woltlab.wcf/option.xml
wcfsetup/install/files/acp/update_com.woltlab.wcf_2.1.php

index 0f8f9b0a9fda1ea992655affc59e0ace00d3078d..88023954fc464ab750705725e1a834c82096eb0d 100644 (file)
@@ -654,8 +654,7 @@ imagick:wcf.acp.option.image_adapter_type.imagick]]>
                                <categoryname>security.antispam.recaptcha</categoryname>
                                <optiontype>text</optiontype>
                                <validationpattern>^[^/]*$</validationpattern>
-                               <!-- wcf-recaptcha.woltlab.com global key -->
-                               <defaultvalue>6LfOlMYSAAAAADvo3s4puBAYDqI-6YK2ybe7BJE5</defaultvalue>
+                               <defaultvalue></defaultvalue>
                                <showorder>1</showorder>
                        </option>
                        <option name="recaptcha_privatekey">
@@ -663,7 +662,7 @@ imagick:wcf.acp.option.image_adapter_type.imagick]]>
                                <optiontype>text</optiontype>
                                <validationpattern>^[^/]*$</validationpattern>
                                <!-- wcf-recaptcha.woltlab.com global key -->
-                               <defaultvalue>6LfOlMYSAAAAAKR3m_EFxmDv1xS8PCfeaSZ2LdG9</defaultvalue>
+                               <defaultvalue></defaultvalue>
                                <showorder>2</showorder>
                        </option>
                        <!-- /security.antispam.recaptcha -->
index 49e869debd9a9eef95395520b26f41c53cc8bf2b..f6f4a90d6106e7d5e10aec35fca6ae3e91b358f3 100644 (file)
@@ -9,13 +9,21 @@ use wcf\data\option\OptionEditor;
  * @category   Community Framework
  */
 
-OptionEditor::updateAll(array(
+$options = array(
        'cache_source_type' => (CACHE_SOURCE_TYPE == 'no' ? 'disk' : CACHE_SOURCE_TYPE), 
        'last_update_time' => TIME_NOW,
        'url_legacy_mode' => 1,
        'url_to_lowercase' => 0,
        // the line below equals \wcf\util\StringUtil::getUUID(), but since we have to do it in one step, the "old" class exists in memory
        'wcf_uuid' => sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535))
-));
+);
+
+// clear recaptcha keys if public key and private key match WoltLab's OEM key
+if (RECAPTCHA_PUBLICKEY === '6LfOlMYSAAAAADvo3s4puBAYDqI-6YK2ybe7BJE5' && RECAPTCHA_PRIVATEKEY === '6LfOlMYSAAAAAKR3m_EFxmDv1xS8PCfeaSZ2LdG9') {
+       $options['recaptcha_publickey'] = '';
+       $options['recaptcha_privatekey'] = '';
+}
+
+OptionEditor::updateAll();
 
 OptionEditor::resetCache();