Changeset 1351860
- Timestamp:
- 02/16/2016 01:54:50 PM (10 years ago)
- Location:
- cloudwok-file-upload/trunk
- Files:
-
- 3 edited
-
admin.php (modified) (4 diffs)
-
cloudwok.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cloudwok-file-upload/trunk/admin.php
r1350971 r1351860 1 1 <?php 2 2 define( 'BLOCK_LOAD', true ); 3 require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php' ); 4 require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-includes/wp-db.php' ); 3 define('MYPATH', dirname(__FILE__)); 4 if ( file_exists( $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php') ) { 5 require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php' ); 6 } else { 7 // trying probable locations of wp-config.php 8 if (file_exists( MYPATH . '/../../../wp-config.php' )) { 9 require_once( MYPATH . '/../../../wp-config.php' ); 10 } elseif (file_exists( MYPATH . '/../../wp-config.php' )) { 11 require_once( MYPATH . '/../../wp-config.php' ); 12 } elseif (file_exists( MYPATH . '/../wp-config.php' )) { 13 require_once( MYPATH . '/../wp-config.php' ); 14 } elseif (file_exists( MYPATH . '/wp-config.php' )) { 15 require_once( MYPATH . '/wp-config.php' ); 16 } else { 17 // shit, could not find wp-config.php 18 die(); 19 } 20 } 21 if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/wp-includes/wp-db.php') ) { 22 require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-includes/wp-db.php' ); 23 } else { 24 // trying probable locations of wp-config.php 25 if (file_exists( MYPATH . '/../../../wp-includes/wp-db.php' )) { 26 require_once( MYPATH . '/../../../wp-includes/wp-db.php' ); 27 } elseif (file_exists( MYPATH . '/../../wp-includes/wp-db.php' )) { 28 require_once( MYPATH . '/../../wp-includes/wp-db.php' ); 29 } elseif (file_exists( MYPATH . '/../wp-includes/wp-db.php' )) { 30 require_once( MYPATH . '/../wp-includes/wp-db.php' ); 31 } elseif (file_exists( MYPATH . '/wp-includes/wp-db.php' )) { 32 require_once( MYPATH . '/wp-includes/wp-db.php' ); 33 } else { 34 // shit, could not find wp-includes/wp-db.php 35 die(); 36 } 37 } 5 38 6 39 global $wpdb; … … 10 43 if ($_SERVER['REQUEST_METHOD'] === 'POST') { 11 44 // update 12 if(!array_diff(array('cwnonce','ref','code'), array_keys($_POST)) || !wp_verify_nonce( $_POST['cwnonce'], $noncetxt ))45 if(!array_diff(array('cwnonce','ref','code'), array_keys($_POST)) && wp_verify_nonce( $_POST['cwnonce'], $noncetxt )) 13 46 { 14 47 $ref=(int)$_POST['ref']; … … 26 59 ); 27 60 echo "Updated"; 28 } else if(!array_diff(array('cwnonce','code'), array_keys($_POST)) || !wp_verify_nonce( $_POST['cwnonce'], $noncetxt )) {61 } else if(!array_diff(array('cwnonce','code'), array_keys($_POST)) && wp_verify_nonce( $_POST['cwnonce'], $noncetxt )) { 29 62 // create 30 63 $wpdb->insert( … … 70 103 parse_str(file_get_contents('php://input'), $_DELETE ); 71 104 // delete row 72 if(!array_diff(array('cwnonce','ref'), array_keys($_DELETE)) || !wp_verify_nonce( $_DELETE['cwnonce'], $noncetxt ))105 if(!array_diff(array('cwnonce','ref'), array_keys($_DELETE)) && wp_verify_nonce( $_DELETE['cwnonce'], $noncetxt )) 73 106 { 74 107 $ref=(int)$_DELETE['ref']; -
cloudwok-file-upload/trunk/cloudwok.php
r1350971 r1351860 4 4 Plugin URI: http://www.cloudwok.com 5 5 Description: CloudWok enables you to let your website visitors upload files directly into a Dropbox, Google Drive, Amazon S3, Box.com, or other cloud storage folder that you own. 6 Version: 0.5. 06 Version: 0.5.1 7 7 Author: CloudWok 8 8 Author Email: [email protected] … … 335 335 ) $charset_collate;"; 336 336 337 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 337 if (file_exists( ABSPATH . 'wp-admin/includes/upgrade.php' )) { 338 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 339 } else { 340 // could not find upgrade.php where we expected it to be 341 // trying out some other paths to find it 342 if (file_exists( ABSPATH . '/../wp-admin/includes/upgrade.php' )) { 343 require_once( ABSPATH . '/../wp-admin/includes/upgrade.php' ); 344 } elseif (file_exists( ABSPATH . '/../../wp-admin/includes/upgrade.php' )) { 345 require_once( ABSPATH . '/../../wp-admin/includes/upgrade.php' ); 346 } elseif (file_exists( ABSPATH . '/../../../wp-admin/includes/upgrade.php' )) { 347 require_once( ABSPATH . '/../../../wp-admin/includes/upgrade.php' ); 348 } 349 } 338 350 dbDelta( $sql1 ); 339 351 } … … 367 379 $adminUrl = plugin_dir_url( __FILE__ ) . 'admin.php'; 368 380 $nonce = wp_create_nonce( "cWn0Nc€4tW" ); 381 // check if wp-config.php and wp-includes/wp-db.php files can be found 382 define('MYPATH', dirname(__FILE__)); 383 if (!file_exists( $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php') && !file_exists( MYPATH . '/../../../wp-config.php' ) && !file_exists( MYPATH . '/../../wp-config.php' ) && !file_exists( MYPATH . '/../wp-config.php' ) && !file_exists( MYPATH . '/wp-config.php' )) { 384 echo '<p style="color:red;">Warning: wp-config.php could not be found at ' . $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php' . ' or sub paths of ' . MYPATH . '. The CloudWok settings page might therefore not work correctly. Please send an e-mail with this warning to [email protected] and ask for a solution of the issue.</p>'; 385 } 386 if (!file_exists( $_SERVER['DOCUMENT_ROOT'] . '/wp-includes/wp-db.php') && !file_exists( MYPATH . '/../../../wp-includes/wp-db.php' ) && !file_exists( MYPATH . '/../../wp-includes/wp-db.php' ) && !file_exists( MYPATH . '/../wp-includes/wp-db.php' ) && !file_exists( MYPATH . '/wp-includes/wp-db.php' )) { 387 echo '<p style="color:red;">Warning: wp-includes/wp-db.php could not be found at ' . $_SERVER['DOCUMENT_ROOT'] . '/wp-includes/wp-db.php' . ' or sub paths of ' . MYPATH . '. The CloudWok settings page might therefore not work correctly. Please send an e-mail with this warning to [email protected] and ask for a solution of the issue.</p>'; 388 } 389 if (!file_exists( ABSPATH . 'wp-admin/includes/upgrade.php' ) && !file_exists( ABSPATH . '/../wp-admin/includes/upgrade.php' ) && !file_exists( ABSPATH . '/../../wp-admin/includes/upgrade.php' ) && !file_exists( ABSPATH . '/../../../wp-admin/includes/upgrade.php' )) { 390 echo '<p style="color:red;">Warning: wp-admin/includes/upgrade.php could not be found at ' . ABSPATH . 'wp-admin/includes/upgrade.php' . ' or sub paths. The CloudWok settings page might therefore not work correctly. Please send an e-mail with this warning to [email protected] and ask for a solution of the issue.</p>'; 391 } 392 369 393 // Add bootstrap css and js 370 394 echo '<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> … … 449 473 jQuery("#editRef").val(""); 450 474 jQuery("#cloudwokEmbedCode").val(""); 451 console.log(resp);452 475 } 453 476 }); … … 504 527 appendRefListItem(ref); 505 528 }); 506 jQuery("#cloudwokEmbedCode").prop("placeholder","Please enter your embed code here (visit https://www.cloudwok.com/developers to generate your customi ezd code)");529 jQuery("#cloudwokEmbedCode").prop("placeholder","Please enter your embed code here (visit https://www.cloudwok.com/developers to generate your customized code)"); 507 530 });'; 508 531 echo '</script>'; -
cloudwok-file-upload/trunk/readme.txt
r1350971 r1351860 5 5 Requires at least: 3.0.0 6 6 Tested up to: 4.4.2 7 Stable tag: 0.5. 07 Stable tag: 0.5.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 143 143 == Changelog == 144 144 145 = 0.5.1 = 146 On some custom WordPress installations the settings page does not work if central php config files cannot be accessed. This update helps tracking down and reporting possible issues that occur in these cases. 145 147 = 0.5.0 = 146 148 New shortcode feature. Create a customized widget via the Settings > CloudWok menu in the admin sidebar. The old shortcode still works but will not be further developed. Please use the new shortcode to customize the CloudWok widget.
Note: See TracChangeset
for help on using the changeset viewer.