Plugin Directory

Changeset 3245852


Ignore:
Timestamp:
02/24/2025 03:45:25 PM (10 months ago)
Author:
boonebgorges
Message:

Create tag 0.8.3.

Location:
anthologize
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • anthologize/tags/0.8.3/anthologize.php

    r3208665 r3245852  
    44Plugin URI: http://anthologize.org
    55Description: Use the power of WordPress to transform your content into a book.
    6 Version: 0.8.2
     6Version: 0.8.3
    77Text Domain: anthologize
    88Author: One Week | One Tool
     
    3131
    3232if ( ! defined( 'ANTHOLOGIZE_VERSION' ) )
    33     define( 'ANTHOLOGIZE_VERSION', '0.8.2' );
     33    define( 'ANTHOLOGIZE_VERSION', '0.8.3' );
    3434
    3535require dirname( __FILE__ ) . '/vendor/autoload.php';
  • anthologize/tags/0.8.3/includes/class-admin-main.php

    r3208665 r3245852  
    468468            if ( isset( $_GET['action'] ) ) {
    469469                if ( $_GET['action'] == 'delete' && $project ) {
    470                     wp_delete_post( $project->ID );
     470                    check_admin_referer( 'anthologize_delete_project' );
     471
     472                    if ( current_user_can( 'delete_post', $project->ID ) ) {
     473                        wp_delete_post( $project->ID );
     474                    }
    471475                }
    472476
     
    552556                            $controlActions   = array();
    553557                            $the_id           = get_the_ID();
     558
     559                            $delete_url = wp_nonce_url( admin_url( 'admin.php?page=anthologize&action=delete&project_id=' . $the_id ), 'anthologize_delete_project' );
     560
    554561                            $controlActions[] = '<a href="admin.php?page=anthologize_new_project&project_id=' . esc_attr( $the_id ) . '">' . __( 'Project Details', 'anthologize' ) . '</a>';
    555562                            $controlActions[] = '<a href="admin.php?page=anthologize&action=edit&project_id=' . esc_attr( $the_id ) . '">' . __( 'Manage Parts', 'anthologize' ) . '</a>';
    556                             $controlActions[] = '<a href="admin.php?page=anthologize&action=delete&project_id=' . esc_attr( $the_id ) . '" class="confirm-delete">' . __( 'Delete Project', 'anthologize' ) . '</a>';
     563                            $controlActions[] = '<a href="' . esc_url( $delete_url ) . '" class="confirm-delete">' . __( 'Delete Project', 'anthologize' ) . '</a>';
    557564                            ?>
    558565
  • anthologize/tags/0.8.3/includes/class-new-project.php

    r3208665 r3245852  
    126126
    127127            if ( isset( $_POST['save_project'] ) ) {
     128                check_admin_referer( 'anthologize_new_project' );
    128129                $this->save_project();
    129130                return;
     
    159160                <tr valign="top">
    160161                    <th scope="row"><label for="project-title"><?php _e( 'Project Title', 'anthologize' ); ?></label></th>
    161                     <td><input type="text" name="post_title" id="project-title" value="
    162162                    <?php
    163                     if ( $project ) {
    164                         echo esc_attr( $project->post_title );}
     163                    $existing_project_title = $project ? $project->post_title : '';
    165164                    ?>
    166                     "></td>
     165                    <td><input type="text" name="post_title" id="project-title" value="<?php echo esc_attr( $existing_project_title ); ?>"></td>
    167166                </tr>
    168167
    169168                <tr valign="top">
    170169                    <th scope="row"><label for="project-subtitle"><?php _e( 'Subtitle', 'anthologize' ); ?></label>
    171                     <td><input type="text" name="anthologize_meta[subtitle]" id="project-subtitle" value="
    172170                    <?php
    173                     if ( $project && ! empty( $meta['subtitle'] ) ) {
    174                         echo esc_attr( $meta['subtitle'] );}
     171                    $existing_subtitle = $project ? $meta['subtitle'] : '';
    175172                    ?>
    176                     " /></td>
     173                    <td><input type="text" name="anthologize_meta[subtitle]" id="project-subtitle" value="<?php echo esc_attr( $existing_subtitle ); ?>" /></td>
    177174                </tr>
    178175
     
    195192
    196193                <div class="anthologize-button"><input type="submit" name="save_project" value="<?php _e( 'Save Project', 'anthologize' ); ?>"></div>
    197             <input type="hidden" name="project_id" value="
    198             <?php
    199             if ( $project ) {
    200                 echo esc_attr( $project->ID );}
    201             ?>
    202             ">
     194            <?php $existing_project_id = $project ? $project->ID : ''; ?>
     195            <input type="hidden" name="project_id" value="<?php echo esc_attr( $existing_project_id ); ?>">
     196
     197            <?php wp_nonce_field( 'anthologize_new_project' ); ?>
     198
    203199            </form>
    204200
  • anthologize/tags/0.8.3/includes/class-project-organizer.php

    r3208665 r3245852  
    7070                    <a href="admin.php?page=anthologize_new_project&project_id=<?php echo esc_attr( $this->project_id ); ?>"><?php _e( 'Project Details', 'anthologize' ); ?></a> |
    7171                    <a target="_blank" href="<?php echo esc_url( $this->preview_url( $this->project_id, 'anth_project' ) ); ?>"><?php _e( 'Preview Project', 'anthologize' ); ?></a> |
    72                     <a href="admin.php?page=anthologize&action=delete&project_id=<?php echo esc_attr( $this->project_id ); ?>" class="confirm-delete"><?php _e( 'Delete Project', 'anthologize' ); ?></a>
     72                    <a href="<?php echo esc_attr( wp_nonce_url( admin_url( 'admin.php?page=anthologize&action=delete&project_id=' . $this->project_id ), 'anthologize_delete_project' ) ); ?>" class="confirm-delete"><?php _e( 'Delete Project', 'anthologize' ); ?></a>
    7373                </div>
    7474            </h2>
  • anthologize/tags/0.8.3/readme.txt

    r3208665 r3245852  
    6060
    6161== Changelog ==
     62
     63= 0.8.3 =
     64* Fixed security vulnerability when deleting or creating projects
    6265
    6366= 0.8.2 =
  • anthologize/tags/0.8.3/vendor/composer/InstalledVersions.php

    r3208665 r3245852  
    3232     */
    3333    private static $installed;
     34
     35    /**
     36     * @var bool
     37     */
     38    private static $installedIsLocalDir;
    3439
    3540    /**
     
    310315        self::$installed = $data;
    311316        self::$installedByVendor = array();
     317
     318        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     319        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     320        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     321        // all installed packages for example
     322        self::$installedIsLocalDir = false;
    312323    }
    313324
     
    323334
    324335        $installed = array();
     336        $copiedLocalDir = false;
    325337
    326338        if (self::$canGetVendors) {
     339            $selfDir = strtr(__DIR__, '\\', '/');
    327340            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     341                $vendorDir = strtr($vendorDir, '\\', '/');
    328342                if (isset(self::$installedByVendor[$vendorDir])) {
    329343                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331345                    /** @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 */
    332346                    $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];
     347                    self::$installedByVendor[$vendorDir] = $required;
     348                    $installed[] = $required;
     349                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     350                        self::$installed = $required;
     351                        self::$installedIsLocalDir = true;
    336352                    }
     353                }
     354                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     355                    $copiedLocalDir = true;
    337356                }
    338357            }
     
    351370        }
    352371
    353         if (self::$installed !== array()) {
     372        if (self::$installed !== array() && !$copiedLocalDir) {
    354373            $installed[] = self::$installed;
    355374        }
  • anthologize/tags/0.8.3/vendor/composer/installed.php

    r3208665 r3245852  
    44        'pretty_version' => '0.8.x-dev',
    55        'version' => '0.8.9999999.9999999-dev',
    6         'reference' => 'ab984c003a2ace922d87f1e7f29d78110f401804',
     6        'reference' => '1e60e8f970f44326fabf5c33edbb7df31f16ee55',
    77        'type' => 'project',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => '0.8.x-dev',
    1515            'version' => '0.8.9999999.9999999-dev',
    16             'reference' => 'ab984c003a2ace922d87f1e7f29d78110f401804',
     16            'reference' => '1e60e8f970f44326fabf5c33edbb7df31f16ee55',
    1717            'type' => 'project',
    1818            'install_path' => __DIR__ . '/../../',
  • anthologize/trunk/anthologize.php

    r3208665 r3245852  
    44Plugin URI: http://anthologize.org
    55Description: Use the power of WordPress to transform your content into a book.
    6 Version: 0.8.2
     6Version: 0.8.3
    77Text Domain: anthologize
    88Author: One Week | One Tool
     
    3131
    3232if ( ! defined( 'ANTHOLOGIZE_VERSION' ) )
    33     define( 'ANTHOLOGIZE_VERSION', '0.8.2' );
     33    define( 'ANTHOLOGIZE_VERSION', '0.8.3' );
    3434
    3535require dirname( __FILE__ ) . '/vendor/autoload.php';
  • anthologize/trunk/includes/class-admin-main.php

    r3208665 r3245852  
    468468            if ( isset( $_GET['action'] ) ) {
    469469                if ( $_GET['action'] == 'delete' && $project ) {
    470                     wp_delete_post( $project->ID );
     470                    check_admin_referer( 'anthologize_delete_project' );
     471
     472                    if ( current_user_can( 'delete_post', $project->ID ) ) {
     473                        wp_delete_post( $project->ID );
     474                    }
    471475                }
    472476
     
    552556                            $controlActions   = array();
    553557                            $the_id           = get_the_ID();
     558
     559                            $delete_url = wp_nonce_url( admin_url( 'admin.php?page=anthologize&action=delete&project_id=' . $the_id ), 'anthologize_delete_project' );
     560
    554561                            $controlActions[] = '<a href="admin.php?page=anthologize_new_project&project_id=' . esc_attr( $the_id ) . '">' . __( 'Project Details', 'anthologize' ) . '</a>';
    555562                            $controlActions[] = '<a href="admin.php?page=anthologize&action=edit&project_id=' . esc_attr( $the_id ) . '">' . __( 'Manage Parts', 'anthologize' ) . '</a>';
    556                             $controlActions[] = '<a href="admin.php?page=anthologize&action=delete&project_id=' . esc_attr( $the_id ) . '" class="confirm-delete">' . __( 'Delete Project', 'anthologize' ) . '</a>';
     563                            $controlActions[] = '<a href="' . esc_url( $delete_url ) . '" class="confirm-delete">' . __( 'Delete Project', 'anthologize' ) . '</a>';
    557564                            ?>
    558565
  • anthologize/trunk/includes/class-new-project.php

    r3208665 r3245852  
    126126
    127127            if ( isset( $_POST['save_project'] ) ) {
     128                check_admin_referer( 'anthologize_new_project' );
    128129                $this->save_project();
    129130                return;
     
    159160                <tr valign="top">
    160161                    <th scope="row"><label for="project-title"><?php _e( 'Project Title', 'anthologize' ); ?></label></th>
    161                     <td><input type="text" name="post_title" id="project-title" value="
    162162                    <?php
    163                     if ( $project ) {
    164                         echo esc_attr( $project->post_title );}
     163                    $existing_project_title = $project ? $project->post_title : '';
    165164                    ?>
    166                     "></td>
     165                    <td><input type="text" name="post_title" id="project-title" value="<?php echo esc_attr( $existing_project_title ); ?>"></td>
    167166                </tr>
    168167
    169168                <tr valign="top">
    170169                    <th scope="row"><label for="project-subtitle"><?php _e( 'Subtitle', 'anthologize' ); ?></label>
    171                     <td><input type="text" name="anthologize_meta[subtitle]" id="project-subtitle" value="
    172170                    <?php
    173                     if ( $project && ! empty( $meta['subtitle'] ) ) {
    174                         echo esc_attr( $meta['subtitle'] );}
     171                    $existing_subtitle = $project ? $meta['subtitle'] : '';
    175172                    ?>
    176                     " /></td>
     173                    <td><input type="text" name="anthologize_meta[subtitle]" id="project-subtitle" value="<?php echo esc_attr( $existing_subtitle ); ?>" /></td>
    177174                </tr>
    178175
     
    195192
    196193                <div class="anthologize-button"><input type="submit" name="save_project" value="<?php _e( 'Save Project', 'anthologize' ); ?>"></div>
    197             <input type="hidden" name="project_id" value="
    198             <?php
    199             if ( $project ) {
    200                 echo esc_attr( $project->ID );}
    201             ?>
    202             ">
     194            <?php $existing_project_id = $project ? $project->ID : ''; ?>
     195            <input type="hidden" name="project_id" value="<?php echo esc_attr( $existing_project_id ); ?>">
     196
     197            <?php wp_nonce_field( 'anthologize_new_project' ); ?>
     198
    203199            </form>
    204200
  • anthologize/trunk/includes/class-project-organizer.php

    r3208665 r3245852  
    7070                    <a href="admin.php?page=anthologize_new_project&project_id=<?php echo esc_attr( $this->project_id ); ?>"><?php _e( 'Project Details', 'anthologize' ); ?></a> |
    7171                    <a target="_blank" href="<?php echo esc_url( $this->preview_url( $this->project_id, 'anth_project' ) ); ?>"><?php _e( 'Preview Project', 'anthologize' ); ?></a> |
    72                     <a href="admin.php?page=anthologize&action=delete&project_id=<?php echo esc_attr( $this->project_id ); ?>" class="confirm-delete"><?php _e( 'Delete Project', 'anthologize' ); ?></a>
     72                    <a href="<?php echo esc_attr( wp_nonce_url( admin_url( 'admin.php?page=anthologize&action=delete&project_id=' . $this->project_id ), 'anthologize_delete_project' ) ); ?>" class="confirm-delete"><?php _e( 'Delete Project', 'anthologize' ); ?></a>
    7373                </div>
    7474            </h2>
  • anthologize/trunk/readme.txt

    r3208665 r3245852  
    6060
    6161== Changelog ==
     62
     63= 0.8.3 =
     64* Fixed security vulnerability when deleting or creating projects
    6265
    6366= 0.8.2 =
  • anthologize/trunk/vendor/composer/InstalledVersions.php

    r3208665 r3245852  
    3232     */
    3333    private static $installed;
     34
     35    /**
     36     * @var bool
     37     */
     38    private static $installedIsLocalDir;
    3439
    3540    /**
     
    310315        self::$installed = $data;
    311316        self::$installedByVendor = array();
     317
     318        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     319        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     320        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     321        // all installed packages for example
     322        self::$installedIsLocalDir = false;
    312323    }
    313324
     
    323334
    324335        $installed = array();
     336        $copiedLocalDir = false;
    325337
    326338        if (self::$canGetVendors) {
     339            $selfDir = strtr(__DIR__, '\\', '/');
    327340            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     341                $vendorDir = strtr($vendorDir, '\\', '/');
    328342                if (isset(self::$installedByVendor[$vendorDir])) {
    329343                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331345                    /** @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 */
    332346                    $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];
     347                    self::$installedByVendor[$vendorDir] = $required;
     348                    $installed[] = $required;
     349                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     350                        self::$installed = $required;
     351                        self::$installedIsLocalDir = true;
    336352                    }
     353                }
     354                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     355                    $copiedLocalDir = true;
    337356                }
    338357            }
     
    351370        }
    352371
    353         if (self::$installed !== array()) {
     372        if (self::$installed !== array() && !$copiedLocalDir) {
    354373            $installed[] = self::$installed;
    355374        }
  • anthologize/trunk/vendor/composer/installed.php

    r3208665 r3245852  
    44        'pretty_version' => '0.8.x-dev',
    55        'version' => '0.8.9999999.9999999-dev',
    6         'reference' => 'ab984c003a2ace922d87f1e7f29d78110f401804',
     6        'reference' => '1e60e8f970f44326fabf5c33edbb7df31f16ee55',
    77        'type' => 'project',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => '0.8.x-dev',
    1515            'version' => '0.8.9999999.9999999-dev',
    16             'reference' => 'ab984c003a2ace922d87f1e7f29d78110f401804',
     16            'reference' => '1e60e8f970f44326fabf5c33edbb7df31f16ee55',
    1717            'type' => 'project',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.