From 6d830498a42f897fc29b483b7db3db161a9956bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 8 May 2021 19:20:46 +0200 Subject: [PATCH] 4.8.0 (#11) * Add sources --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 16 +- scripts/install | 3 +- scripts/upgrade | 18 +- sources/root_access_disabled/adminer.php | 2460 ++++++++++------------ sources/with_root_access/index.php | 2460 ++++++++++------------ 7 files changed, 2215 insertions(+), 2746 deletions(-) diff --git a/README.md b/README.md index e2ee524..b2e32d8 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Adminer (formerly phpMinAdmin better alternate to phpMyAdmin) is a full-featured database management tool (MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, SimpleDB, Elasticsearch, MongoDB). Replace phpMyAdmin with Adminer and you will get a tidier user interface, better support for MySQL features, higher performance and more security. [See detailed comparison](https://www.adminer.org/en/phpmyadmin). -**Shipped version:** 4.7.8 +**Shipped version:** 4.8.0 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 0cd0a4b..5ffa594 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install ## Vue d'ensemble Adminer (anciennement phpMinAdmin, meilleure alternative à phpMyAdmin) est un outil de gestion de base de données (MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, SimpleDB, Elasticsearch, MongoDB). Remplacez phpMyAdmin par Adminer et vous obtiendrez une interface utilisateur plus ordonnée, une meilleure prise en charge des fonctionnalités MySQL, des performances plus élevées et plus de sécurité. [Voir comparaison détaillée](https://www.adminer.org/en/phpmyadmin). -**Version incluse :** 4.7.8 +**Version incluse :** 4.8.0 ## Captures d'écran diff --git a/manifest.json b/manifest.json index c7e4fda..9e8a926 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "fr": "Gestionnaire de base de données en un seul fichier PHP" }, - "version": "4.7.8~ynh1", + "version": "4.8.0~ynh1", "url": "https://www.adminer.org/", "license": "Apache-2.0", "maintainer": { @@ -21,7 +21,7 @@ "url": "https://github.com/jesuisfol/adminer_ynh" }, "requirements": { - "yunohost": ">= 4.1.2" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ @@ -33,19 +33,11 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Adminer", - "fr": "Choisissez un domaine pour Adminer" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Adminer", - "fr": "Choisissez un chemin pour Adminer" - }, "example": "/adminer", "default": "/adminer" }, @@ -61,10 +53,6 @@ { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "default": true } ] diff --git a/scripts/install b/scripts/install index f10d2e9..0c7f432 100644 --- a/scripts/install +++ b/scripts/install @@ -43,7 +43,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=root_access --value=$root_access #================================================= @@ -107,7 +106,7 @@ ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary or protect it if [ $is_public -eq 1 ] then - ynh_permission_update --permission "main" --add "visitors" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index dbc436d..53faa4c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,11 +16,10 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) -root_access=$(ynh_app_setting_get --app=$app --key=root_access) +domain=$(ynh_app_setting_get --app=$app --key=domain) +path_url=$(ynh_app_setting_get --app=$app --key=path) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) +root_access=$(ynh_app_setting_get --app=$app --key=root_access) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= @@ -28,15 +27,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/var/www/$app diff --git a/sources/root_access_disabled/adminer.php b/sources/root_access_disabled/adminer.php index b097a4c..b9ce4d0 100644 --- a/sources/root_access_disabled/adminer.php +++ b/sources/root_access_disabled/adminer.php @@ -5,183 +5,184 @@ * @copyright 2007 Jakub Vrana * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 * @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other) -* @version 4.7.8 -*/error_reporting(6133);$Yc=!preg_match('~^(unsafe_raw)?$~',ini_get("filter.default"));if($Yc||ini_get("filter.default_flags")){foreach(array('_GET','_POST','_COOKIE','_SERVER')as$X){$Mi=filter_input_array(constant("INPUT$X"),FILTER_UNSAFE_RAW);if($Mi)$$X=$Mi;}}if(function_exists("mb_internal_encoding"))mb_internal_encoding("8bit");function -connection(){global$h;return$h;}function +* @version 4.8.0 +*/function +adminer_errors($Ac,$Cc){return!!preg_match('~^(Trying to access array offset on value of type null|Undefined array key)~',$Cc);}error_reporting(6135);set_error_handler('adminer_errors',2);$Yc=!preg_match('~^(unsafe_raw)?$~',ini_get("filter.default"));if($Yc||ini_get("filter.default_flags")){foreach(array('_GET','_POST','_COOKIE','_SERVER')as$X){$Hi=filter_input_array(constant("INPUT$X"),FILTER_UNSAFE_RAW);if($Hi)$$X=$Hi;}}if(function_exists("mb_internal_encoding"))mb_internal_encoding("8bit");function +connection(){global$g;return$g;}function adminer(){global$b;return$b;}function version(){global$ia;return$ia;}function -idf_unescape($v){$re=substr($v,-1);return -str_replace($re.$re,$re,substr($v,1,-1));}function +idf_unescape($v){$pe=substr($v,-1);return +str_replace($pe.$pe,$pe,substr($v,1,-1));}function escape_string($X){return substr(q($X),1,-1);}function number($X){return preg_replace('~[^0-9]+~','',$X);}function number_type(){return'((?$W){unset($vg[$z][$ge]);if(is_array($W)){$vg[$z][stripslashes($ge)]=$W;$vg[]=&$vg[$z][stripslashes($ge)];}else$vg[$z][stripslashes($ge)]=($Yc?$W:stripslashes($W));}}}}function -bracket_escape($v,$Pa=false){static$xi=array(':'=>':1',']'=>':2','['=>':3','"'=>':4');return -strtr($v,($Pa?array_flip($xi):$xi));}function -min_version($ej,$Fe="",$i=null){global$h;if(!$i)$i=$h;$qh=$i->server_info;if($Fe&&preg_match('~([\d.]+)-MariaDB~',$qh,$B)){$qh=$B[1];$ej=$Fe;}return(version_compare($qh,$ej)>=0);}function -charset($h){return(min_version("5.5.3",0,$h)?"utf8mb4":"utf8");}function -script($Ah,$wi="\n"){return"$Ah$wi";}function -script_src($Ri){return"\n";}function +remove_slashes($sg,$Yc=false){if(function_exists("get_magic_quotes_gpc")&&get_magic_quotes_gpc()){while(list($z,$X)=each($sg)){foreach($X +as$ge=>$W){unset($sg[$z][$ge]);if(is_array($W)){$sg[$z][stripslashes($ge)]=$W;$sg[]=&$sg[$z][stripslashes($ge)];}else$sg[$z][stripslashes($ge)]=($Yc?$W:stripslashes($W));}}}}function +bracket_escape($v,$Na=false){static$ti=array(':'=>':1',']'=>':2','['=>':3','"'=>':4');return +strtr($v,($Na?array_flip($ti):$ti));}function +min_version($Yi,$Ce="",$h=null){global$g;if(!$h)$h=$g;$mh=$h->server_info;if($Ce&&preg_match('~([\d.]+)-MariaDB~',$mh,$C)){$mh=$C[1];$Yi=$Ce;}return(version_compare($mh,$Yi)>=0);}function +charset($g){return(min_version("5.5.3",0,$g)?"utf8mb4":"utf8");}function +script($xh,$si="\n"){return"$xh$si";}function +script_src($Mi){return"\n";}function nonce(){return' nonce="'.get_nonce().'"';}function target_blank(){return' target="_blank" rel="noreferrer noopener"';}function -h($Q){return -str_replace("\0","�",htmlspecialchars($Q,ENT_QUOTES,'utf-8'));}function -nl_br($Q){return -str_replace("\n","
",$Q);}function -checkbox($C,$Y,$gb,$ne="",$wf="",$lb="",$oe=""){$I="".($wf?script("qsl('input').onclick = function () { $wf };",""):"");return($ne!=""||$lb?"$I".h($ne)."":$I);}function -optionlist($Bf,$kh=null,$Wi=false){$I="";foreach($Bf -as$ge=>$W){$Cf=array($ge=>$W);if(is_array($W)){$I.='';$Cf=$W;}foreach($Cf -as$z=>$X)$I.=''.h($X);if(is_array($W))$I.='';}return$I;}function -html_select($C,$Bf,$Y="",$vf=true,$oe=""){if($vf)return"".(is_string($vf)?script("qsl('select').onchange = function () { $vf };",""):"");$I="";foreach($Bf -as$z=>$X)$I.="";return$I;}function -select_input($Ka,$Bf,$Y="",$vf="",$hg=""){$bi=($Bf?"select":"input");return"<$bi$Ka".($Bf?">