Plugin Directory

Changeset 599294

Timestamp:
09/15/2012 02:17:51 PM (12 years ago)
Author:
jankarres
Message:

Update to 1.0.2; Edits see changelog in readme.txt

Location:
wp-pocket
Files:
2 edited
4 copied

Legend:

Unmodified
Added
Removed
  • wp-pocket/tags/1.0.2/readme.txt

    r598959 r599294  
    55Requires at least: 3.4
    66Tested up to: 3.4
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5252== Changelog ==
    5353
    54 = 1.0 =
    55 Initial release
     54= 1.0.2 =
     55Fix encryption bug of the Pocket username, password and api key
     56Introduce version number in class
    5657
    5758= 1.0.1 =
    5859Fix encoding bug
     60
     61
     62
    5963
    6064== Upgrade notice ==
  • wp-pocket/tags/1.0.2/wp-pocket.php

    r599051 r599294  
    66    Author: Jan Karres
    77    Author URI: http://www.jankarres.de/
    8     Version: 1.0.1
     8    Version: 1.0.
    99*/
    1010
     
    1212    class wppocketer {
    1313        private $wpdb;
     14
    1415       
    1516        // Pocket default API-Key by developer
     
    2122            // Set database
    2223            $this->wpdb = $wpdb;
     24
     25
     26
    2327       
    2428            // Check WP version
     
    6670
    6771        function activate() {
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
    6884            // Create database table for links
    6985            $sql = '
     
    84100                `autoload`
    85101            ) VALUES
     102
    86103                ("wppocket_links_to_use", "0", "yes"),
    87104                ("wppocket_order", "0", "yes"),
     
    115132            ';
    116133            $this->wpdb->query($sql);
     134
     135
     136
     137
     138
     139
    117140        }
    118141
     
    138161       
    139162        // En- and decrypt strings
    140         private function xcrypt($mode, $string) {
     163        private function xcrypt($mode, $string) {
    141164            /*
    142165             * Required parameters:
     
    145168             */
    146169           
    147             // Get crypt keys
    148             $sql = 'SELECT `wppocket_key_a`, `wppocket_key_b` FROM `' . $this->wpdb->prefix . 'options`';
    149             $keys = $this->wpdb->get_row($sql);
     170            // Get crypt keys, if should
     171            if (!$nosalt) {
     172                $keys['a'] = get_option('wppocket_key_a');
     173                $key['b'] = get_option('wppocket_key_b');
     174            }
    150175           
    151176            if ($mode == 0) { // Encrypt
    152                 return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($keys->wppocket_key_a), $string, MCRYPT_MODE_CBC, md5(md5($keys->wppocket_key_b))));
     177                return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($keys))));
    153178            }elseif ($mode == 1) { // Decrypt
    154                 return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($keys->wppocket_key_a), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($keys->wppocket_key_b))), "\0");
     179                return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($keys))), "\0");
    155180            }else { // False mode
    156181                return false;
  • wp-pocket/trunk/readme.txt

    r598959 r599294  
    55Requires at least: 3.4
    66Tested up to: 3.4
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5252== Changelog ==
    5353
    54 = 1.0 =
    55 Initial release
     54= 1.0.2 =
     55Fix encryption bug of the Pocket username, password and api key
     56Introduce version number in class
    5657
    5758= 1.0.1 =
    5859Fix encoding bug
     60
     61
     62
    5963
    6064== Upgrade notice ==
  • wp-pocket/trunk/wp-pocket.php

    r599051 r599294  
    66    Author: Jan Karres
    77    Author URI: http://www.jankarres.de/
    8     Version: 1.0.1
     8    Version: 1.0.
    99*/
    1010
     
    1212    class wppocketer {
    1313        private $wpdb;
     14
    1415       
    1516        // Pocket default API-Key by developer
     
    2122            // Set database
    2223            $this->wpdb = $wpdb;
     24
     25
     26
    2327       
    2428            // Check WP version
     
    6670
    6771        function activate() {
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
    6884            // Create database table for links
    6985            $sql = '
     
    84100                `autoload`
    85101            ) VALUES
     102
    86103                ("wppocket_links_to_use", "0", "yes"),
    87104                ("wppocket_order", "0", "yes"),
     
    115132            ';
    116133            $this->wpdb->query($sql);
     134
     135
     136
     137
     138
     139
    117140        }
    118141
     
    138161       
    139162        // En- and decrypt strings
    140         private function xcrypt($mode, $string) {
     163        private function xcrypt($mode, $string) {
    141164            /*
    142165             * Required parameters:
     
    145168             */
    146169           
    147             // Get crypt keys
    148             $sql = 'SELECT `wppocket_key_a`, `wppocket_key_b` FROM `' . $this->wpdb->prefix . 'options`';
    149             $keys = $this->wpdb->get_row($sql);
     170            // Get crypt keys, if should
     171            if (!$nosalt) {
     172                $keys['a'] = get_option('wppocket_key_a');
     173                $key['b'] = get_option('wppocket_key_b');
     174            }
    150175           
    151176            if ($mode == 0) { // Encrypt
    152                 return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($keys->wppocket_key_a), $string, MCRYPT_MODE_CBC, md5(md5($keys->wppocket_key_b))));
     177                return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($keys))));
    153178            }elseif ($mode == 1) { // Decrypt
    154                 return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($keys->wppocket_key_a), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($keys->wppocket_key_b))), "\0");
     179                return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($keys))), "\0");
    155180            }else { // False mode
    156181                return false;
Note: See TracChangeset for help on using the changeset viewer.