Changeset 737 for trunk/lib


Ignore:
Timestamp:
Nov 14, 2020 4:50:42 PM (3 years ago)
Author:
anonymous
Message:

Fix 'Array and string offset access syntax with curly braces is deprecated'

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/ImageThumb.inc.php

    r648 r737  
    386386
    387387            // Destination filename uses the extension defined by dest_file_extension.
    388             if ('/' == $spec['dest_dir']{0}) {
     388            if ('/' == $spec['dest_dir'][0]) {
    389389                // Absolute path.
    390390                $dest_file = sprintf('%s/%s.%s', $spec['dest_dir'], mb_substr($file_name, 0, mb_strrpos($file_name, '.')), $spec['dest_file_extension']);
     
    675675        foreach ($this->_image_specs as $spec) {
    676676            // Get base directory depending on if the spec's dest_dir is an absolute path or not.
    677             $dest_dir = '/' == $spec['dest_dir']{0} ? $spec['dest_dir'] : sprintf('%s/%s', $this->getParam('source_dir'), $spec['dest_dir']);
     677            $dest_dir = '/' == $spec['dest_dir'][0] ? $spec['dest_dir'] : sprintf('%s/%s', $this->getParam('source_dir'), $spec['dest_dir']);
    678678            if ($use_glob) {
    679679                $dest_file = realpath(sprintf('%s/%s', $dest_dir, $this->_glob($file_name, $dest_dir)));
     
    789789                } else {
    790790                    // Get base directory depending on if the spec's dest_dir is an absolute path or not.
    791                     $dest_dir = '/' == $spec['dest_dir']{0} ? $spec['dest_dir'] : sprintf('%s/%s', $this->getParam('source_dir'), $spec['dest_dir']);
     791                    $dest_dir = '/' == $spec['dest_dir'][0] ? $spec['dest_dir'] : sprintf('%s/%s', $this->getParam('source_dir'), $spec['dest_dir']);
    792792                }
    793793                if (!file_exists($dest_dir)) {
  • trunk/lib/Validator.inc.php

    r724 r737  
    340340        // The part after the @.
    341341        // If domain is an IP [XXX.XXX.XXX.XXX] strip off the brackets.
    342         $domain = $e_parts[3]{0} == '[' ? mb_substr($e_parts[3], 1, -1) : $e_parts[3];
     342        $domain = $e_parts[3][0] == '[' ? mb_substr($e_parts[3], 1, -1) : $e_parts[3];
    343343
    344344        // Test length.
Note: See TracChangeset for help on using the changeset viewer.