Changeset 73758 in spip-zone


Ignore:
Timestamp:
Jun 20, 2013, 3:02:53 PM (6 years ago)
Author:
cedric@…
Message:

renomer is_utf8 en isutf8 pour eviter le conflit avec la fonction de SPIP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/adminer/adminer.php

    r72884 r73758  
    396396repeat_pattern($Ee,$rd){return
    397397str_repeat("$Ee{0,65535}",$rd/65535)."$Ee{0,".($rd%65535)."}";}function
    398 is_utf8($X){return(preg_match('~~u',$X)&&!preg_match('~[\\0-\\x8\\xB\\xC\\xE-\\x1F]~',$X));}function
     398is__utf8($X){return(preg_match('~~u',$X)&&!preg_match('~[\\0-\\x8\\xB\\xC\\xE-\\x1F]~',$X));}function
    399399shorten_utf8($O,$rd=80,$Of=""){if(!preg_match("(^(".repeat_pattern("[\t\r\n -\x{FFFF}]",$rd).")($)?)u",$O,$A))preg_match("(^(".repeat_pattern("[\t\r\n -~]",$rd).")($)?)",$O,$A);return
    400400h($A[1]).$Of.(isset($A[2])?"":"<i>...</i>");}function
     
    22562256Min_Result($H);$this->affected_rows=$this->_link->changes();return
    22572257true;}function
    2258 quote($O){return(is_utf8($O)?"'".$this->_link->escapeString($O)."'":"x'".reset(unpack('H*',$O))."'");}function
     2258quote($O){return(is__utf8($O)?"'".$this->_link->escapeString($O)."'":"x'".reset(unpack('H*',$O))."'");}function
    22592259store_result(){return$this->_result;}function
    22602260result($G,$n=0){$H=$this->query($G);if(!is_object($H))return
     
    28872887idf_escape($t);}function
    28882888connect(){global$b;$i=new
    2889 Min_DB;$mb=$b->credentials();if($i->connect($mb[0],$mb[1],$mb[2])){$i->query("SET sql_quote_show_create = 1, autocommit = 1");return$i;}$I=$i->error;if(function_exists('iconv')&&!is_utf8($I)&&strlen($sf=iconv("windows-1250","utf-8",$I))>strlen($I))$I=$sf;return$I;}function
     2889Min_DB;$mb=$b->credentials();if($i->connect($mb[0],$mb[1],$mb[2])){$i->query("SET sql_quote_show_create = 1, autocommit = 1");return$i;}$I=$i->error;if(function_exists('iconv')&&!is__utf8($I)&&strlen($sf=iconv("windows-1250","utf-8",$I))>strlen($I))$I=$sf;return$I;}function
    28902890get_databases($qc){global$i;$I=get_session("dbs");if($I===null){$G=($i->server_info>=5?"SELECT SCHEMA_NAME FROM information_schema.SCHEMATA":"SHOW DATABASES");$I=($qc?slow_query($G):get_vals($G));restart_session();set_session("dbs",$I);stop_session();}return$I;}function
    28912891limit($G,$Z,$y,$C=0,$zf=" "){return" $G$Z".($y!==null?$zf."LIMIT $y".($C?" OFFSET $C":""):"");}function
     
    30363036rowDescriptions($K,$sc){return$K;}function
    30373037selectLink($X,$n){}function
    3038 selectVal($X,$z,$n){$I=($X===null?"<i>NULL</i>":(ereg("char|binary",$n["type"])&&!ereg("var",$n["type"])?"<code>$X</code>":$X));if(ereg('blob|bytea|raw|file',$n["type"])&&!is_utf8($X))$I=lang(35,strlen(html_entity_decode($X,ENT_QUOTES)));return($z?"<a href='".h($z)."'>$I</a>":$I);}function
     3038selectVal($X,$z,$n){$I=($X===null?"<i>NULL</i>":(ereg("char|binary",$n["type"])&&!ereg("var",$n["type"])?"<code>$X</code>":$X));if(ereg('blob|bytea|raw|file',$n["type"])&&!is__utf8($X))$I=lang(35,strlen(html_entity_decode($X,ENT_QUOTES)));return($z?"<a href='".h($z)."'>$I</a>":$I);}function
    30393039editVal($X,$n){return$X;}function
    30403040selectColumnsPrint($L,$g){global$Ac,$Fc;print_fieldset("select",lang(36),$L);$r=0;$zc=array(lang(37)=>$Ac,lang(38)=>$Fc);foreach($L
     
    31503150echo"<p>$ef";}page_footer("db");if($k)echo"<script type='text/javascript'>ajaxSetHtml('".js_escape(ME)."script=connect');</script>\n";}if(isset($_GET["status"]))$_GET["variables"]=$_GET["status"];if(!(DB!=""?$i->select_db(DB):isset($_GET["sql"])||isset($_GET["dump"])||isset($_GET["database"])||isset($_GET["processlist"])||isset($_GET["privileges"])||isset($_GET["user"])||isset($_GET["variables"])||$_GET["script"]=="connect"||$_GET["script"]=="kill")){if(DB!=""||$_GET["refresh"]){restart_session();set_session("dbs",null);}connect_error();exit;}if(support("scheme")&&DB!=""&&$_GET["ns"]!==""){if(!isset($_GET["ns"]))redirect(preg_replace('~ns=[^&]*&~','',ME)."ns=".get_schema());if(!set_schema($_GET["ns"])){page_header(lang(84).": ".h($_GET["ns"]),lang(85),true);page_footer("ns");exit;}}function
    31513151select($H,$j=null,$Lc="",$oe=array()){$ud=array();$v=array();$g=array();$Ia=array();$U=array();$I=array();odd('');for($r=0;$J=$H->fetch_row();$r++){if(!$r){echo"<table cellspacing='0' class='nowrap'>\n","<thead><tr>";for($bd=0;$bd<count($J);$bd++){$n=$H->fetch_field();$B=$n->name;$ne=$n->orgtable;$me=$n->orgname;$I[$n->table]=$ne;if($Lc)$ud[$bd]=($B=="table"?"table=":($B=="possible_keys"?"indexes=":null));elseif($ne!=""){if(!isset($v[$ne])){$v[$ne]=array();foreach(indexes($ne,$j)as$u){if($u["type"]=="PRIMARY"){$v[$ne]=array_flip($u["columns"]);break;}}$g[$ne]=$v[$ne];}if(isset($g[$ne][$me])){unset($g[$ne][$me]);$v[$ne][$me]=$bd;$ud[$bd]=$ne;}}if($n->charsetnr==63)$Ia[$bd]=true;$U[$bd]=$n->type;$B=h($B);echo"<th".($ne!=""||$n->name!=$me?" title='".h(($ne!=""?"$ne.":"").$me)."'":"").">".($Lc?"<a href='$Lc".strtolower($B)."' target='_blank' rel='noreferrer' class='help'>$B</a>":$B);}echo"</thead>\n";}echo"<tr".odd().">";foreach($J
    3152 as$x=>$X){if($X===null)$X="<i>NULL</i>";elseif($Ia[$x]&&!is_utf8($X))$X="<i>".lang(35,strlen($X))."</i>";elseif(!strlen($X))$X="&nbsp;";else{$X=h($X);if($U[$x]==254)$X="<code>$X</code>";}if(isset($ud[$x])&&!$g[$ud[$x]]){if($Lc){$P=$J[array_search("table=",$ud)];$z=$ud[$x].urlencode($oe[$P]!=""?$oe[$P]:$P);}else{$z="edit=".urlencode($ud[$x]);foreach($v[$ud[$x]]as$Ua=>$bd)$z.="&where".urlencode("[".bracket_escape($Ua)."]")."=".urlencode($J[$bd]);}$X="<a href='".h(ME.$z)."'>$X</a>";}echo"<td>$X";}}echo($r?"</table>":"<p class='message'>".lang(86))."\n";return$I;}function
     3152as$x=>$X){if($X===null)$X="<i>NULL</i>";elseif($Ia[$x]&&!is__utf8($X))$X="<i>".lang(35,strlen($X))."</i>";elseif(!strlen($X))$X="&nbsp;";else{$X=h($X);if($U[$x]==254)$X="<code>$X</code>";}if(isset($ud[$x])&&!$g[$ud[$x]]){if($Lc){$P=$J[array_search("table=",$ud)];$z=$ud[$x].urlencode($oe[$P]!=""?$oe[$P]:$P);}else{$z="edit=".urlencode($ud[$x]);foreach($v[$ud[$x]]as$Ua=>$bd)$z.="&where".urlencode("[".bracket_escape($Ua)."]")."=".urlencode($J[$bd]);}$X="<a href='".h(ME.$z)."'>$X</a>";}echo"<td>$X";}}echo($r?"</table>":"<p class='message'>".lang(86))."\n";return$I;}function
    31533153referencable_primary($yf){$I=array();foreach(table_status('',true)as$Tf=>$P){if($Tf!=$yf&&fk_support($P)){foreach(fields($Tf)as$n){if($n["primary"]){if($I[$Tf]){unset($I[$Tf]);break;}$I[$Tf]=$n;}}}}return$I;}function
    31543154textarea($B,$Y,$K=10,$Xa=80){echo"<textarea name='$B' rows='$K' cols='$Xa' class='sqlarea' spellcheck='false' wrap='off' onkeydown='return textareaKeydown(this, event);'>";if(is_array($Y)){foreach($Y
     
    34383438as$x=>$X){if(strlen($X)>64){$x="MD5(".(strpos($x,'(')?$x:idf_escape($x)).")";$X=md5($X);}$Cg.="&".($X!==null?urlencode("where[".bracket_escape($x)."]")."=".urlencode($X):"null%5B%5D=".urlencode($x));}echo"<tr".odd().">".(!$Dc&&$L?"":"<td>".checkbox("check[]",substr($Cg,1),in_array(substr($Cg,1),(array)$_POST["check"]),"","this.form['all'].checked = false; formUncheck('all-page');").($Xc||information_schema(DB)?"":" <a href='".h(ME."edit=".urlencode($a).$Cg)."'>".lang(230)."</a>"));foreach($J
    34393439as$x=>$X){if(isset($Qd[$x])){$n=$o[$x];if($X!=""&&(!isset($Ob[$x])||$Ob[$x]!=""))$Ob[$x]=(is_mail($X)?$Qd[$x]:"");$z="";$X=$b->editVal($X,$n);if($X!==null){if(ereg('blob|bytea|raw|file',$n["type"])&&$X!="")$z=ME.'download='.urlencode($a).'&field='.urlencode($x).$Cg;if($X==="")$X="&nbsp;";elseif($fg!=""&&is_shortable($n))$X=shorten_utf8($X,max(0,+$fg));else$X=h($X);if(!$z){foreach((array)$tc[$x]as$p){if(count($tc[$x])==1||end($p["source"])==$x){$z="";foreach($p["source"]as$r=>$Ef)$z.=where_link($r,$p["target"][$r],$K[$Pd][$Ef]);$z=($p["db"]!=""?preg_replace('~([?&]db=)[^&]+~','\\1'.urlencode($p["db"]),ME):ME).'select='.urlencode($p["table"]).$z;if(count($p["source"])==1)break;}}}if($x=="COUNT(*)"){$z=ME."select=".urlencode($a);$r=0;foreach((array)$_GET["where"]as$W){if(!array_key_exists($W["col"],$Bg))$z.=where_link($r++,$W["col"],$W["val"],$W["op"]);}foreach($Bg
    3440 as$dd=>$W)$z.=where_link($r++,$dd,$W);}}if(!$z&&($z=$b->selectLink($J[$x],$n))===null){if(is_mail($J[$x]))$z="mailto:$J[$x]";if($Ve=is_url($J[$x]))$z=($Ve=="http"&&$ba?$J[$x]:"$Ve://www.adminer.org/redirect/?url=".urlencode($J[$x]));}$s=h("val[$Cg][".bracket_escape($x)."]");$Y=$_POST["val"][$Cg][bracket_escape($x)];$Gc=h($Y!==null?$Y:$J[$x]);$wd=strpos($X,"<i>...</i>");$Kb=is_utf8($X)&&$K[$Pd][$x]==$J[$x]&&!$Ac[$x];$eg=ereg('text|lob',$n["type"]);echo(($_GET["modify"]&&$Kb)||$Y!==null?"<td>".($eg?"<textarea name='$s' cols='30' rows='".(substr_count($J[$x],"\n")+1)."'>$Gc</textarea>":"<input name='$s' value='$Gc' size='$sd[$x]'>"):"<td id='$s' onclick=\"selectClick(this, event, ".($wd?2:($eg?1:0)).($Kb?"":", '".h(lang(232))."'").");\">".$b->selectVal($X,$z,$n));}}if($Ea)echo"<td>";$b->backwardKeysPrint($Ea,$K[$Pd]);echo"</tr>\n";}if(is_ajax())exit;echo"</table>\n",(!$Dc&&$L?"":"<script type='text/javascript'>tableCheck();</script>\n");}if(($K||$D)&&!is_ajax()){$Yb=true;if($_GET["page"]!="last"&&+$y&&!$Xc&&($wc>=$y||$D)){$wc=found_rows($Q,$Z);if($wc<max(1e4,2*($D+1)*$y))$wc=reset(slow_query("SELECT COUNT(*) FROM ".table($a).($Z?" WHERE ".implode(" AND ",$Z):"")));else$Yb=false;}if(+$y&&($wc===false||$wc>$y||$D)){echo"<p class='pages'>";$Ad=($wc===false?$D+(count($K)>=$y?2:1):floor(($wc-1)/$y));echo'<a href="'.h(remove_from_uri("page"))."\" onclick=\"pageClick(this.href, +prompt('".lang(233)."', '".($D+1)."'), event); return false;\">".lang(233)."</a>:",pagination(0,$D).($D>5?" ...":"");for($r=max(1,$D-4);$r<min($Ad,$D+5);$r++)echo
     3440as$dd=>$W)$z.=where_link($r++,$dd,$W);}}if(!$z&&($z=$b->selectLink($J[$x],$n))===null){if(is_mail($J[$x]))$z="mailto:$J[$x]";if($Ve=is_url($J[$x]))$z=($Ve=="http"&&$ba?$J[$x]:"$Ve://www.adminer.org/redirect/?url=".urlencode($J[$x]));}$s=h("val[$Cg][".bracket_escape($x)."]");$Y=$_POST["val"][$Cg][bracket_escape($x)];$Gc=h($Y!==null?$Y:$J[$x]);$wd=strpos($X,"<i>...</i>");$Kb=is__utf8($X)&&$K[$Pd][$x]==$J[$x]&&!$Ac[$x];$eg=ereg('text|lob',$n["type"]);echo(($_GET["modify"]&&$Kb)||$Y!==null?"<td>".($eg?"<textarea name='$s' cols='30' rows='".(substr_count($J[$x],"\n")+1)."'>$Gc</textarea>":"<input name='$s' value='$Gc' size='$sd[$x]'>"):"<td id='$s' onclick=\"selectClick(this, event, ".($wd?2:($eg?1:0)).($Kb?"":", '".h(lang(232))."'").");\">".$b->selectVal($X,$z,$n));}}if($Ea)echo"<td>";$b->backwardKeysPrint($Ea,$K[$Pd]);echo"</tr>\n";}if(is_ajax())exit;echo"</table>\n",(!$Dc&&$L?"":"<script type='text/javascript'>tableCheck();</script>\n");}if(($K||$D)&&!is_ajax()){$Yb=true;if($_GET["page"]!="last"&&+$y&&!$Xc&&($wc>=$y||$D)){$wc=found_rows($Q,$Z);if($wc<max(1e4,2*($D+1)*$y))$wc=reset(slow_query("SELECT COUNT(*) FROM ".table($a).($Z?" WHERE ".implode(" AND ",$Z):"")));else$Yb=false;}if(+$y&&($wc===false||$wc>$y||$D)){echo"<p class='pages'>";$Ad=($wc===false?$D+(count($K)>=$y?2:1):floor(($wc-1)/$y));echo'<a href="'.h(remove_from_uri("page"))."\" onclick=\"pageClick(this.href, +prompt('".lang(233)."', '".($D+1)."'), event); return false;\">".lang(233)."</a>:",pagination(0,$D).($D>5?" ...":"");for($r=max(1,$D-4);$r<min($Ad,$D+5);$r++)echo
    34413441pagination($r,$D);if($Ad>0){echo($D+5<$Ad?" ...":""),($Yb&&$wc!==false?pagination($Ad,$D):" <a href='".h(remove_from_uri("page")."&page=last")."' title='~$Ad'>".lang(234)."</a>");}echo(($wc===false?count($K)+1:$wc-$D*$y)>$y?' <a href="'.h(remove_from_uri("page")."&page=".($D+1)).'" onclick="return !selectLoadMore(this, '.(+$y).', \''.lang(235).'\');">'.lang(236).'</a>':'');}echo"<p>\n",($wc!==false?"(".($Yb?"":"~ ").lang(123,$wc).") ":""),checkbox("all",1,0,lang(237))."\n";if($b->selectCommandPrint()){echo'<fieldset><legend>',lang(34),'</legend><div>
    34423442<input type="submit" value="',lang(142),'"',($_GET["modify"]?'':' title="'.lang(227).'" class="jsonly"'),'>
Note: See TracChangeset for help on using the changeset viewer.