Changeset 3064569
- Timestamp:
- 04/04/2024 10:44:39 AM (23 months ago)
- Location:
- unyson
- Files:
-
- 3 edited
- 7 copied
-
tags/2.7.30 (copied) (copied from unyson/trunk)
-
tags/2.7.30/framework/core/components/extensions/manager/class--fw-extensions-manager.php (copied) (copied from unyson/trunk/framework/core/components/extensions/manager/class--fw-extensions-manager.php) (3 diffs)
-
tags/2.7.30/framework/core/components/extensions/manager/includes/download-source/types/class-fw-download-source-github.php (copied) (copied from unyson/trunk/framework/core/components/extensions/manager/includes/download-source/types/class-fw-download-source-github.php)
-
tags/2.7.30/framework/core/components/extensions/manager/static/extensions-page.js (modified) (3 diffs)
-
tags/2.7.30/framework/extensions/update/extensions/github-update/class-fw-extension-github-update.php (copied) (copied from unyson/trunk/framework/extensions/update/extensions/github-update/class-fw-extension-github-update.php)
-
tags/2.7.30/framework/manifest.php (copied) (copied from unyson/trunk/framework/manifest.php)
-
tags/2.7.30/readme.txt (copied) (copied from unyson/trunk/readme.txt)
-
tags/2.7.30/unyson.php (copied) (copied from unyson/trunk/unyson.php)
-
trunk/framework/core/components/extensions/manager/class--fw-extensions-manager.php (modified) (3 diffs)
-
trunk/framework/core/components/extensions/manager/static/extensions-page.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
unyson/tags/2.7.30/framework/core/components/extensions/manager/class--fw-extensions-manager.php
r2749668 r3064569 278 278 public function _action_ajax_check_direct_fs_access() 279 279 { 280 if ( !$this->can_install()) {280 if ( ! $this->can_install() || empty( $_POST['extAction'] ) ) { 281 281 // if can't install, no need to know if has access or not 282 wp_send_json_error(); 283 } 284 285 $nonce = $this->get_nonce( $_POST['extAction'] ); 286 287 if ( ! isset( $_POST[ $nonce['name'] ] ) || ! wp_verify_nonce( $_POST[ $nonce['name'] ], $nonce['action'] ) ) { 282 288 wp_send_json_error(); 283 289 } … … 300 306 } 301 307 308 $nonce = $this->get_nonce( 'install' ); 309 310 if ( ! isset( $_POST[ $nonce['name'] ] ) || ! wp_verify_nonce( $_POST[ $nonce['name'] ], $nonce['action'] ) ) { 311 wp_send_json_error(); 312 } 313 302 314 if ( ! FW_WP_Filesystem::has_direct_access( fw_get_framework_directory( '/extensions' ) ) ) { 303 315 wp_send_json_error(); … … 322 334 if (!$this->can_install()) { 323 335 // if can't install, no need to know if has access or not 336 wp_send_json_error(); 337 } 338 339 $nonce = $this->get_nonce( 'delete' ); 340 341 if ( ! isset( $_POST[ $nonce['name'] ] ) || ! wp_verify_nonce( $_POST[ $nonce['name'] ], $nonce['action'] ) ) { 324 342 wp_send_json_error(); 325 343 } -
unyson/tags/2.7.30/framework/core/components/extensions/manager/static/extensions-page.js
r1891028 r3064569 27 27 var $form = $(this); 28 28 29 var confirmMessage = $form.attr('data-confirm-message'); 29 var confirmMessage = $form.attr('data-confirm-message'), 30 action = $form.attr('data-extension-action'), 31 action = action === 'uninstall' ? 'delete' : action, 32 nonceName = '_nonce_fw_extensions_' + action; 30 33 31 34 inst.isBusy = true; … … 36 39 type: 'POST', 37 40 data: { 38 action: 'fw_extensions_check_direct_fs_access' 41 action: 'fw_extensions_check_direct_fs_access', 42 [nonceName]: $form.find('#' + nonceName).val(), 43 extAction: action 39 44 }, 40 45 dataType: 'json' … … 52 57 type: 'POST', 53 58 data: { 54 action: 'fw_extensions_'+ $form.attr('data-extension-action'), 55 extension: $form.attr('data-extension-name') 59 action: 'fw_extensions_' + (action === 'delete' ? 'uninstall' : action), 60 extension: $form.attr('data-extension-name'), 61 [nonceName]: $form.find('#' + nonceName).val() 56 62 }, 57 63 dataType: 'json' -
unyson/trunk/framework/core/components/extensions/manager/class--fw-extensions-manager.php
r2749668 r3064569 278 278 public function _action_ajax_check_direct_fs_access() 279 279 { 280 if ( !$this->can_install()) {280 if ( ! $this->can_install() || empty( $_POST['extAction'] ) ) { 281 281 // if can't install, no need to know if has access or not 282 wp_send_json_error(); 283 } 284 285 $nonce = $this->get_nonce( $_POST['extAction'] ); 286 287 if ( ! isset( $_POST[ $nonce['name'] ] ) || ! wp_verify_nonce( $_POST[ $nonce['name'] ], $nonce['action'] ) ) { 282 288 wp_send_json_error(); 283 289 } … … 300 306 } 301 307 308 $nonce = $this->get_nonce( 'install' ); 309 310 if ( ! isset( $_POST[ $nonce['name'] ] ) || ! wp_verify_nonce( $_POST[ $nonce['name'] ], $nonce['action'] ) ) { 311 wp_send_json_error(); 312 } 313 302 314 if ( ! FW_WP_Filesystem::has_direct_access( fw_get_framework_directory( '/extensions' ) ) ) { 303 315 wp_send_json_error(); … … 322 334 if (!$this->can_install()) { 323 335 // if can't install, no need to know if has access or not 336 wp_send_json_error(); 337 } 338 339 $nonce = $this->get_nonce( 'delete' ); 340 341 if ( ! isset( $_POST[ $nonce['name'] ] ) || ! wp_verify_nonce( $_POST[ $nonce['name'] ], $nonce['action'] ) ) { 324 342 wp_send_json_error(); 325 343 } -
unyson/trunk/framework/core/components/extensions/manager/static/extensions-page.js
r1891028 r3064569 27 27 var $form = $(this); 28 28 29 var confirmMessage = $form.attr('data-confirm-message'); 29 var confirmMessage = $form.attr('data-confirm-message'), 30 action = $form.attr('data-extension-action'), 31 action = action === 'uninstall' ? 'delete' : action, 32 nonceName = '_nonce_fw_extensions_' + action; 30 33 31 34 inst.isBusy = true; … … 36 39 type: 'POST', 37 40 data: { 38 action: 'fw_extensions_check_direct_fs_access' 41 action: 'fw_extensions_check_direct_fs_access', 42 [nonceName]: $form.find('#' + nonceName).val(), 43 extAction: action 39 44 }, 40 45 dataType: 'json' … … 52 57 type: 'POST', 53 58 data: { 54 action: 'fw_extensions_'+ $form.attr('data-extension-action'), 55 extension: $form.attr('data-extension-name') 59 action: 'fw_extensions_' + (action === 'delete' ? 'uninstall' : action), 60 extension: $form.attr('data-extension-name'), 61 [nonceName]: $form.find('#' + nonceName).val() 56 62 }, 57 63 dataType: 'json'
Note: See TracChangeset
for help on using the changeset viewer.