adminer/update.php

18 lines
458 B
PHP

<?php
$adminer = dirname( __FILE__ ) . '/adminer.php';
$new = @file_get_contents( 'https://www.adminer.org/latest-en.php' );
if ( $new ) {
file_put_contents( $adminer, custom_fix( $new ) );
}
header( 'Location: ./' );
function custom_fix( $content ) {
$content = str_replace( '"privileges"=>array_flip(preg_split(\'~, *~\',$J["Privileges"])),', '"privileges"=>array_flip(["select","insert","update","references"]),', $content );
return $content;
}