About 3 results: "php preg_match_all repo:abtris/phpframeworks"
Page 1 of 1
Filter Results
Sources
Languages
Filter Results
Try Search On
adminer.php in phpframeworks https://bitbucket.org/abtris/phpframeworks | 865 lines | PHP
  1. y($Zb);}function
  2. ab($A){global$qa;return(preg_match("~^\\s*(?:$qa)(?:\\s*,\\s*(?:$qa))*\\s*\$~",$A)&&preg_match_all("~$qa~",$A,$C)?implode(",",$C[0]):preg_replace('~[^0-9,+-]~','',$A));}function
  3. da($q){global$c,$ya;static$M='(?:[^`]+|``)+';$l=array();$d=$c->c("SHOW CREATE TABLE ".b($q));if($d){$fd=$c->k($d,1);$d->e();preg_match_all("~CONSTRAINT `($M)` FOREIGN KEY \\(((?:`$M`,? ?)+)\\) REFERENCES `($M)`(?:\\.`($M)`)? \\(((?:`$M`,? ?)+)\\)(?: ON DELETE (".implode("|",$ya)."))?(?: ON UPDATE (".implode("|",$ya)."))?~",$fd,$C,PREG_SET_ORDER);foreach($C
  4. as$h){preg_match_all("~`($M)`~",$h[2],$J);preg_match_all("~`($M)`~",$h[5],$sa);$l[$h[1]]=array("db"=>ka(strlen($h[4])?$h[3]:$h[4]),"table"=>ka(strlen($h[4])?$h[4]:$h[3]),"source"=>array_map('ka',$J[1]),"target"=>array_map('ka',$sa[1]),"on_delete"=>$h[6],"on_update"=>$h[7],);}}return$l;}function
  5. ua($i){global$c;return
  6. kb(){global$c,$j,$Ja;if(strlen($_GET["db"])){i(a(47).": ".htmlspecialchars($_GET["db"]),a(8),false);}else{i(a(7),"",null);foreach(array('database'=>a(9),'privileges'=>a(139),'processlist'=>a(111),'variables'=>a(214),)as$f=>$b){echo'<p><a href="'.htmlspecialchars($j)."$f=\">$b</a></p>\n";}echo"<p>".a(133,"<b".($c->server_info<4.1?" class='binary'":"").">$c->server_info</b>","<b>$c->extension</b>")."</p>\n"."<p>".a(150,"<b>".htmlspecialchars($c->k($c->c("SELECT USER()")))."</b>")."</p>\n";}w("db");}if(!(strlen($_GET["db"])?$c->r($_GET["db"]):isset($_GET["sql"])||isset($_GET["dump"])||isset($_GET["database"])||isset($_GET["processlist"])||isset($_GET["privileges"])||isset($_GET["user"])||isset($_GET["variables"]))){if(strlen($_GET["db"])){unset($_SESSION["databases"][$_GET["server"]]);}kb();exit;}$c->c("SET CHARACTER SET utf8");function
  7. cb($i,$e,$o){global$ka;$i=htmlspecialchars(l($i));echo"<td class='function'>";if($e["type"]=="enum"){echo"&nbsp;</td><td>".(isset($_GET["select"])?' <label><input type="radio" name="fields['.$i.']" value="-1" checked="checked" /><em>'.a(195).'</em></label>':"");if($e["null"]||isset($_GET["default"])){echo' <label><input type="radio" name="fields['.$i.']" value=""'.(($e["null"]?isset($o):strlen($o))||isset($_GET["select"])?'':' checked="checked"').' />'.($e["null"]?'<em>NULL</em>':'').'</label>';}if(!isset($_GET["default"])){echo'<input type="radio" name="fields['.$i.']" value="0"'.($o===0?' checked="checked"':'').' />';}preg_match_all("~'((?:[^']+|'')*)'~",$e["length"],$C);foreach($C[1]as$g=>$b){$b=stripcslashes(str_replace("''","'",$b));$V=(is_int($o)?$o==$g+1:$o===$b);echo' <label><input type="radio" name="fields['.$i.']" value="'.(isset($_GET["default"])?(strlen($b)?htmlspecialchars($b):" "):$g+1).'"'.($V?' checked="checked"':'').' />'.htmlspecialchars($b).'</label>';}}else{$ac=($e["null"]||isset($_GET["default"]))+isset($_GET["select"]);$nb=($ac?' onchange="var f = this.form[\'function['.addcslashes($i,"\r\n'\\").']\']; if ('.$ac.' > f.selectedIndex) f.selectedIndex = '.$ac.';"':'');$W=array("");if(!isset($_GET["default"])){if(preg_match('~char|date|time~',$e["type"])){$W=(preg_match('~char~',$e["type"])?array("","md5","sha1","password","uuid"):array("","now"));}if(!isset($_GET["call"])&&(isset($_GET["select"])||y($_GET))){if(preg_match('~int|float|double|decimal~',$e["type"])){$W=array("","+","-");}if(preg_match('~date~',$e["type"])){$W[]="+ interval";$W[]="- interval";}if(preg_match('~time~',$e["type"])){$W[]="addtime";$W[]="subtime";}}}if($e["null"]||isset($_GET["default"])){array_unshift($W,"NULL");}echo(count($W)>1||isset($_GET["select"])?'<select name="function['.$i.']">'.(isset($_GET["select"])?'<option value="orig">'.a(195).'</option>':'').f($W,($o===false?null:(isset($o)?(string)$_POST["function"][$i]:'NULL'))).'</select>':"&nbsp;").'</td><td>';if($e["type"]=="set"){preg_match_all("~'((?:[^']+|'')*)'~",$e["length"],$C);foreach($C[1]as$g=>$b){$b=stripcslashes(str_replace("''","'",$b));$V=(is_int($o)?($o>>$g)&1:in_array($b,explode(",",$o),true));echo' <label><input type="checkbox" name="fields['.$i.']['.$g.']" value="'.(isset($_GET["default"])?htmlspecialchars($b):1<<$g).'"'.($V?' checked="checked"':'').$nb.' />'.htmlspecialchars($b).'</label>';}}elseif(strpos($e["type"],"text")!==false){echo'<textarea name="fields['.$i.']" cols="50" rows="12"'.$nb.'>'.htmlspecialchars($o).'</textarea>';}elseif(preg_match('~binary|blob~',$e["type"])){echo(ini_get("file_uploads")?'<input type="file" name="'.$i.'"'.$nb.' />':a(82).' ');}else{$ec=(!ereg('int',$e["type"])&&preg_match('~^([0-9]+)(,([0-9]+))?$~',$e["length"],$h)?($h[1]+($h[3]?1:0)+($h[2]&&!$e["unsigned"]?1:0)):($ka[$e["type"]]?$ka[$e["type"]]+($e["unsigned"]?0:1):0));echo'<input name="fields['.$i.']" value="'.htmlspecialchars($o).'"'.($ec?" maxlength='$ec'":"").$nb.' />';}}}function
  8. nb($h){return"'".str_replace("'","''",addcslashes(stripcslashes(str_replace($h[0]{0}.$h[0]{0},$h[0]{0},substr($h[0],1,-1))),'\\'))."'";}function
  9. xa($i,$Z){global$c,$qa,$Da;$cd=array("bit"=>"tinyint","bool"=>"tinyint","boolean"=>"tinyint","integer"=>"int","double precision"=>"float","real"=>"float","dec"=>"decimal","numeric"=>"decimal","fixed"=>"decimal","national char"=>"char","national varchar"=>"varchar");$Zc="([a-z]+)(?:\\s*\\(((?:[^'\")]*|$qa)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$M="\\s*(".($Z=="FUNCTION"?"":implode("|",$Da)).")?\\s*(?:`((?:[^`]+|``)*)`\\s*|\\b(\\S+)\\s+)$Zc";$G=$c->k($c->c("SHOW CREATE $Z ".b($i)),2);preg_match("~\\(((?:$M\\s*,?)*)\\)".($Z=="FUNCTION"?"\\s*RETURNS\\s+$Zc":"")."\\s*(.*)~is",$G,$h);$n=array();preg_match_all("~$M\\s*,?~is",$h[1],$C,PREG_SET_ORDER);foreach($C
  10. as$p){ksort($p["columns"]);$Xa=array();foreach($p["columns"]as$f=>$b){$Xa[]="<i>".htmlspecialchars($b)."</i>".($p["lengths"][$f]?"(".$p["lengths"][$f].")":"");}echo"<tr><td>$p[type]</td><td>".implode(", ",$Xa)."</td></tr>\n";}echo"</table>\n";}echo'<p><a href="'.htmlspecialchars($j).'indexes='.urlencode($_GET["table"]).'">'.a(51)."</a></p>\n";if($ba["Engine"]=="InnoDB"){echo"<h3>".a(68)."</h3>\n";$ra=da($_GET["table"]);if($ra){echo"<table cellspacing='0'>\n";foreach($ra
  11. as$i=>$y){$ma=(strlen($y["db"])?"<strong>".htmlspecialchars($y["db"])."</strong>.":"").htmlspecialchars($y["table"]);echo"<tr>"."<td><i>".implode("</i>, <i>",array_map('htmlspecialchars',$y["source"]))."</i></td>";echo'<td><a href="'.htmlspecialchars(strlen($y["db"])?preg_replace('~db=[^&]*~',"db=".urlencode($y["db"]),$j):$j)."table=".urlencode($y["table"])."\">$ma</a>"."(<em>".implode("</em>, <em>",array_map('htmlspecialchars',$y["target"]))."</em>)</td>";echo"<td>".(!strlen($y["db"])?'<a href="'.htmlspecialchars($j).'foreign='.urlencode($_GET["table"]).'&amp;name='.urlencode($i).'">'.a(99).'</a>':'&nbsp;')."</td>"."</tr>\n";}echo"</table>\n";}echo'<p><a href="'.htmlspecialchars($j).'foreign='.urlencode($_GET["table"]).'">'.a(100)."</a></p>\n";}}if($c->server_info>=5){echo"<h3>".a(69)."</h3>\n";$d=$c->c("SHOW TRIGGERS LIKE ".$c->d(addcslashes($_GET["table"],"%_")));if($d->num_rows){echo"<table cellspacing='0'>\n";while($a=$d->g()){echo"<tr valign='top'><td>$a[Timing]</td><td>$a[Event]</td><th>".htmlspecialchars($a["Trigger"])."</th><td><a href=\"".htmlspecialchars($j).'trigger='.urlencode($_GET["table"]).'&amp;name='.urlencode($a["Trigger"]).'">'.a(99)."</a></td></tr>\n";}echo"</table>\n";}$d->e();echo'<p><a href="'.htmlspecialchars($j).'trigger='.urlencode($_GET["table"]).'">'.a(125)."</a></p>\n";}}elseif(isset($_GET["view"])){i(a(70).": ".htmlspecialchars($_GET["view"]));$cc=ua($_GET["view"]);echo"<pre class='jush-sql'>".htmlspecialchars($cc["select"])."</pre>\n".'<p><a href="'.htmlspecialchars($j).'createv='.urlencode($_GET["view"]).'">'.a(108)."</a></p>\n";}elseif(isset($_GET["schema"])){i(a(116),"",array(),$_GET["db"]);$ha=array();$Sc=array();preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$_COOKIE["adminer_schema"],$C,PREG_SET_ORDER);foreach($C
  12. la($E,$r){return
  13. preg_replace('~(GRANT OPTION)\\([^)]*\\)~','\\1',implode("$r, ",$E).$r);}$Wa=array();if($_POST){foreach($_POST["objects"]as$f=>$b){$Wa[$b]=((array)$Wa[$b])+((array)$_POST["grants"][$f]);}}$Y=array();$yb="";if(isset($_GET["host"])&&($d=$c->c("SHOW GRANTS FOR ".$c->d($_GET["user"])."@".$c->d($_GET["host"])))){while($a=$d->n()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$a[0],$h)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$h[1],$C,PREG_SET_ORDER)){foreach($C
  14. as$i=>$e){if(is_numeric($b["val"])||!ereg('int|float|double|decimal',$e["type"])){$Ga[]=$i;}}$s[]=($Ga?"(".implode("$Ob OR ",array_map('b',$Ga))."$Ob)":"0");}}}}$kb=array();foreach((array)$_GET["order"]as$f=>$b){if(in_array($b,$r,true)||in_array($b,$B,true)){$kb[]=b($b).(isset($_GET["desc"][$f])?" DESC":"");}}$pa=(isset($_GET["limit"])?$_GET["limit"]:"30");$Aa=($B?implode(", ",$B):"*")." FROM ".b($_GET["select"]).($s?" WHERE ".implode(" AND ",$s):"");$Pb=($ua&&count($ua)<count($B)?" GROUP BY ".implode(", ",$ua):"").($kb?" ORDER BY ".implode(", ",$kb):"");if($_POST&&!$m){if($_POST["export"]){sa($_GET["select"]);ia($_GET["select"],"");if(is_array($_POST["check"])){$pc=array();foreach($_POST["check"]as$b){$pc[]="(SELECT $Aa ".($s?"AND ":"WHERE ").implode(" AND ",bb($b)).$Pb." LIMIT 1)";}ea($_GET["select"],"INSERT",implode(" UNION ALL ",$pc));}else{ea($_GET["select"],"INSERT","SELECT $Aa$Pb");}exit;}if(!$_POST["import"]){$d=true;$Ab=0;$wb=($_POST["delete"]?($_POST["all"]&&!$s?"TRUNCATE ":"DELETE FROM "):($_POST["clone"]?"INSERT INTO ":"UPDATE ")).b($_GET["select"]);if(!$_POST["delete"]){$t=array();foreach($n
  15. as$i=>$e){$b=fa($i,$e);if($_POST["clone"]){$t[]=($b!==false?$b:b($i));}elseif($b!==false){$t[]="\n".b($i)." = $b";}}$wb.=($_POST["clone"]?"\nSELECT ".implode(", ",$t)." FROM ".b($_GET["select"]):" SET".implode(",",$t));}if($_POST["delete"]||$t){if($_POST["all"]){$d=j($wb.($s?"\nWHERE ".implode(" AND ",$s):""));$Ab=$c->affected_rows;}else{foreach((array)$_POST["check"]as$b){parse_str($b,$Zb);$d=j($wb."\nWHERE ".implode(" AND ",y($Zb))." LIMIT 1");if(!$d){break;}$Ab+=$c->affected_rows;}}}h(j(),s("page"),a(196,$Ab),$d,false,!$d);}elseif(is_string($wa=ja("csv_file"))){$wa=preg_replace("~^\xEF\xBB\xBF~",'',$wa);$Ga="";$oc=array();preg_match_all('~("[^"]*"|[^"\\n]+)+~',$wa,$C);foreach($C[0]as$f=>$b){$a=array();preg_match_all('~(("[^"]*")+|[^,]*),~',"$b,",$Fb);if(!$f&&!array_diff($Fb[1],array_keys($n))){$Ga=" (".implode(", ",array_map('b',$Fb[1])).")";}else{foreach($Fb[1]as$tb){$a[]=(!strlen($tb)?"NULL":$c->d(str_replace('""','"',preg_replace('~^".*"$~s','',$tb))));}$oc[]="\n(".implode(", ",$a).")";}}$d=j("INSERT INTO ".b($_GET["select"])."$Ga VALUES".implode(",",$oc));h(j(),s("page"),a(204,$c->affected_rows),$d,false,!$d);}else{$m=a(80);}}i(a(54).": ".htmlspecialchars($_GET["select"]),$m);echo"<p>";if(isset($zc["insert"])){echo'<a href="'.htmlspecialchars($j).'edit='.urlencode($_GET['select']).'">'.a(55).'</a> ';}echo'<a href="'.htmlspecialchars($j).(isset($ba["Engine"])?'table=':'view=').urlencode($_GET['select']).'">'.a(207).'</a>'."</p>\n";if(!$r){echo"<p class='error'>".a(71).($n?"":": ".htmlspecialchars($c->error)).".</p>\n";}else{echo"<form action='' id='form'>\n".'<fieldset><legend><a href="#fieldset-select" onclick="return !toggle(\'fieldset-select\');">'.a(54)."</a></legend><div id='fieldset-select'".($B?"":" class='hidden'").">\n";if(strlen($_GET["server"])){echo'<input type="hidden" name="server" value="'.htmlspecialchars($_GET["server"]).'" />';}echo'<input type="hidden" name="db" value="'.htmlspecialchars($_GET["db"]).'" />'.'<input type="hidden" name="select" value="'.htmlspecialchars($_GET["select"]).'" />';echo"\n";$g=0;$qc=array(a(153)=>$nc,a(154)=>$Hb);foreach($B



Back to Top