Changeset 3298251
- Timestamp:
- 05/21/2025 05:55:47 PM (11 months ago)
- Location:
- ownerrez
- Files:
-
- 12 edited
- 1 copied
-
tags/1.2.1 (copied) (copied from ownerrez/trunk)
-
tags/1.2.1/admin/class-ownerrez-admin.php (modified) (2 diffs)
-
tags/1.2.1/admin/partials/ownerrez-admin-display.php (modified) (2 diffs)
-
tags/1.2.1/lib/autoload.php (modified) (1 diff)
-
tags/1.2.1/lib/composer/InstalledVersions.php (modified) (5 diffs)
-
tags/1.2.1/ownerrez.php (modified) (2 diffs)
-
tags/1.2.1/readme.txt (modified) (2 diffs)
-
trunk/admin/class-ownerrez-admin.php (modified) (2 diffs)
-
trunk/admin/partials/ownerrez-admin-display.php (modified) (2 diffs)
-
trunk/lib/autoload.php (modified) (1 diff)
-
trunk/lib/composer/InstalledVersions.php (modified) (5 diffs)
-
trunk/ownerrez.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ownerrez/tags/1.2.1/admin/class-ownerrez-admin.php
r3139962 r3298251 99 99 public function menu_settings_save() 100 100 { 101 if (!current_user_can('manage_options')) { 102 wp_die(__('You do not have sufficient permissions to access this page.')); 103 } 104 105 if (!check_admin_referer('save_ownerrez_settings')) { 106 wp_die(__('You do not have sufficient permissions to access this page.')); 107 } 108 101 109 // Get the options that were sent 102 110 $apiRoot = !empty($_POST["ownerrez_apiRoot"]) ? esc_url_raw($_POST["ownerrez_apiRoot"], ["http", "https"]) : self::DEFAULT_API_ROOT; … … 184 192 public function clear_transients() 185 193 { 194 if (!current_user_can('manage_options')) { 195 wp_die(__('You do not have sufficient permissions to access this page.')); 196 } 197 198 if (!check_admin_referer('clear_ownerrez_transients')) { 199 wp_die(__('You do not have sufficient permissions to access this page.')); 200 } 201 186 202 $plugin_public = new OwnerRez_Public($this->ownerrez, $this->version); 187 203 $plugin_public->clear_transients(); -
ownerrez/tags/1.2.1/admin/partials/ownerrez-admin-display.php
r3139962 r3298251 54 54 <form method="post" action="<?php echo admin_url('admin-post.php'); ?>"> 55 55 <input type="hidden" name="action" value="save_ownerrez_settings" /> 56 <?php wp_nonce_field( 'save_ownerrez_settings' ); ?> 56 57 57 58 <table class="form-table" role="presentation"> … … 119 120 <form id="clear_ownerrez_transients" method="post" action="<?php echo admin_url('admin-post.php'); ?>"> 120 121 <input type="hidden" name="action" value="clear_ownerrez_transients" /> 122 <?php wp_nonce_field( 'clear_ownerrez_transients' ); ?> 121 123 </form> 122 124 </div> -
ownerrez/tags/1.2.1/lib/autoload.php
r3139962 r3298251 15 15 } 16 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 17 throw new RuntimeException($err); 21 18 } 22 19 -
ownerrez/tags/1.2.1/lib/composer/InstalledVersions.php
r2890325 r3298251 28 28 { 29 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 35 /** 30 36 * @var mixed[]|null 31 37 * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null 32 38 */ 33 39 private static $installed; 40 41 /** 42 * @var bool 43 */ 44 private static $installedIsLocalDir; 34 45 35 46 /** … … 310 321 self::$installed = $data; 311 322 self::$installedByVendor = array(); 323 324 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 325 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 326 // so we have to assume it does not, and that may result in duplicate data being returned when listing 327 // all installed packages for example 328 self::$installedIsLocalDir = false; 329 } 330 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 312 341 } 313 342 … … 323 352 324 353 $installed = array(); 354 $copiedLocalDir = false; 325 355 326 356 if (self::$canGetVendors) { 357 $selfDir = self::getSelfDir(); 327 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 359 $vendorDir = strtr($vendorDir, '\\', '/'); 328 360 if (isset(self::$installedByVendor[$vendorDir])) { 329 361 $installed[] = self::$installedByVendor[$vendorDir]; … … 331 363 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ 332 364 $required = require $vendorDir.'/composer/installed.php'; 333 $installed[] = self::$installedByVendor[$vendorDir] = $required; 334 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 335 self::$installed = $installed[count($installed) - 1]; 365 self::$installedByVendor[$vendorDir] = $required; 366 $installed[] = $required; 367 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 368 self::$installed = $required; 369 self::$installedIsLocalDir = true; 336 370 } 371 } 372 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 373 $copiedLocalDir = true; 337 374 } 338 375 } … … 351 388 } 352 389 353 if (self::$installed !== array() ) {390 if (self::$installed !== array() && !$copiedLocalDir) { 354 391 $installed[] = self::$installed; 355 392 } -
ownerrez/tags/1.2.1/ownerrez.php
r3139962 r3298251 17 17 * Plugin URI: https://www.ownerrez.com/support/wordpress 18 18 * Description: The official WordPress plugin for the OwnerRez API. 19 * Version: 1.2. 019 * Version: 1.2.1 20 20 * Author: OwnerRez, Inc. 21 21 * Author URI: https://www.ownerrez.com/ … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define('OWNERREZ_VERSION', '1.2. 0');38 define('OWNERREZ_VERSION', '1.2.1'); 39 39 40 40 /** -
ownerrez/tags/1.2.1/readme.txt
r3139962 r3298251 4 4 Requires at least: 5.4 5 5 Tested up to: 6.6.0 6 Stable tag: 1.2. 06 Stable tag: 1.2.1 7 7 License: MIT 8 8 License URI: https://github.com/ownerrez/orez-wp/blob/master/LICENSE … … 33 33 34 34 == Changelog == 35 = 1.2.1 = 36 - Improve security in administrative pages 37 35 38 = 1.2.0 = 36 39 - Update URLs to OwnerRez short domain -
ownerrez/trunk/admin/class-ownerrez-admin.php
r3139962 r3298251 99 99 public function menu_settings_save() 100 100 { 101 if (!current_user_can('manage_options')) { 102 wp_die(__('You do not have sufficient permissions to access this page.')); 103 } 104 105 if (!check_admin_referer('save_ownerrez_settings')) { 106 wp_die(__('You do not have sufficient permissions to access this page.')); 107 } 108 101 109 // Get the options that were sent 102 110 $apiRoot = !empty($_POST["ownerrez_apiRoot"]) ? esc_url_raw($_POST["ownerrez_apiRoot"], ["http", "https"]) : self::DEFAULT_API_ROOT; … … 184 192 public function clear_transients() 185 193 { 194 if (!current_user_can('manage_options')) { 195 wp_die(__('You do not have sufficient permissions to access this page.')); 196 } 197 198 if (!check_admin_referer('clear_ownerrez_transients')) { 199 wp_die(__('You do not have sufficient permissions to access this page.')); 200 } 201 186 202 $plugin_public = new OwnerRez_Public($this->ownerrez, $this->version); 187 203 $plugin_public->clear_transients(); -
ownerrez/trunk/admin/partials/ownerrez-admin-display.php
r3139962 r3298251 54 54 <form method="post" action="<?php echo admin_url('admin-post.php'); ?>"> 55 55 <input type="hidden" name="action" value="save_ownerrez_settings" /> 56 <?php wp_nonce_field( 'save_ownerrez_settings' ); ?> 56 57 57 58 <table class="form-table" role="presentation"> … … 119 120 <form id="clear_ownerrez_transients" method="post" action="<?php echo admin_url('admin-post.php'); ?>"> 120 121 <input type="hidden" name="action" value="clear_ownerrez_transients" /> 122 <?php wp_nonce_field( 'clear_ownerrez_transients' ); ?> 121 123 </form> 122 124 </div> -
ownerrez/trunk/lib/autoload.php
r3139962 r3298251 15 15 } 16 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 17 throw new RuntimeException($err); 21 18 } 22 19 -
ownerrez/trunk/lib/composer/InstalledVersions.php
r2890325 r3298251 28 28 { 29 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 35 /** 30 36 * @var mixed[]|null 31 37 * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null 32 38 */ 33 39 private static $installed; 40 41 /** 42 * @var bool 43 */ 44 private static $installedIsLocalDir; 34 45 35 46 /** … … 310 321 self::$installed = $data; 311 322 self::$installedByVendor = array(); 323 324 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 325 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 326 // so we have to assume it does not, and that may result in duplicate data being returned when listing 327 // all installed packages for example 328 self::$installedIsLocalDir = false; 329 } 330 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 312 341 } 313 342 … … 323 352 324 353 $installed = array(); 354 $copiedLocalDir = false; 325 355 326 356 if (self::$canGetVendors) { 357 $selfDir = self::getSelfDir(); 327 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 359 $vendorDir = strtr($vendorDir, '\\', '/'); 328 360 if (isset(self::$installedByVendor[$vendorDir])) { 329 361 $installed[] = self::$installedByVendor[$vendorDir]; … … 331 363 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ 332 364 $required = require $vendorDir.'/composer/installed.php'; 333 $installed[] = self::$installedByVendor[$vendorDir] = $required; 334 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 335 self::$installed = $installed[count($installed) - 1]; 365 self::$installedByVendor[$vendorDir] = $required; 366 $installed[] = $required; 367 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 368 self::$installed = $required; 369 self::$installedIsLocalDir = true; 336 370 } 371 } 372 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 373 $copiedLocalDir = true; 337 374 } 338 375 } … … 351 388 } 352 389 353 if (self::$installed !== array() ) {390 if (self::$installed !== array() && !$copiedLocalDir) { 354 391 $installed[] = self::$installed; 355 392 } -
ownerrez/trunk/ownerrez.php
r3139962 r3298251 17 17 * Plugin URI: https://www.ownerrez.com/support/wordpress 18 18 * Description: The official WordPress plugin for the OwnerRez API. 19 * Version: 1.2. 019 * Version: 1.2.1 20 20 * Author: OwnerRez, Inc. 21 21 * Author URI: https://www.ownerrez.com/ … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define('OWNERREZ_VERSION', '1.2. 0');38 define('OWNERREZ_VERSION', '1.2.1'); 39 39 40 40 /** -
ownerrez/trunk/readme.txt
r3139962 r3298251 4 4 Requires at least: 5.4 5 5 Tested up to: 6.6.0 6 Stable tag: 1.2. 06 Stable tag: 1.2.1 7 7 License: MIT 8 8 License URI: https://github.com/ownerrez/orez-wp/blob/master/LICENSE … … 33 33 34 34 == Changelog == 35 = 1.2.1 = 36 - Improve security in administrative pages 37 35 38 = 1.2.0 = 36 39 - Update URLs to OwnerRez short domain
Note: See TracChangeset
for help on using the changeset viewer.