Plugin Directory

Changeset 2910521


Ignore:
Timestamp:
05/10/2023 07:48:53 AM (3 years ago)
Author:
appfulapp
Message:

Fixed handling of missing attachment meta data

Location:
appful-app
Files:
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • appful-app/tags/2.0.1/appful-app.php

    r2907312 r2910521  
    1212 * Plugin URI:        https://appful.io
    1313 * Description:       Appful® is the number 1 plugin for turning your WordPress Content into a native, beautiful app on iOS & Android in under 5 minutes.
    14  * Version:           2.0.0
     14 * Version:           2.0.1
    1515 * Requires at least: 5.8
    1616 * Requires PHP:      7.4
  • appful-app/tags/2.0.1/includes/wp/WPAttachmentManager.php

    r2907312 r2910521  
    6161    }
    6262
    63     public static function get_meta_for_attachment( WP_Post $attachment ): array {
     63    public static function get_meta_for_attachment( WP_Post $attachment ) {
    6464        return wp_get_attachment_metadata( $attachment->ID );
    6565    }
  • appful-app/tags/2.0.1/includes/wp/mapper/AttachmentMapper.php

    r2907312 r2910521  
    1212        $attachment_url  = WPAttachmentManager::get_url_for_attachment( $attachment );
    1313
    14         $width = $attachment_meta['width'];
    15         if ( is_null( $width ) ) {
    16             $width = 0;
    17         }
    18         $height = $attachment_meta['height'];
    19         if ( is_null( $height ) ) {
     14        if ( ! $attachment_meta ) {
     15            $width  = 0;
    2016            $height = 0;
     17        } else {
     18            $width = $attachment_meta['width'];
     19            if ( is_null( $width ) ) {
     20                $width = 0;
     21            }
     22            $height = $attachment_meta['height'];
     23            if ( is_null( $height ) ) {
     24                $height = 0;
     25            }
    2126        }
    2227
  • appful-app/tags/2.0.1/lib/vendor/autoload.php

    r2907312 r2910521  
    44
    55if (PHP_VERSION_ID < 50600) {
    6     if (!headers_sent()) {
    7         header('HTTP/1.1 500 Internal Server Error');
    8     }
    9     $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
    10     if (!ini_get('display_errors')) {
    11         if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
    12             fwrite(STDERR, $err);
    13         } elseif (!headers_sent()) {
    14             echo $err;
    15         }
    16     }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     6    echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     7    exit(1);
    218}
    229
  • appful-app/tags/2.0.1/lib/vendor/composer/ClassLoader.php

    r2907312 r2910521  
    4343class ClassLoader
    4444{
    45     /** @var \Closure(string):void */
    46     private static $includeFile;
    47 
    4845    /** @var ?string */
    4946    private $vendorDir;
     
    110107    {
    111108        $this->vendorDir = $vendorDir;
    112         self::initializeIncludeClosure();
    113109    }
    114110
     
    430426    {
    431427        if ($file = $this->findFile($class)) {
    432             $includeFile = self::$includeFile;
    433             $includeFile($file);
     428            includeFile($file);
    434429
    435430            return true;
     
    561556        return false;
    562557    }
    563 
    564     /**
    565      * @return void
    566      */
    567     private static function initializeIncludeClosure()
    568     {
    569         if (self::$includeFile !== null) {
    570             return;
    571         }
    572 
    573         /**
    574          * Scope isolated include.
    575          *
    576          * Prevents access to $this/self from included files.
    577          *
    578          * @param  string $file
    579          * @return void
    580          */
    581         self::$includeFile = \Closure::bind(static function($file) {
    582             include $file;
    583         }, null, null);
    584     }
    585558}
     559
     560/**
     561 * Scope isolated include.
     562 *
     563 * Prevents access to $this/self from included files.
     564 *
     565 * @param  string $file
     566 * @return void
     567 * @private
     568 */
     569function includeFile($file)
     570{
     571    include $file;
     572}
  • appful-app/tags/2.0.1/lib/vendor/composer/autoload_psr4.php

    r2907312 r2910521  
    1010    'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
    1111    'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
    12     'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
     12    'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
    1313    'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
    1414    'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
  • appful-app/tags/2.0.1/lib/vendor/composer/autoload_real.php

    r2907312 r2910521  
    3434        $loader->register(true);
    3535
    36         $filesToLoad = \Composer\Autoload\ComposerStaticInitd43aeadb67b43de6c1f9d304ae50b8c3::$files;
    37         $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
    38             if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
    39                 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
    40 
    41                 require $file;
    42             }
    43         }, null, null);
    44         foreach ($filesToLoad as $fileIdentifier => $file) {
    45             $requireFile($fileIdentifier, $file);
     36        $includeFiles = \Composer\Autoload\ComposerStaticInitd43aeadb67b43de6c1f9d304ae50b8c3::$files;
     37        foreach ($includeFiles as $fileIdentifier => $file) {
     38            composerRequired43aeadb67b43de6c1f9d304ae50b8c3($fileIdentifier, $file);
    4639        }
    4740
     
    4942    }
    5043}
     44
     45/**
     46 * @param string $fileIdentifier
     47 * @param string $file
     48 * @return void
     49 */
     50function composerRequired43aeadb67b43de6c1f9d304ae50b8c3($fileIdentifier, $file)
     51{
     52    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
     53        $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
     54
     55        require $file;
     56    }
     57}
  • appful-app/tags/2.0.1/lib/vendor/composer/autoload_static.php

    r2907312 r2910521  
    7676        'Psr\\Http\\Message\\' =>
    7777        array (
    78             0 => __DIR__ . '/..' . '/psr/http-message/src',
    79             1 => __DIR__ . '/..' . '/psr/http-factory/src',
     78            0 => __DIR__ . '/..' . '/psr/http-factory/src',
     79            1 => __DIR__ . '/..' . '/psr/http-message/src',
    8080        ),
    8181        'Psr\\Http\\Client\\' =>
  • appful-app/tags/2.0.1/lib/vendor/composer/installed.php

    r2907312 r2910521  
    22    'root' => array(
    33        'name' => '__root__',
    4         'pretty_version' => 'dev-main',
    5         'version' => 'dev-main',
    6         'reference' => 'b1254843d60da12919cc461fd4211144e8f8459d',
     4        'pretty_version' => '1.0.0+no-version-set',
     5        'version' => '1.0.0.0',
     6        'reference' => NULL,
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '__root__' => array(
    14             'pretty_version' => 'dev-main',
    15             'version' => 'dev-main',
    16             'reference' => 'b1254843d60da12919cc461fd4211144e8f8459d',
     14            'pretty_version' => '1.0.0+no-version-set',
     15            'version' => '1.0.0.0',
     16            'reference' => NULL,
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
  • appful-app/tags/2.0.1/readme.txt

    r2907312 r2910521  
    66Tested up to: 6.2
    77Requires PHP: 7.4
    8 Stable tag: 2.0.0
     8Stable tag: 2.0.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • appful-app/trunk/appful-app.php

    r2907312 r2910521  
    1212 * Plugin URI:        https://appful.io
    1313 * Description:       Appful® is the number 1 plugin for turning your WordPress Content into a native, beautiful app on iOS & Android in under 5 minutes.
    14  * Version:           2.0.0
     14 * Version:           2.0.1
    1515 * Requires at least: 5.8
    1616 * Requires PHP:      7.4
  • appful-app/trunk/includes/wp/WPAttachmentManager.php

    r2907312 r2910521  
    6161    }
    6262
    63     public static function get_meta_for_attachment( WP_Post $attachment ): array {
     63    public static function get_meta_for_attachment( WP_Post $attachment ) {
    6464        return wp_get_attachment_metadata( $attachment->ID );
    6565    }
  • appful-app/trunk/includes/wp/mapper/AttachmentMapper.php

    r2907312 r2910521  
    1212        $attachment_url  = WPAttachmentManager::get_url_for_attachment( $attachment );
    1313
    14         $width = $attachment_meta['width'];
    15         if ( is_null( $width ) ) {
    16             $width = 0;
    17         }
    18         $height = $attachment_meta['height'];
    19         if ( is_null( $height ) ) {
     14        if ( ! $attachment_meta ) {
     15            $width  = 0;
    2016            $height = 0;
     17        } else {
     18            $width = $attachment_meta['width'];
     19            if ( is_null( $width ) ) {
     20                $width = 0;
     21            }
     22            $height = $attachment_meta['height'];
     23            if ( is_null( $height ) ) {
     24                $height = 0;
     25            }
    2126        }
    2227
  • appful-app/trunk/lib/vendor/autoload.php

    r2907312 r2910521  
    44
    55if (PHP_VERSION_ID < 50600) {
    6     if (!headers_sent()) {
    7         header('HTTP/1.1 500 Internal Server Error');
    8     }
    9     $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
    10     if (!ini_get('display_errors')) {
    11         if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
    12             fwrite(STDERR, $err);
    13         } elseif (!headers_sent()) {
    14             echo $err;
    15         }
    16     }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     6    echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     7    exit(1);
    218}
    229
  • appful-app/trunk/lib/vendor/composer/ClassLoader.php

    r2907312 r2910521  
    4343class ClassLoader
    4444{
    45     /** @var \Closure(string):void */
    46     private static $includeFile;
    47 
    4845    /** @var ?string */
    4946    private $vendorDir;
     
    110107    {
    111108        $this->vendorDir = $vendorDir;
    112         self::initializeIncludeClosure();
    113109    }
    114110
     
    430426    {
    431427        if ($file = $this->findFile($class)) {
    432             $includeFile = self::$includeFile;
    433             $includeFile($file);
     428            includeFile($file);
    434429
    435430            return true;
     
    561556        return false;
    562557    }
    563 
    564     /**
    565      * @return void
    566      */
    567     private static function initializeIncludeClosure()
    568     {
    569         if (self::$includeFile !== null) {
    570             return;
    571         }
    572 
    573         /**
    574          * Scope isolated include.
    575          *
    576          * Prevents access to $this/self from included files.
    577          *
    578          * @param  string $file
    579          * @return void
    580          */
    581         self::$includeFile = \Closure::bind(static function($file) {
    582             include $file;
    583         }, null, null);
    584     }
    585558}
     559
     560/**
     561 * Scope isolated include.
     562 *
     563 * Prevents access to $this/self from included files.
     564 *
     565 * @param  string $file
     566 * @return void
     567 * @private
     568 */
     569function includeFile($file)
     570{
     571    include $file;
     572}
  • appful-app/trunk/lib/vendor/composer/autoload_psr4.php

    r2907312 r2910521  
    1010    'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
    1111    'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
    12     'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
     12    'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
    1313    'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
    1414    'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
  • appful-app/trunk/lib/vendor/composer/autoload_real.php

    r2907312 r2910521  
    3434        $loader->register(true);
    3535
    36         $filesToLoad = \Composer\Autoload\ComposerStaticInitd43aeadb67b43de6c1f9d304ae50b8c3::$files;
    37         $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
    38             if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
    39                 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
    40 
    41                 require $file;
    42             }
    43         }, null, null);
    44         foreach ($filesToLoad as $fileIdentifier => $file) {
    45             $requireFile($fileIdentifier, $file);
     36        $includeFiles = \Composer\Autoload\ComposerStaticInitd43aeadb67b43de6c1f9d304ae50b8c3::$files;
     37        foreach ($includeFiles as $fileIdentifier => $file) {
     38            composerRequired43aeadb67b43de6c1f9d304ae50b8c3($fileIdentifier, $file);
    4639        }
    4740
     
    4942    }
    5043}
     44
     45/**
     46 * @param string $fileIdentifier
     47 * @param string $file
     48 * @return void
     49 */
     50function composerRequired43aeadb67b43de6c1f9d304ae50b8c3($fileIdentifier, $file)
     51{
     52    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
     53        $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
     54
     55        require $file;
     56    }
     57}
  • appful-app/trunk/lib/vendor/composer/autoload_static.php

    r2907312 r2910521  
    7676        'Psr\\Http\\Message\\' =>
    7777        array (
    78             0 => __DIR__ . '/..' . '/psr/http-message/src',
    79             1 => __DIR__ . '/..' . '/psr/http-factory/src',
     78            0 => __DIR__ . '/..' . '/psr/http-factory/src',
     79            1 => __DIR__ . '/..' . '/psr/http-message/src',
    8080        ),
    8181        'Psr\\Http\\Client\\' =>
  • appful-app/trunk/lib/vendor/composer/installed.php

    r2907312 r2910521  
    22    'root' => array(
    33        'name' => '__root__',
    4         'pretty_version' => 'dev-main',
    5         'version' => 'dev-main',
    6         'reference' => 'b1254843d60da12919cc461fd4211144e8f8459d',
     4        'pretty_version' => '1.0.0+no-version-set',
     5        'version' => '1.0.0.0',
     6        'reference' => NULL,
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '__root__' => array(
    14             'pretty_version' => 'dev-main',
    15             'version' => 'dev-main',
    16             'reference' => 'b1254843d60da12919cc461fd4211144e8f8459d',
     14            'pretty_version' => '1.0.0+no-version-set',
     15            'version' => '1.0.0.0',
     16            'reference' => NULL,
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
  • appful-app/trunk/readme.txt

    r2907312 r2910521  
    66Tested up to: 6.2
    77Requires PHP: 7.4
    8 Stable tag: 2.0.0
     8Stable tag: 2.0.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.