Dotclear

Changeset 3862:1ff5b84e865a


Ignore:
Timestamp:
09/04/18 15:29:15 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.14
Message:

Fix upgrade modification for media_exclusion default setting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/dbschema/upgrade.php

    r3850 r3862  
    311311        } 
    312312 
    313         if (version_compare($version, '2.4.0', '<=')) { 
    314             # setup media_exclusion 
    315             $strReq = 'UPDATE ' . $core->prefix . 'setting ' . 
    316                 "SET setting_value = '/\\.php\$/i' " . 
    317                 "WHERE setting_id = 'media_exclusion' " . 
    318                 "AND setting_value = '' "; 
    319             $core->con->execute($strReq); 
    320         } 
    321  
    322313        if (version_compare($version, '2.5', '<=')) { 
    323314            # Try to disable daInstaller plugin if it has been installed outside the default plugins directory 
     
    454445                " AND setting_value = '1.11.1' "; 
    455446            $core->con->execute($strReq); 
    456             # setup media_exclusion (cope with php, php5, php7, … rather than only .php) 
    457             $strReq = 'UPDATE ' . $core->prefix . 'setting ' . 
    458                 " SET setting_value = '/\\.php[0-9]*\$/i' " . 
    459                 " WHERE setting_id = 'media_exclusion' " . 
    460                 " AND setting_ns = 'system' " . 
    461                 " AND setting_value = '/\\.php\$/i' "; 
    462             $core->con->execute($strReq); 
    463447            # Some new settings should be initialized, prepare db queries 
    464448            $strReq = 'INSERT INTO ' . $core->prefix . 'setting' . 
     
    466450                ' VALUES(\'%s\',\'system\',\'%s\',\'boolean\',\'%s\')'; 
    467451            $core->con->execute(sprintf($strReq, 'no_search', '0', 'Disable internal search system')); 
    468         } 
    469  
    470         if (version_compare($version, '2.8.2', '<=')) { 
    471             # Update flie exclusion upload regex 
    472             $strReq = 'UPDATE ' . $core->prefix . 'setting ' . 
    473                 " SET setting_value = '/\\.(phps?|pht(ml)?|phl)[0-9]*\$/i' " . 
    474                 " WHERE setting_id = 'media_exclusion' " . 
    475                 " AND setting_ns = 'system' " . 
    476                 " AND (setting_value = '/\\.php[0-9]*\$/i' " . 
    477                 "   OR setting_value = '/\\.php\$/i') "; 
    478             $core->con->execute($strReq); 
    479452        } 
    480453 
     
    504477            self::prefs2array('dashboard', 'favorites'); 
    505478            self::prefs2array('interface', 'media_last_dirs'); 
    506  
    507             # Update flie exclusion upload regex 
    508             $strReq = 'UPDATE ' . $core->prefix . 'setting ' . 
    509                 " SET setting_value = '/\\.(phps?|pht(ml)?|phl|s?html?|js)[0-9]*\$/i' " . 
    510                 " WHERE setting_id = 'media_exclusion' " . 
    511                 " AND setting_ns = 'system' " . 
    512                 " AND (setting_value = '/\\.php[0-9]*\$/i' " . 
    513                 "   OR setting_value = '/\\.php\$/i') " . 
    514                 "   OR setting_value = '/\\.(phps?|pht(ml)?|phl)[0-9]*\$/i' "; 
    515             $core->con->execute($strReq); 
    516479        } 
    517480 
     
    526489                @file_put_contents($f, 'Require all denied' . "\n" . 'Deny from all' . "\n"); 
    527490            } 
    528  
    529             # Update flie exclusion upload regex 
    530             $strReq = 'UPDATE ' . $core->prefix . 'setting ' . 
    531                 " SET setting_value = '/\\.(phps?|pht(ml)?|phl|s?html?|js|htaccess)[0-9]*\$/i' " . 
    532                 " WHERE setting_id = 'media_exclusion' " . 
    533                 " AND setting_ns = 'system' " . 
    534                 " AND (setting_value = '/\\.php[0-9]*\$/i' " . 
    535                 "   OR setting_value = '/\\.php\$/i') " . 
    536                 "   OR setting_value = '/\\.(phps?|pht(ml)?|phl)[0-9]*\$/i' " . 
    537                 "   OR setting_value = '/\\.(phps?|pht(ml)?|phl|s?html?|js)[0-9]*\$/i'"; 
    538             $core->con->execute($strReq); 
    539491 
    540492            # Some new settings should be initialized, prepare db queries 
     
    688640        } 
    689641 
    690         if (version_compare($version, '2.14.2', '<')) { 
     642        if (version_compare($version, '2.14.3', '<')) { 
    691643            # Update flie exclusion upload regex 
    692644            $strReq = 'UPDATE ' . $core->prefix . 'setting ' . 
    693                 " SET setting_value = '/\\.(phps?|pht(ml)?|phl|.?html?|js|htaccess)[0-9]*\$/i' " . 
     645                " SET setting_value = '/\\.(phps?|pht(ml)?|phl|.?html?|js|htaccess)[0-9]*$/i' " . 
    694646                " WHERE setting_id = 'media_exclusion' " . 
    695647                " AND setting_ns = 'system' " . 
    696                 " AND (setting_value = '/\\.php[0-9]*\$/i' " . 
    697                 "   OR setting_value = '/\\.php\$/i') " . 
    698                 "   OR setting_value = '/\\.(phps?|pht(ml)?|phl)[0-9]*\$/i' " . 
    699                 "   OR setting_value = '/\\.(phps?|pht(ml)?|phl|s?html?|js)[0-9]*\$/i'" . 
    700                 "   OR setting_value = '/\\.(phps?|pht(ml)?|phl|s?html?|js|htaccess)[0-9]*\$/i'"; 
     648                " AND (setting_value = '/\\.php[0-9]*$/i' " . 
     649                "   OR setting_value = '/\\.php$/i') " . 
     650                "   OR setting_value = '/\\.(phps?|pht(ml)?|phl)[0-9]*$/i' " . 
     651                "   OR setting_value = '/\\.(phps?|pht(ml)?|phl|s?html?|js)[0-9]*$/i'" . 
     652                "   OR setting_value = '/\\.(phps?|pht(ml)?|phl|s?html?|js|htaccess)[0-9]*$/i'"; 
    701653            $core->con->execute($strReq); 
    702654        } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map