Google Doc Embedder - Version 2.5.4

Version Description

  • Fixed: Force download option gives PHP error (thanks Zverina)
  • Fixed: Force download breaks on filenames with multiple extensions
  • Fixed: Numeric-only profile names accepted (conflict with IDs)
  • Fixed: Can't validate redirected URLs (thanks onesoftindiana)
  • Fixed: Duplicating table indexes when logging enabled
Download this release

Release Info

Developer k3davis
Plugin Icon wp plugin Google Doc Embedder
Version 2.5.4
Comparing to
See all releases

Code changes from version 2.5.3 to 2.5.4

Files changed (8) hide show
  1. functions.php +49 -24
  2. gviewer.php +6 -4
  3. languages/gde-en_US.mo +0 -0
  4. languages/gde-en_US.po +37 -33
  5. languages/gde.pot +37 -33
  6. load.php +8 -9
  7. options.php +4 -1
  8. readme.txt +8 -7
functions.php CHANGED
@@ -114,7 +114,7 @@ function gde_validate_file( $file = NULL, $force ) {
114
  }
115
 
116
  $result = gde_valid_url( $file );
117
- if ( $result === true ) {
118
  // validation skipped due to service failure
119
  return -1;
120
  } elseif ( $force == "1" || $force == "yes" ) {
@@ -177,24 +177,40 @@ function gde_valid_type( $link ) {
177
  }
178
  }
179
 
180
- function gde_valid_url( $url ) {
181
- $result = wp_remote_head( $url );
 
 
 
 
 
 
 
 
 
 
182
  if ( is_array( $result ) ) {
183
- // capture file size if determined
184
- if ( isset( $result['headers']['content-length'] ) ) {
185
- $result['response']['fsize'] = $result['headers']['content-length'];
 
186
  } else {
187
- $result['response']['fsize'] = '';
 
 
 
 
 
 
188
  }
189
- return $result['response'];
190
  } elseif ( is_wp_error( $result ) ) {
191
  // unable to get head
192
  $error = $result->get_error_message();
193
  gde_dx_log("bypassing URL check; cant validate URL $url: $error");
194
- return true;
195
  } else {
196
  gde_dx_log("cant determine URL validity; skipping");
197
- return true;
198
  }
199
  }
200
 
@@ -213,7 +229,7 @@ function gde_format_bytes( $bytes, $precision = 2 ) {
213
  if ( ! is_numeric( $bytes ) || $bytes < 1 ) {
214
  return __('Unknown', 'gde');
215
  } else {
216
- $units = array( 'B', 'KB', 'MB', 'GB', 'TB' );
217
 
218
  $bytes = max( $bytes, 0 );
219
  $pow = floor( ( $bytes ? log( $bytes ) : 0 ) / log( 1024 ) );
@@ -297,7 +313,7 @@ function gde_get_short_url( $u ) {
297
  * @return string Secure URL, or false on error
298
  */
299
  function gde_get_secure_url( $u ) {
300
- require_once('libs/lib-secure.php');
301
 
302
  if ( ! $url = gde_make_secure_url( $u ) ) {
303
  return false;
@@ -423,28 +439,37 @@ function gde_dx_log( $text ) {
423
  * @return bool Whether or not table creation/update was successful
424
  */
425
  function gde_dx_log_create() {
426
- global $wpdb, $gde_db_ver;
427
-
428
- $db_ver_installed = get_site_option( 'gde_db_version', 0 );
429
 
430
  $table = $wpdb->base_prefix . 'gde_dx_log';
431
-
 
432
  $sql = "CREATE TABLE " . $table . " (
433
  id mediumint(9) UNSIGNED NOT NULL AUTO_INCREMENT,
434
  blogid smallint(5) UNSIGNED NOT NULL,
435
  data longtext NOT NULL,
436
  UNIQUE KEY (id)
437
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8; ";
438
-
439
- // write table to database
440
- require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
441
- dbDelta( $sql );
442
-
443
- if ( $wpdb->get_var( "SHOW TABLES LIKE '$table'" ) == $table ) {
 
444
  return true;
445
  } else {
446
- // table count not be written
447
- return false;
 
 
 
 
 
 
 
 
 
448
  }
449
  }
450
 
114
  }
115
 
116
  $result = gde_valid_url( $file );
117
+ if ( $result === false ) {
118
  // validation skipped due to service failure
119
  return -1;
120
  } elseif ( $force == "1" || $force == "yes" ) {
177
  }
178
  }
179
 
180
+ function gde_valid_url( $url, $method = "head", $stop = 0 ) {
181
+
182
+ if ( $method == "head" ) {
183
+ $result = wp_remote_head( $url );
184
+ } elseif ( $stop == 0 ) {
185
+ $stop++;
186
+ $result = wp_remote_get( $url );
187
+ } else {
188
+ gde_dx_log("can't get URL to test; skipping");
189
+ return false;
190
+ }
191
+
192
  if ( is_array( $result ) ) {
193
+ $code = $result['response']['code'];
194
+ if ( ! empty( $code ) && ( $code == "301" || $code == "302" ) ) {
195
+ // HEAD requests don't redirect. Probably a file/directory with spaces in it...
196
+ return gde_valid_url( $url, 'get', $stop );
197
  } else {
198
+ // capture file size if determined
199
+ if ( isset( $result['headers']['content-length'] ) ) {
200
+ $result['response']['fsize'] = $result['headers']['content-length'];
201
+ } else {
202
+ $result['response']['fsize'] = '';
203
+ }
204
+ return $result['response'];
205
  }
 
206
  } elseif ( is_wp_error( $result ) ) {
207
  // unable to get head
208
  $error = $result->get_error_message();
209
  gde_dx_log("bypassing URL check; cant validate URL $url: $error");
210
+ return false;
211
  } else {
212
  gde_dx_log("cant determine URL validity; skipping");
213
+ return false;
214
  }
215
  }
216
 
229
  if ( ! is_numeric( $bytes ) || $bytes < 1 ) {
230
  return __('Unknown', 'gde');
231
  } else {
232
+ $units = array( 'B', 'KB', __('MB', 'gde'), 'GB', 'TB' );
233
 
234
  $bytes = max( $bytes, 0 );
235
  $pow = floor( ( $bytes ? log( $bytes ) : 0 ) / log( 1024 ) );
313
  * @return string Secure URL, or false on error
314
  */
315
  function gde_get_secure_url( $u ) {
316
+ require_once( GDE_PLUGIN_DIR . 'libs/lib-secure.php' );
317
 
318
  if ( ! $url = gde_make_secure_url( $u ) ) {
319
  return false;
439
  * @return bool Whether or not table creation/update was successful
440
  */
441
  function gde_dx_log_create() {
442
+ global $wpdb;
 
 
443
 
444
  $table = $wpdb->base_prefix . 'gde_dx_log';
445
+ $db_ver_installed = get_site_option( 'gde_db_version', 0 );
446
+
447
  $sql = "CREATE TABLE " . $table . " (
448
  id mediumint(9) UNSIGNED NOT NULL AUTO_INCREMENT,
449
  blogid smallint(5) UNSIGNED NOT NULL,
450
  data longtext NOT NULL,
451
  UNIQUE KEY (id)
452
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8; ";
453
+
454
+ if ( version_compare( GDE_DB_VER, $db_ver_installed, ">" ) ) {
455
+ // upgrade table if needed
456
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
457
+ dbDelta( $sql );
458
+ } elseif ( $wpdb->get_var( "SHOW TABLES LIKE '$table'" ) == $table ) {
459
+ // table's OK
460
  return true;
461
  } else {
462
+ // table doesn't exist, try to create
463
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
464
+ dbDelta( $sql );
465
+
466
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '$table'" ) == $table ) {
467
+ // table's OK
468
+ return true;
469
+ } else {
470
+ // can't create
471
+ return false;
472
+ }
473
  }
474
  }
475
 
gviewer.php CHANGED
@@ -8,11 +8,11 @@ Author: Kevin Davis
8
  Author URI: http://www.davistribe.org/
9
  Text Domain: gde
10
  Domain Path: /languages/
11
- Version: 2.5.3
12
  License: GPLv2
13
  */
14
 
15
- $gde_ver = "2.5.3.98";
16
 
17
  /**
18
  * LICENSE
@@ -47,6 +47,8 @@ $healthy = gde_debug_tables( 'gde_profiles' );
47
  $gdetypes = gde_supported_types();
48
  global $wp_version;
49
 
 
 
50
  // get global settings
51
  if ( is_multisite() ) {
52
  $gdeglobals = get_site_option( 'gde_globals' );
@@ -165,7 +167,7 @@ function gde_do_shortcode( $atts ) {
165
  // remove any preceding slash from doc (base URL adds it)
166
  $file = ltrim( $file, '/' );
167
  }
168
- $file = $profile['base_url'].$file;
169
  }
170
  }
171
 
@@ -366,7 +368,7 @@ if ( is_admin() ) {
366
  * @note This function must remain in this file
367
  */
368
  function gde_activate( $network_wide ) {
369
- // set db schema version for this release
370
  @define( 'GDE_DB_VER', '1.2' );
371
 
372
  // check for network-wide activation (currently not supported)
8
  Author URI: http://www.davistribe.org/
9
  Text Domain: gde
10
  Domain Path: /languages/
11
+ Version: 2.5.4
12
  License: GPLv2
13
  */
14
 
15
+ $gde_ver = "2.5.4.98";
16
 
17
  /**
18
  * LICENSE
47
  $gdetypes = gde_supported_types();
48
  global $wp_version;
49
 
50
+ @define( 'GDE_DB_VER', '1.2' ); // when updated, also update gde_activate()
51
+
52
  // get global settings
53
  if ( is_multisite() ) {
54
  $gdeglobals = get_site_option( 'gde_globals' );
167
  // remove any preceding slash from doc (base URL adds it)
168
  $file = ltrim( $file, '/' );
169
  }
170
+ $file = $profile['base_url'] . $file;
171
  }
172
  }
173
 
368
  * @note This function must remain in this file
369
  */
370
  function gde_activate( $network_wide ) {
371
+ // set db schema version for this release - global not available here
372
  @define( 'GDE_DB_VER', '1.2' );
373
 
374
  // check for network-wide activation (currently not supported)
languages/gde-en_US.mo CHANGED
Binary file
languages/gde-en_US.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Google Doc Embedder\n"
4
- "POT-Creation-Date: 2012-12-17 13:59-0600\n"
5
- "PO-Revision-Date: 2012-12-17 14:00-0600\n"
6
  "Last-Translator: Kevin Davis <wpp@tnw.org>\n"
7
  "Language-Team: Kevin Davis <wpp@tnw.org>\n"
8
  "MIME-Version: 1.0\n"
@@ -41,7 +41,7 @@ msgstr ""
41
  msgid "Importing settings... "
42
  msgstr ""
43
 
44
- #: functions-admin.php:320 functions-admin.php:563 options.php:138
45
  msgid "Please select a valid export file to import."
46
  msgstr ""
47
 
@@ -57,7 +57,7 @@ msgstr ""
57
  msgid "Return to GDE Settings"
58
  msgstr ""
59
 
60
- #: functions-admin.php:406 functions-admin.php:532 options.php:165
61
  #: libs/tab-advanced.php:145
62
  msgid "Settings"
63
  msgstr ""
@@ -117,49 +117,49 @@ msgid ""
117
  "this space for important updates."
118
  msgstr ""
119
 
120
- #: functions.php:101
121
  msgid "File not specified, check shortcode syntax"
122
  msgstr ""
123
 
124
- #: functions.php:102
125
  msgid "Requested URL is invalid"
126
  msgstr ""
127
 
128
- #: functions.php:103
129
  msgid "Unsupported File Type"
130
  msgstr ""
131
 
132
- #: functions.php:104
133
  msgid "Error retrieving file - if necessary turn off error checking"
134
  msgstr ""
135
 
136
- #: functions.php:204
137
  msgid "Unknown"
138
  msgstr ""
139
 
140
  # Megabytes (for file size reporting)
141
- #: functions.php:206 libs/tab-advanced.php:40
142
  msgid "MB"
143
  msgstr ""
144
 
145
- #: functions.php:333 gviewer.php:294 libs/lib-setup.php:88
146
  #: libs/lib-setup.php:136
147
  msgid "Download"
148
  msgstr ""
149
 
150
- #: functions.php:458 view.php:399
151
  msgid "Error"
152
  msgstr ""
153
 
154
- #: gviewer.php:71
155
  msgid "Unable to load profile settings"
156
  msgstr ""
157
 
158
- #: gviewer.php:106 gviewer.php:118
159
  msgid "Unable to load requested profile."
160
  msgstr ""
161
 
162
- #: gviewer.php:228
163
  msgid "Unable to secure document"
164
  msgstr ""
165
 
@@ -180,79 +180,83 @@ msgstr ""
180
  msgid "Unable to open the requested file. "
181
  msgstr ""
182
 
183
- #: load.php:93 load.php:97
184
  msgid "The document file type is not supported."
185
  msgstr ""
186
 
187
- #: options.php:13 options.php:65
188
  msgid "Default profile <strong>updated</strong>."
189
  msgstr ""
190
 
191
- #: options.php:15 options.php:50
192
  msgid "Unable to update profile."
193
  msgstr ""
194
 
195
  #: options.php:28
 
 
 
 
196
  msgid "Profile name already exists. Please choose another name."
197
  msgstr ""
198
 
199
- #: options.php:35
200
  msgid "New profile <strong>created</strong>."
201
  msgstr ""
202
 
203
- #: options.php:37 options.php:40
204
  msgid "Unable to create profile."
205
  msgstr ""
206
 
207
- #: options.php:48
208
  msgid "Profile <strong>updated</strong>."
209
  msgstr ""
210
 
211
- #: options.php:58
212
  msgid "Profile <strong>deleted</strong>."
213
  msgstr ""
214
 
215
- #: options.php:60
216
  msgid "Unable to delete profile."
217
  msgstr ""
218
 
219
- #: options.php:102
220
  msgid "Unable to enable diagnostic logging."
221
  msgstr ""
222
 
223
- #: options.php:114 options.php:116
224
  msgid "Settings <strong>updated</strong>."
225
  msgstr ""
226
 
227
- #: options.php:174 options.php:187
228
  msgid "General"
229
  msgstr ""
230
 
231
- #: options.php:179 options.php:192 libs/tab-advanced.php:144
232
  msgid "Profiles"
233
  msgstr ""
234
 
235
- #: options.php:200
236
  msgid "Advanced"
237
  msgstr ""
238
 
239
- #: options.php:205
240
  msgid "Support"
241
  msgstr ""
242
 
243
- #: options.php:343
244
  msgid "Help"
245
  msgstr ""
246
 
247
- #: options.php:369
248
  msgid "Edit"
249
  msgstr ""
250
 
251
- #: options.php:370
252
  msgid "Delete"
253
  msgstr ""
254
 
255
- #: options.php:371
256
  msgid "Make Default"
257
  msgstr ""
258
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Google Doc Embedder\n"
4
+ "POT-Creation-Date: 2012-12-20 08:12-0600\n"
5
+ "PO-Revision-Date: 2012-12-20 08:12-0600\n"
6
  "Last-Translator: Kevin Davis <wpp@tnw.org>\n"
7
  "Language-Team: Kevin Davis <wpp@tnw.org>\n"
8
  "MIME-Version: 1.0\n"
41
  msgid "Importing settings... "
42
  msgstr ""
43
 
44
+ #: functions-admin.php:320 functions-admin.php:563 options.php:141
45
  msgid "Please select a valid export file to import."
46
  msgstr ""
47
 
57
  msgid "Return to GDE Settings"
58
  msgstr ""
59
 
60
+ #: functions-admin.php:406 functions-admin.php:532 options.php:168
61
  #: libs/tab-advanced.php:145
62
  msgid "Settings"
63
  msgstr ""
117
  "this space for important updates."
118
  msgstr ""
119
 
120
+ #: functions.php:107
121
  msgid "File not specified, check shortcode syntax"
122
  msgstr ""
123
 
124
+ #: functions.php:108
125
  msgid "Requested URL is invalid"
126
  msgstr ""
127
 
128
+ #: functions.php:109
129
  msgid "Unsupported File Type"
130
  msgstr ""
131
 
132
+ #: functions.php:110
133
  msgid "Error retrieving file - if necessary turn off error checking"
134
  msgstr ""
135
 
136
+ #: functions.php:214
137
  msgid "Unknown"
138
  msgstr ""
139
 
140
  # Megabytes (for file size reporting)
141
+ #: functions.php:216 libs/tab-advanced.php:40
142
  msgid "MB"
143
  msgstr ""
144
 
145
+ #: functions.php:343 gviewer.php:295 libs/lib-setup.php:88
146
  #: libs/lib-setup.php:136
147
  msgid "Download"
148
  msgstr ""
149
 
150
+ #: functions.php:468 view.php:399
151
  msgid "Error"
152
  msgstr ""
153
 
154
+ #: gviewer.php:72
155
  msgid "Unable to load profile settings"
156
  msgstr ""
157
 
158
+ #: gviewer.php:107 gviewer.php:119
159
  msgid "Unable to load requested profile."
160
  msgstr ""
161
 
162
+ #: gviewer.php:229
163
  msgid "Unable to secure document"
164
  msgstr ""
165
 
180
  msgid "Unable to open the requested file. "
181
  msgstr ""
182
 
183
+ #: load.php:92 load.php:96
184
  msgid "The document file type is not supported."
185
  msgstr ""
186
 
187
+ #: options.php:13 options.php:68
188
  msgid "Default profile <strong>updated</strong>."
189
  msgstr ""
190
 
191
+ #: options.php:15 options.php:53
192
  msgid "Unable to update profile."
193
  msgstr ""
194
 
195
  #: options.php:28
196
+ msgid "Profile name must contain at least one letter."
197
+ msgstr ""
198
+
199
+ #: options.php:31
200
  msgid "Profile name already exists. Please choose another name."
201
  msgstr ""
202
 
203
+ #: options.php:38
204
  msgid "New profile <strong>created</strong>."
205
  msgstr ""
206
 
207
+ #: options.php:40 options.php:43
208
  msgid "Unable to create profile."
209
  msgstr ""
210
 
211
+ #: options.php:51
212
  msgid "Profile <strong>updated</strong>."
213
  msgstr ""
214
 
215
+ #: options.php:61
216
  msgid "Profile <strong>deleted</strong>."
217
  msgstr ""
218
 
219
+ #: options.php:63
220
  msgid "Unable to delete profile."
221
  msgstr ""
222
 
223
+ #: options.php:105
224
  msgid "Unable to enable diagnostic logging."
225
  msgstr ""
226
 
227
+ #: options.php:117 options.php:119
228
  msgid "Settings <strong>updated</strong>."
229
  msgstr ""
230
 
231
+ #: options.php:177 options.php:190
232
  msgid "General"
233
  msgstr ""
234
 
235
+ #: options.php:182 options.php:195 libs/tab-advanced.php:144
236
  msgid "Profiles"
237
  msgstr ""
238
 
239
+ #: options.php:203
240
  msgid "Advanced"
241
  msgstr ""
242
 
243
+ #: options.php:208
244
  msgid "Support"
245
  msgstr ""
246
 
247
+ #: options.php:346
248
  msgid "Help"
249
  msgstr ""
250
 
251
+ #: options.php:372
252
  msgid "Edit"
253
  msgstr ""
254
 
255
+ #: options.php:373
256
  msgid "Delete"
257
  msgstr ""
258
 
259
+ #: options.php:374
260
  msgid "Make Default"
261
  msgstr ""
262
 
languages/gde.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Google Doc Embedder\n"
4
- "POT-Creation-Date: 2012-12-17 13:59-0600\n"
5
- "PO-Revision-Date: 2012-12-17 14:00-0600\n"
6
  "Last-Translator: Kevin Davis <wpp@tnw.org>\n"
7
  "Language-Team: Kevin Davis <wpp@tnw.org>\n"
8
  "MIME-Version: 1.0\n"
@@ -41,7 +41,7 @@ msgstr ""
41
  msgid "Importing settings... "
42
  msgstr ""
43
 
44
- #: functions-admin.php:320 functions-admin.php:563 options.php:138
45
  msgid "Please select a valid export file to import."
46
  msgstr ""
47
 
@@ -57,7 +57,7 @@ msgstr ""
57
  msgid "Return to GDE Settings"
58
  msgstr ""
59
 
60
- #: functions-admin.php:406 functions-admin.php:532 options.php:165
61
  #: libs/tab-advanced.php:145
62
  msgid "Settings"
63
  msgstr ""
@@ -117,49 +117,49 @@ msgid ""
117
  "this space for important updates."
118
  msgstr ""
119
 
120
- #: functions.php:101
121
  msgid "File not specified, check shortcode syntax"
122
  msgstr ""
123
 
124
- #: functions.php:102
125
  msgid "Requested URL is invalid"
126
  msgstr ""
127
 
128
- #: functions.php:103
129
  msgid "Unsupported File Type"
130
  msgstr ""
131
 
132
- #: functions.php:104
133
  msgid "Error retrieving file - if necessary turn off error checking"
134
  msgstr ""
135
 
136
- #: functions.php:204
137
  msgid "Unknown"
138
  msgstr ""
139
 
140
  # Megabytes (for file size reporting)
141
- #: functions.php:206 libs/tab-advanced.php:40
142
  msgid "MB"
143
  msgstr ""
144
 
145
- #: functions.php:333 gviewer.php:294 libs/lib-setup.php:88
146
  #: libs/lib-setup.php:136
147
  msgid "Download"
148
  msgstr ""
149
 
150
- #: functions.php:458 view.php:399
151
  msgid "Error"
152
  msgstr ""
153
 
154
- #: gviewer.php:71
155
  msgid "Unable to load profile settings"
156
  msgstr ""
157
 
158
- #: gviewer.php:106 gviewer.php:118
159
  msgid "Unable to load requested profile."
160
  msgstr ""
161
 
162
- #: gviewer.php:228
163
  msgid "Unable to secure document"
164
  msgstr ""
165
 
@@ -180,79 +180,83 @@ msgstr ""
180
  msgid "Unable to open the requested file. "
181
  msgstr ""
182
 
183
- #: load.php:93 load.php:97
184
  msgid "The document file type is not supported."
185
  msgstr ""
186
 
187
- #: options.php:13 options.php:65
188
  msgid "Default profile <strong>updated</strong>."
189
  msgstr ""
190
 
191
- #: options.php:15 options.php:50
192
  msgid "Unable to update profile."
193
  msgstr ""
194
 
195
  #: options.php:28
 
 
 
 
196
  msgid "Profile name already exists. Please choose another name."
197
  msgstr ""
198
 
199
- #: options.php:35
200
  msgid "New profile <strong>created</strong>."
201
  msgstr ""
202
 
203
- #: options.php:37 options.php:40
204
  msgid "Unable to create profile."
205
  msgstr ""
206
 
207
- #: options.php:48
208
  msgid "Profile <strong>updated</strong>."
209
  msgstr ""
210
 
211
- #: options.php:58
212
  msgid "Profile <strong>deleted</strong>."
213
  msgstr ""
214
 
215
- #: options.php:60
216
  msgid "Unable to delete profile."
217
  msgstr ""
218
 
219
- #: options.php:102
220
  msgid "Unable to enable diagnostic logging."
221
  msgstr ""
222
 
223
- #: options.php:114 options.php:116
224
  msgid "Settings <strong>updated</strong>."
225
  msgstr ""
226
 
227
- #: options.php:174 options.php:187
228
  msgid "General"
229
  msgstr ""
230
 
231
- #: options.php:179 options.php:192 libs/tab-advanced.php:144
232
  msgid "Profiles"
233
  msgstr ""
234
 
235
- #: options.php:200
236
  msgid "Advanced"
237
  msgstr ""
238
 
239
- #: options.php:205
240
  msgid "Support"
241
  msgstr ""
242
 
243
- #: options.php:343
244
  msgid "Help"
245
  msgstr ""
246
 
247
- #: options.php:369
248
  msgid "Edit"
249
  msgstr ""
250
 
251
- #: options.php:370
252
  msgid "Delete"
253
  msgstr ""
254
 
255
- #: options.php:371
256
  msgid "Make Default"
257
  msgstr ""
258
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Google Doc Embedder\n"
4
+ "POT-Creation-Date: 2012-12-20 08:12-0600\n"
5
+ "PO-Revision-Date: 2012-12-20 08:12-0600\n"
6
  "Last-Translator: Kevin Davis <wpp@tnw.org>\n"
7
  "Language-Team: Kevin Davis <wpp@tnw.org>\n"
8
  "MIME-Version: 1.0\n"
41
  msgid "Importing settings... "
42
  msgstr ""
43
 
44
+ #: functions-admin.php:320 functions-admin.php:563 options.php:141
45
  msgid "Please select a valid export file to import."
46
  msgstr ""
47
 
57
  msgid "Return to GDE Settings"
58
  msgstr ""
59
 
60
+ #: functions-admin.php:406 functions-admin.php:532 options.php:168
61
  #: libs/tab-advanced.php:145
62
  msgid "Settings"
63
  msgstr ""
117
  "this space for important updates."
118
  msgstr ""
119
 
120
+ #: functions.php:107
121
  msgid "File not specified, check shortcode syntax"
122
  msgstr ""
123
 
124
+ #: functions.php:108
125
  msgid "Requested URL is invalid"
126
  msgstr ""
127
 
128
+ #: functions.php:109
129
  msgid "Unsupported File Type"
130
  msgstr ""
131
 
132
+ #: functions.php:110
133
  msgid "Error retrieving file - if necessary turn off error checking"
134
  msgstr ""
135
 
136
+ #: functions.php:214
137
  msgid "Unknown"
138
  msgstr ""
139
 
140
  # Megabytes (for file size reporting)
141
+ #: functions.php:216 libs/tab-advanced.php:40
142
  msgid "MB"
143
  msgstr ""
144
 
145
+ #: functions.php:343 gviewer.php:295 libs/lib-setup.php:88
146
  #: libs/lib-setup.php:136
147
  msgid "Download"
148
  msgstr ""
149
 
150
+ #: functions.php:468 view.php:399
151
  msgid "Error"
152
  msgstr ""
153
 
154
+ #: gviewer.php:72
155
  msgid "Unable to load profile settings"
156
  msgstr ""
157
 
158
+ #: gviewer.php:107 gviewer.php:119
159
  msgid "Unable to load requested profile."
160
  msgstr ""
161
 
162
+ #: gviewer.php:229
163
  msgid "Unable to secure document"
164
  msgstr ""
165
 
180
  msgid "Unable to open the requested file. "
181
  msgstr ""
182
 
183
+ #: load.php:92 load.php:96
184
  msgid "The document file type is not supported."
185
  msgstr ""
186
 
187
+ #: options.php:13 options.php:68
188
  msgid "Default profile <strong>updated</strong>."
189
  msgstr ""
190
 
191
+ #: options.php:15 options.php:53
192
  msgid "Unable to update profile."
193
  msgstr ""
194
 
195
  #: options.php:28
196
+ msgid "Profile name must contain at least one letter."
197
+ msgstr ""
198
+
199
+ #: options.php:31
200
  msgid "Profile name already exists. Please choose another name."
201
  msgstr ""
202
 
203
+ #: options.php:38
204
  msgid "New profile <strong>created</strong>."
205
  msgstr ""
206
 
207
+ #: options.php:40 options.php:43
208
  msgid "Unable to create profile."
209
  msgstr ""
210
 
211
+ #: options.php:51
212
  msgid "Profile <strong>updated</strong>."
213
  msgstr ""
214
 
215
+ #: options.php:61
216
  msgid "Profile <strong>deleted</strong>."
217
  msgstr ""
218
 
219
+ #: options.php:63
220
  msgid "Unable to delete profile."
221
  msgstr ""
222
 
223
+ #: options.php:105
224
  msgid "Unable to enable diagnostic logging."
225
  msgstr ""
226
 
227
+ #: options.php:117 options.php:119
228
  msgid "Settings <strong>updated</strong>."
229
  msgstr ""
230
 
231
+ #: options.php:177 options.php:190
232
  msgid "General"
233
  msgstr ""
234
 
235
+ #: options.php:182 options.php:195 libs/tab-advanced.php:144
236
  msgid "Profiles"
237
  msgstr ""
238
 
239
+ #: options.php:203
240
  msgid "Advanced"
241
  msgstr ""
242
 
243
+ #: options.php:208
244
  msgid "Support"
245
  msgstr ""
246
 
247
+ #: options.php:346
248
  msgid "Help"
249
  msgstr ""
250
 
251
+ #: options.php:372
252
  msgid "Edit"
253
  msgstr ""
254
 
255
+ #: options.php:373
256
  msgid "Delete"
257
  msgstr ""
258
 
259
+ #: options.php:374
260
  msgid "Make Default"
261
  msgstr ""
262
 
load.php CHANGED
@@ -75,20 +75,19 @@ if ( ! $contents || empty( $contents ) ) {
75
  // got nothing of merit
76
  wp_die( __('Unable to open the requested file. ', 'gde') );
77
  } else {
 
 
78
  // filename (without query string, in case of non-cached doc)
79
  $fn = strtok( basename( $data['url'] ), '?' );
80
-
81
  // get ext
82
- $ext = explode( ".", $fn );
83
- if ( isset( $ext[1]) ) {
84
- $ext = strtolower( $ext[1] );
85
-
86
- $no_output = 1;
87
- require_once( GDE_PLUGIN_DIR . 'libs/lib-exts.php' );
88
 
89
  // get mime type
90
- if ( array_key_exists( $ext, $types) ) {
91
- $type = $types[$ext];
92
  } else {
93
  wp_die( __('The document file type is not supported.', 'gde') );
94
  }
75
  // got nothing of merit
76
  wp_die( __('Unable to open the requested file. ', 'gde') );
77
  } else {
78
+ global $gdetypes;
79
+
80
  // filename (without query string, in case of non-cached doc)
81
  $fn = strtok( basename( $data['url'] ), '?' );
 
82
  // get ext
83
+ $ext = end( explode( ".", $fn ) );
84
+
85
+ if ( isset( $ext ) ) {
86
+ $ext = strtolower( $ext );
 
 
87
 
88
  // get mime type
89
+ if ( array_key_exists( $ext, $gdetypes ) ) {
90
+ $type = $gdetypes[$ext];
91
  } else {
92
  wp_die( __('The document file type is not supported.', 'gde') );
93
  }
options.php CHANGED
@@ -23,7 +23,10 @@ if ( isset( $_POST['_general_default'] ) ) {
23
  $name = preg_replace( "/[^A-Za-z0-9 -]/", '', $_POST['profile-name'] );
24
  $name = strtolower( str_replace( " ", "-", $name ) );
25
 
26
- if ( gde_profile_name_exists( $name ) !== -1 ) {
 
 
 
27
  // profile name is duplicate
28
  gde_show_msg( __('Profile name already exists. Please choose another name.', 'gde'), true );
29
  } elseif ( gde_profile_to_profile( $_POST['parent'], $name, stripslashes( $_POST['description'] ) ) ) {
23
  $name = preg_replace( "/[^A-Za-z0-9 -]/", '', $_POST['profile-name'] );
24
  $name = strtolower( str_replace( " ", "-", $name ) );
25
 
26
+ if ( ! preg_match( '/[\pL]/u', $name ) ) {
27
+ // profile name doesn't contain any letter - possible ID conflict
28
+ gde_show_msg( __('Profile name must contain at least one letter.', 'gde'), true );
29
+ } elseif ( gde_profile_name_exists( $name ) !== -1 ) {
30
  // profile name is duplicate
31
  gde_show_msg( __('Profile name already exists. Please choose another name.', 'gde'), true );
32
  } elseif ( gde_profile_to_profile( $_POST['parent'], $name, stripslashes( $_POST['description'] ) ) ) {
readme.txt CHANGED
@@ -137,6 +137,13 @@ More common questions are answered on the GDE web site [here](http://www.davistr
137
 
138
  (E) Enhanced Viewer
139
 
 
 
 
 
 
 
 
140
  = 2.5.3 =
141
  * Fixed: Unsupported file type regression interferes with some uploads
142
 
@@ -217,15 +224,9 @@ More common questions are answered on the GDE web site [here](http://www.davistr
217
  * Fixed: URL changes for plugin, help links, beta checking
218
  * Fixed: (E) "Moved Temporarily" error (thanks webmonkeywatts)
219
 
220
- = 2.3 =
221
- * Added: Option to set base URL for embedded files (thanks KevEd)
222
- * Added: Option to show error messages inline instead of as HTML comments
223
- * Added: File type check in editor dialog
224
- * Fixed: Download Link setting didn't update shortcode in editor dialog
225
-
226
  [Full history...](http://www.davistribe.org/gde/changelog/ "Full history")
227
 
228
  == Upgrade Notice ==
229
 
230
- = 2.5.3 =
231
  Bug fix release
137
 
138
  (E) Enhanced Viewer
139
 
140
+ = 2.5.4 =
141
+ * Fixed: Force download option gives PHP error (thanks Zverina)
142
+ * Fixed: Force download breaks on filenames with multiple extensions
143
+ * Fixed: Numeric-only profile names accepted (conflict with IDs)
144
+ * Fixed: Can't validate redirected URLs (thanks onesoftindiana)
145
+ * Fixed: Duplicating table indexes when logging enabled
146
+
147
  = 2.5.3 =
148
  * Fixed: Unsupported file type regression interferes with some uploads
149
 
224
  * Fixed: URL changes for plugin, help links, beta checking
225
  * Fixed: (E) "Moved Temporarily" error (thanks webmonkeywatts)
226
 
 
 
 
 
 
 
227
  [Full history...](http://www.davistribe.org/gde/changelog/ "Full history")
228
 
229
  == Upgrade Notice ==
230
 
231
+ = 2.5.4 =
232
  Bug fix release