Changeset 599294
- Timestamp:
- 09/15/2012 02:17:51 PM (12 years ago)
- Location:
- wp-pocket
- Files:
-
- 2 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
wp-pocket/tags/1.0.2/readme.txt
r598959 r599294 5 5 Requires at least: 3.4 6 6 Tested up to: 3.4 7 Stable tag: 1.0. 17 Stable tag: 1.0. 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Changelog == 53 53 54 = 1.0 = 55 Initial release 54 = 1.0.2 = 55 Fix encryption bug of the Pocket username, password and api key 56 Introduce version number in class 56 57 57 58 = 1.0.1 = 58 59 Fix encoding bug 60 61 62 59 63 60 64 == Upgrade notice == -
wp-pocket/tags/1.0.2/wp-pocket.php
r599051 r599294 6 6 Author: Jan Karres 7 7 Author URI: http://www.jankarres.de/ 8 Version: 1.0. 18 Version: 1.0. 9 9 */ 10 10 … … 12 12 class wppocketer { 13 13 private $wpdb; 14 14 15 15 16 // Pocket default API-Key by developer … … 21 22 // Set database 22 23 $this->wpdb = $wpdb; 24 25 26 23 27 24 28 // Check WP version … … 66 70 67 71 function activate() { 72 73 74 75 76 77 78 79 80 81 82 83 68 84 // Create database table for links 69 85 $sql = ' … … 84 100 `autoload` 85 101 ) VALUES 102 86 103 ("wppocket_links_to_use", "0", "yes"), 87 104 ("wppocket_order", "0", "yes"), … … 115 132 '; 116 133 $this->wpdb->query($sql); 134 135 136 137 138 139 117 140 } 118 141 … … 138 161 139 162 // En- and decrypt strings 140 private function xcrypt($mode, $string ) {163 private function xcrypt($mode, $string) { 141 164 /* 142 165 * Required parameters: … … 145 168 */ 146 169 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 } 150 175 151 176 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)))); 153 178 }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"); 155 180 }else { // False mode 156 181 return false; -
wp-pocket/trunk/readme.txt
r598959 r599294 5 5 Requires at least: 3.4 6 6 Tested up to: 3.4 7 Stable tag: 1.0. 17 Stable tag: 1.0. 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Changelog == 53 53 54 = 1.0 = 55 Initial release 54 = 1.0.2 = 55 Fix encryption bug of the Pocket username, password and api key 56 Introduce version number in class 56 57 57 58 = 1.0.1 = 58 59 Fix encoding bug 60 61 62 59 63 60 64 == Upgrade notice == -
wp-pocket/trunk/wp-pocket.php
r599051 r599294 6 6 Author: Jan Karres 7 7 Author URI: http://www.jankarres.de/ 8 Version: 1.0. 18 Version: 1.0. 9 9 */ 10 10 … … 12 12 class wppocketer { 13 13 private $wpdb; 14 14 15 15 16 // Pocket default API-Key by developer … … 21 22 // Set database 22 23 $this->wpdb = $wpdb; 24 25 26 23 27 24 28 // Check WP version … … 66 70 67 71 function activate() { 72 73 74 75 76 77 78 79 80 81 82 83 68 84 // Create database table for links 69 85 $sql = ' … … 84 100 `autoload` 85 101 ) VALUES 102 86 103 ("wppocket_links_to_use", "0", "yes"), 87 104 ("wppocket_order", "0", "yes"), … … 115 132 '; 116 133 $this->wpdb->query($sql); 134 135 136 137 138 139 117 140 } 118 141 … … 138 161 139 162 // En- and decrypt strings 140 private function xcrypt($mode, $string ) {163 private function xcrypt($mode, $string) { 141 164 /* 142 165 * Required parameters: … … 145 168 */ 146 169 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 } 150 175 151 176 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)))); 153 178 }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"); 155 180 }else { // False mode 156 181 return false;
Note: See TracChangeset
for help on using the changeset viewer.