Plugin Directory

Changeset 3134117


Ignore:
Timestamp:
08/12/2024 10:44:53 AM (19 months ago)
Author:
crazypsycho
Message:

fix some issues

Location:
dynamicconditions
Files:
65 added
4 edited

Legend:

Unmodified
Added
Removed
  • dynamicconditions/trunk/Legacy/WeakMap_Fallback.php

    r3133362 r3134117  
    11<?php
    2 
    3 if (!class_exists('WeakMap')) {
    4     final class WeakMap implements ArrayAccess, Countable, IteratorAggregate {
    5         private array $storage = [];
    6 
    7         public function offsetExists($offset): bool {
    8             return isset($this->storage[spl_object_id($offset)]);
    9         }
    10 
    11         /**
    12          * @param mixed $offset
    13          * @return mixed|null
    14          */
    15         public function offsetGet( $offset) {
    16             return $this->storage[spl_object_id($offset)] ?? null;
    17         }
    18 
    19         public function offsetSet($offset, $value): void {
    20             $this->storage[spl_object_id($offset)] = $value;
    21         }
    22 
    23         public function offsetUnset($offset): void {
    24             unset($this->storage[spl_object_id($offset)]);
    25         }
    26 
    27         public function count(): int {
    28             return count($this->storage);
    29         }
    30 
    31         public function getIterator(): Traversable {
    32             foreach ($this->storage as $key => $value) {
    33                 yield $key => $value;
    34             }
    35         }
    36     }
    37 }
  • dynamicconditions/trunk/Public/DynamicConditionsPublic.php

    r3133362 r3134117  
    302302
    303303        //prevent shortcodes from execution
    304         $this->shortcodeTags += $GLOBALS['shortcode_tags'];
     304        $this->shortcodeTags = $GLOBALS['shortcode_tags'];
    305305        $GLOBALS['shortcode_tags'] = [];
    306306
     
    309309            'isHidden' => true,
    310310            'settings' => $settings,
    311             'ob_level' => ob_get_level(),
     311            #'ob_level' => ob_get_level(),
    312312        ];
    313313    }
     
    325325        }
    326326
    327         while (ob_get_level() > $this->widgetCache[$section->get_id()]['ob_level']) {
     327        /*while ( ob_get_level() > $this->widgetCache[$section->get_id()]['ob_level'] ) {
    328328            ob_end_flush();
    329         }
     329        }*/
    330330
    331331        $content = ob_get_clean();
     
    373373
    374374        if ( $this->getMode() === 'edit' ) {
     375            return false;
     376        }
     377        if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'POST') {
    375378            return false;
    376379        }
     
    660663    /**
    661664     * Parse shortcode if active
    662      */
    663     private function parseShortcode( ?string $value, array $settings = [] ): ?string {
     665     * @return mixed
     666     */
     667    private function parseShortcode( $value, array $settings = [] ) {
     668        if ( !is_string( $value ) ) {
     669            return $value;
     670        }
    664671        if ( empty( $settings['dynamicconditions_parse_shortcodes'] ) ) {
    665672            return $value;
  • dynamicconditions/trunk/README.txt

    r3133363 r3134117  
    66Requires PHP: 7.4
    77Tested up to: 6.6
    8 Stable tag: 1.7.2
     8Stable tag: 1.7.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6666
    6767== Changelog ==
     68= 1.7.3 =
     69* Fix issue with date-conditions
     70
    6871= 1.7.2 =
    6972* Fix issue with broken layout caused by weakmap and ob_cache
  • dynamicconditions/trunk/dynamic-conditions.php

    r3133362 r3134117  
    2323 * Plugin URI:        https://github.com/RTO-Websites/dynamic-conditions
    2424 * Description:       Activates conditions for dynamic tags to show/hides a widget.
    25  * Version:           1.7.2
     25 * Version:           1.7.3
    2626 * Author:            RTO GmbH
    2727 * Author URI:        https://www.rto.de
     
    3737}
    3838
    39 define( 'DynamicConditions_VERSION', '1.7.2' );
     39define( 'DynamicConditions_VERSION', '1.7.3' );
    4040
    4141define( 'DynamicConditions_DIR', str_replace( '\\', '/', __DIR__ ) );
Note: See TracChangeset for help on using the changeset viewer.