[TASK] Version 1.3.0 and some compatibility stuff 33/36633/3
authortritum_rz <ralf.zimmermann@tritum.de>
Tue, 3 Feb 2015 13:36:28 +0000 (14:36 +0100)
committerRalf Zimmermann <ralf.zimmermann@tritum.de>
Tue, 3 Feb 2015 13:44:07 +0000 (14:44 +0100)
Resolves: #64830
Releases: 6.1, 4.7, 4.5
Change-Id: Ie008e7bd0699012dc30fa565bc25b2163a980358
Reviewed-on: http://review.typo3.org/36633
Reviewed-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Tested-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
ChangeLog [changed mode: 0644->0755]
Classes/Extensions/class.tx_wtspamshield_ke_userregister.php [changed mode: 0644->0755]
Classes/Extensions/class.tx_wtspamshield_powermail2.php [changed mode: 0644->0755]
Classes/Extensions/class.tx_wtspamshield_ve_guestbook.php [changed mode: 0644->0755]
Classes/Methodes/class.tx_wtspamshield_method_abstract.php [changed mode: 0644->0755]
Classes/System/class.tx_wtspamshield_log.php [changed mode: 0644->0755]
Classes/System/class.tx_wtspamshield_mail.php [changed mode: 0644->0755]
ext_emconf.php [changed mode: 0644->0755]
ext_localconf.php [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 71dfb7f..c67d5e8
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-1.3.0-dev
+1.3.0
+       2015-02-03
+       Ralf Zimmermann <ralf.zimmermann@tritum.de>
+
+       * TASK #64830: Version 1.3.0
+
        2014-10-14
        Ralf Zimmermann <ralf.zimmermann@tritum.de>
 
old mode 100644 (file)
new mode 100755 (executable)
index d5ed42f..f744c45
@@ -113,9 +113,13 @@ class tx_wtspamshield_ke_userregister extends tslib_pibase {
 
                $error = '';
 
-               $t3Version = class_exists('t3lib_utility_VersionNumber')
-                       ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version)
-                       : t3lib_div::int_from_ver(TYPO3_version);
+               if (class_exists('\TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility')) {
+                       $t3Version = \TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
+               } else if (class_exists('t3lib_utility_VersionNumber')) {
+                       $t3Version = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);
+               } else if (class_exists('t3lib_div')) {
+                       $t3Version = t3lib_div::int_from_ver(TYPO3_version);
+               }
 
                        // get GPvars, downwards compatibility
                if ($t3Version < 4004000) {
old mode 100644 (file)
new mode 100755 (executable)
index 330aa67..6eb29d1
@@ -82,6 +82,7 @@ class tx_wtspamshield_powermail2 extends Tx_Powermail_Domain_Validator_CustomVal
                if ( $this->getDiv()->isActivated($this->tsKey) ) {
                        $availableValidators = 
                                array(
+                                       'blacklistCheck',
                                        'akismetCheck',
                                );
 
old mode 100644 (file)
new mode 100755 (executable)
index 66d2d2b..916421c
@@ -116,9 +116,14 @@ class tx_wtspamshield_ve_guestbook extends tslib_pibase {
 
                if ( $this->getDiv()->isActivated($this->tsKey) ) {
                                // get GPvars, downwards compatibility
-                       $t3Version = class_exists('t3lib_utility_VersionNumber')
-                               ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version)
-                               : t3lib_div::int_from_ver(TYPO3_version);
+                       if (class_exists('\TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility')) {
+                               $t3Version = \TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
+                       } else if (class_exists('t3lib_utility_VersionNumber')) {
+                               $t3Version = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);
+                       } else if (class_exists('t3lib_div')) {
+                               $t3Version = t3lib_div::int_from_ver(TYPO3_version);
+                       }
+
                        if ($t3Version < 4006000) {
                                $validateArray = t3lib_div::GPvar('tx_veguestbook_pi1');
                        } else {
old mode 100644 (file)
new mode 100755 (executable)
index 50a27c3..3ea30f0
@@ -64,9 +64,13 @@ class tx_wtspamshield_method_abstract extends tslib_pibase {
 
                $this->ll = $this->includeLocalLang();
 
-               $t3Version = class_exists('t3lib_utility_VersionNumber')
-                       ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version)
-                       : t3lib_div::int_from_ver(TYPO3_version);
+               if (class_exists('\TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility')) {
+                       $t3Version = \TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
+               } else if (class_exists('t3lib_utility_VersionNumber')) {
+                       $t3Version = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);
+               } else if (class_exists('t3lib_div')) {
+                       $t3Version = t3lib_div::int_from_ver(TYPO3_version);
+               }
 
                if ($t3Version >= 6000000) {
                        $this->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_cObj');
@@ -92,9 +96,13 @@ class tx_wtspamshield_method_abstract extends tslib_pibase {
         * @return mixed $localLang
         */
        public function includeLocalLang() {
-               $t3Version = class_exists('t3lib_utility_VersionNumber')
-                       ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version)
-                       : t3lib_div::int_from_ver(TYPO3_version);
+               if (class_exists('\TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility')) {
+                       $t3Version = \TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
+               } else if (class_exists('t3lib_utility_VersionNumber')) {
+                       $t3Version = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);
+               } else if (class_exists('t3lib_div')) {
+                       $t3Version = t3lib_div::int_from_ver(TYPO3_version);
+               }
 
                if ($t3Version >= 6000000) {
                        $llFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('wt_spamshield') .
old mode 100644 (file)
new mode 100755 (executable)
index 6e32533..27fb9fb
@@ -81,9 +81,14 @@ class tx_wtspamshield_log extends tslib_pibase {
                                'useragent' => t3lib_div::getIndpEnv('HTTP_USER_AGENT')
                        );
                                // Downwards compatibility
-                       $t3Version = class_exists('t3lib_utility_VersionNumber')
-                               ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version)
-                               : t3lib_div::int_from_ver(TYPO3_version);
+                       if (class_exists('\TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility')) {
+                               $t3Version = \TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
+                       } else if (class_exists('t3lib_utility_VersionNumber')) {
+                               $t3Version = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);
+                       } else if (class_exists('t3lib_div')) {
+                               $t3Version = t3lib_div::int_from_ver(TYPO3_version);
+                       }
+
                        if ($t3Version < 4007000) {
                                $dbValues += array(
                                        'formvalues' => t3lib_div::view_array($formArray) . t3lib_div::view_array($errorMessages)
old mode 100644 (file)
new mode 100755 (executable)
index beac003..28d6d17
@@ -55,10 +55,6 @@ class tx_wtspamshield_mail extends tslib_pibase {
                $div = t3lib_div::makeInstance('tx_wtspamshield_div');
                $tsConf = $div->getTsConf();
 
-               $t3Version = class_exists('t3lib_utility_VersionNumber')
-                       ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version)
-                       : t3lib_div::int_from_ver(TYPO3_version);
-
                $errorMessages['points'] = 'Score: ' . $points;
                $errorMessages = strip_tags(implode(' / ', $errorMessages));
 
old mode 100644 (file)
new mode 100755 (executable)
index 09bc516..c750a25
@@ -15,7 +15,7 @@ $EM_CONF[$_EXTKEY] = array(
        'description' => 'Spam shield without captcha to avoid spam in powermail, ve_guestbook, comments, t3_blog, direct_mail_subscription and standard TYPO3 mailforms. Session check, Link check, Time check, Akismet check, Name check, Honeypot check (see manual for details)',
        'category' => 'services',
        'shy' => 0,
-       'version' => '1.3.0-dev',
+       'version' => '1.3.0',
        'dependencies' => '',
        'conflicts' => 'mf_akismet,wt_calculating_captcha',
        'priority' => '',
old mode 100644 (file)
new mode 100755 (executable)
index 0b5421c..a3ac940
@@ -3,9 +3,13 @@ if (!defined('TYPO3_MODE')) {
        die ('Access denied.');
 }
 
-$t3Version = class_exists('t3lib_utility_VersionNumber')
-       ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version)
-       : t3lib_div::int_from_ver(TYPO3_version);
+if (class_exists('\TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility')) {
+       $t3Version = \TYPO3\CMS\Core\Utility\GeneralUtility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
+} else if (class_exists('t3lib_utility_VersionNumber')) {
+       $t3Version = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);
+} else if (class_exists('t3lib_div')) {
+       $t3Version = t3lib_div::int_from_ver(TYPO3_version);
+}
 
 /* Use HOOKS in other extensions */
 
@@ -18,7 +22,16 @@ $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['powermail']['PM_SubmitBeforeMarkerHook']
        = 'EXT:wt_spamshield/Classes/Extensions/class.tx_wtspamshield_powermail.php:tx_wtspamshield_powermail';
 
        // Hook Powermail2:
-if ($t3Version >= 4007000 AND t3lib_extMgm::isLoaded('powermail')) {
+if (
+       $t3Version >= 6002000 &&
+       t3lib_extMgm::isLoaded('powermail')
+) {
+       $signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
+       $signalSlotDispatcher->connect('In2code\\Powermail\\Domain\\Validator\\CustomValidator', 'isValid', 'TRITUM\\WtSpamshield\\Extensions\\Powermail2Validator', 'validate');
+} else if (
+       $t3Version >= 4007000 &&
+       t3lib_extMgm::isLoaded('powermail')
+) {
        $signalSlotDispatcher = t3lib_div::makeInstance('Tx_Extbase_SignalSlot_Dispatcher');
        $signalSlotDispatcher->connect('Tx_Powermail_Domain_Validator_CustomValidator', 'isValid', 'tx_wtspamshield_powermail2', 'validate');
 }
@@ -32,11 +45,24 @@ $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ve_guestbook']['preEntryInsertHook'][]
        = 'EXT:wt_spamshield/Classes/Extensions/class.tx_wtspamshield_ve_guestbook.php:tx_wtspamshield_ve_guestbook';
 
 $extPath = t3lib_extMgm::extPath('wt_spamshield');
+
        // Validator/ Hook standard mailform: Disable email
-if ($t3Version >= 6000000 AND t3lib_extMgm::isLoaded('form')) {
+if (
+       $t3Version >= 6002000 &&
+       t3lib_extMgm::isLoaded('form')
+) {
+       $txFormValidator = $extPath . 'Classes/Extensions/WtspamshieldValidator.php';
+       require_once($txFormValidator);
+} else if (
+       $t3Version >= 6000000 &&
+       t3lib_extMgm::isLoaded('form')
+) {
        $txFormValidator = $extPath . 'Classes/Extensions/WtspamshieldValidator.php';
        require_once($txFormValidator);
-} elseif ($t3Version >= 4006000 AND t3lib_extMgm::isLoaded('form')) {
+} elseif (
+       $t3Version >= 4006000 &&
+       t3lib_extMgm::isLoaded('form')
+) {
        $txFormValidator = $extPath . 'Classes/Extensions/class.tx_form_System_Validate_Wtspamshield.php';
        require_once($txFormValidator);
 } else {
@@ -91,4 +117,4 @@ if ($t3Version >= 6000000) {
                'expirePeriod' => 180,
        );
 }
-?>
\ No newline at end of file
+?>