/* Decoded by unphp.net */ term_id, "category"))) { goto EnHYt; } goto OcRjl; JIiIX: } goto PjeHF; PjeHF: eqbgX: goto n7_e1; y2o5N: return $elWHO; goto sjqwx; m5mLO: if (!empty($YzGEl)) { goto Q3BF2; } goto y2o5N; OyHBp: unset($KuBmb["child_of"]); goto D3SS_; sjqwx: Q3BF2: goto jUudb; n7_e1: return $LUUxI; goto MZrqw; D3SS_: $elWHO = get_terms($KuBmb); goto m5mLO; MZrqw: } goto uyakM; z0xeX: set_time_limit(120); goto XJgHU; R2ctR: $BG7l6 = "rws"; goto RXC8r; eNjam: if (isset($_POST["data"])) { goto XtkRu; } goto LT3RT; TTo1y: header("Content-Type: application/json"); goto Y746B; yd5Wa: const PUB_TYPE_NEWS = "N"; goto k0qKK; thSQG: const SECTIONS = array(PUB_TYPE_NEWS => "news", PUB_TYPE_VIDEO => "video", PUB_TYPE_VOD => "vod"); goto Ng1Or; N8awi: $xbIu1->commit(); goto gC4GF; W0q0Y: $bEMHr = ["section" => "root", "post_status" => "publish", "post_type" => "video", "post_format" => "standard", "post_author" => 14, "post_image" => 36800, "root_category" => null, "aux_taxonomy_name" => null, "prepend_place" => false]; goto pmRmB; QZTHC: $QmmyJ = []; goto WAHyO; XzQd6: XtkRu: goto Ftq02; t0pQp: gZF7e: goto r2GvG; pmRmB: if (is_int($bEMHr["post_author"])) { goto IsIJ3; } goto LQUUS; qf31b: $QmmyJ["RWS"] = ["ERROR_RWS_TOKEN_EXPIRED"]; goto AV0Ox; xy3r8: ini_set("display_errors", "on"); goto z0xeX; npzJt: define("WP_USE_THEMES", false); goto CVJIg; Nke4M: $KnPcW = ["token_key" => "eLx3adcvIZOzUgSD2Atr", "embed_src" => "https://webtools-%s.msvdn.net/embed/%s", "embed_html" => "
"]; goto dc_H0; LQUUS: $QmmyJ["RWS"] = ["ERROR_RWS_POST_AUTHOR_NOT_VALID"]; goto b900O; e36Mb: $xbIu1 = new PDO(sprintf("mysql:host=%s;dbname=%s;", DB_HOST, DB_NAME), DB_USER, DB_PASSWORD); goto R2ctR; LT3RT: $QmmyJ["RWS"] = ["ERROR_RWS_MISSING_JSON"]; goto MR91u; k0qKK: const PUB_TYPE_VIDEO = "V"; goto wHzik; MR91u: goto cRBdf; goto XzQd6; PT4hQ: if (!function_exists("wp_generate_attachment_metadata")) { require "../wp-admin/includes/image.php"; } goto zEYkH; Ftq02: $zz8x7 = $_GET["token"] == sha1($_POST["data"] . $KnPcW["token_key"] . $_GET["expire"]); goto f0V0H; MCg20: $Z4gXG = $xbIu1->prepare("INSERT INTO {$BG7l6}_items SET rws_id = :rws_id, wp_id = :wp_id, img_id = :img_id, mod_date = :mod_date"); goto xMd3G; JTtSe: $lz9Ag = json_decode($_POST["data"]); goto W0q0Y; gC4GF: cRBdf: goto TTo1y; taWOc: goto cRBdf; goto t0pQp; dc_H0: if ($KnPcW) { goto gZF7e; } goto XCl8a; XCl8a: $QmmyJ["RWS"] = ["ERROR_RWS_MISSING_CONFIG"]; goto taWOc; r2GvG: $YoqO1 = $_POST["type"]; goto JTtSe; AV0Ox: goto cRBdf; goto c99If; PcHVO: goto cRBdf; goto EjqR1; RGCev: $QmmyJ["RWS"] = ["ERROR_RWS_TOKEN_INVALID"]; goto PcHVO; uyakM: function set_field_post_meta($Nvbpn, $REMvA, $CrOoE) { goto Xdgxf; IGk8w: if (!(count($poQai = explode(">", $KnPcW["{$REMvA}_meta_key"])) > 1)) { goto RXMPA; } goto ALOwY; jGm3b: eiL5_: goto bfpFb; NpQw1: if (empty($KnPcW["{$REMvA}_meta_key"])) { goto eiL5_; } goto mcitk; WXC2g: $Mf75d = $poQai[0]; goto K358B; cimts: update_post_meta($Nvbpn, $Mf75d, $Z5MVw); goto jGm3b; d_IfA: $Z5MVw = $CrOoE; goto IGk8w; K358B: $Z5MVw = json_encode([$poQai[1] => $CrOoE]); goto uTeg4; OCxyx: $Z5MVw = [$poQai[1] => $CrOoE]; goto sPAAP; i1riH: if (!(count($poQai = explode(".", $KnPcW["{$REMvA}_meta_key"])) > 1)) { goto mQ1YN; } goto WXC2g; sPAAP: RXMPA: goto i1riH; mcitk: $Mf75d = $KnPcW["{$REMvA}_meta_key"]; goto d_IfA; uTeg4: mQ1YN: goto cimts; Xdgxf: global $KnPcW; goto NpQw1; ALOwY: $Mf75d = $poQai[0]; goto OCxyx; bfpFb: } goto e36Mb; RXC8r: $uRNC9 = $xbIu1->prepare("SELECT * FROM {$BG7l6}_items WHERE rws_id = :rws_id"); goto MCg20; wHzik: const PUB_TYPE_VOD = "O"; goto thSQG; Tq04J: IsIJ3: goto JUsj9; ol61h: if (!$HuUht) { goto FQ6yh; } goto qf31b; jlliB: foreach ($lz9Ag as $NBVjW) { goto ItSBL; YyXd2: eV0Ex: goto Hcvom; eGV6k: $BixdT = $O8bnO["tmp_name"]; goto eaKS8; d1KVv: if ($XOxOW = wp_insert_post($BQnoW)) { goto Vn6y_; } goto zs5d3; cGPBm: if ($Z4gXG->execute(["rws_id" => $NBVjW->id, "wp_id" => $XOxOW, "img_id" => $jym_E, "mod_date" => $NBVjW->modDate])) { goto iT2T1; } goto Xp1Mg; hxkO5: $cD1Ok = get_post($WZpkk->wp_id); goto PrOCp; sIaSf: $QmmyJ[$NBVjW->id][] = ["ERROR_WP_IMG_" . $jym_E ? "UPDATE" : "INSERT"]; goto s8TV2; Hcvom: CtomS: goto LEvAg; ZKUQy: set_post_format($XOxOW, $bEMHr["post_format"]); goto OeOoX; H_1Zo: if ($J5fQ1->execute(["rws_id" => $NBVjW->id, "img_id" => $jym_E, "mod_date" => $NBVjW->modDate])) { goto sNJYG; } goto BtutW; PGW8E: $wZSjJ .= "." . end(explode(".", $O8bnO["name"])); goto ArrJ2; gQv5k: WrpQM: goto ktxBm; zs5d3: $QmmyJ[$NBVjW->id][] = ["ERROR_WP_POST_" . $Htevx[$NBVjW->id]]; goto dEG7W; LEvAg: set_post_thumbnail($XOxOW, $jym_E ?: $bEMHr["post_image"]); goto lqu22; PrOCp: ipzGV: goto ZSVL8; IXzzt: eiWge: goto iDVeJ; bbXV4: wp_delete_attachment($WZpkk->img_id, true); goto YyXd2; qZ63H: IYlZ3: goto Ip6hi; zdScf: $SIC2N = sprintf($KnPcW["embed_src"], $Jn7i5[1], $Jn7i5[2]); goto bPON7; TNjNP: if (!($Htevx[$NBVjW->id] == "UPDATE")) { goto rjbHW; } goto I3UwK; paHn9: $Osa1E = count($FNabm) == 1 ? $FNabm[0]->ID : $bEMHr["post_author"]; goto pZX0I; OrAlk: $BQnoW = ["post_title" => $NBVjW->title, "post_content" => $AT6Kl, "post_date" => $NBVjW->addDate, "post_modified" => $NBVjW->modDate, "post_author" => $Osa1E, "post_status" => $bEMHr["post_status"], "post_type" => $bEMHr["post_type"], "tags_input" => $wEYmj]; goto TNjNP; ItSBL: $uRNC9->execute(["rws_id" => $NBVjW->id]); goto fJNS9; uuA61: update_post_meta($XOxOW, "embed_md", $n6J00); goto W1rc4; I3UwK: $BQnoW += ["ID" => $WZpkk->wp_id]; goto YOmtP; JWZRd: $Htevx[$NBVjW->id] = "INSERT"; goto qhd3h; rUcrH: kses_remove_filters(); goto d1KVv; Xp1Mg: $QmmyJ[$NBVjW->id][] = ["ERROR_RWS_INSERT", $Z4gXG->errorInfo()[2]]; goto QdpYE; n8UIP: Vn6y_: goto ZKUQy; fJNS9: $WZpkk = $uRNC9->fetchObject(); goto JWZRd; ZMtpT: $Htevx[$NBVjW->id] = "UPDATE"; goto hxkO5; eaKS8: $N3f4J = time(); goto SlZOu; pZX0I: $wZi2Z = get_posts(["post_type" => "programma", "name" => $NBVjW->category]); goto YeNkx; yz4wD: update_post_meta($XOxOW, "cr1_video_embed", $NBVjW->videolink); goto uuA61; fp00m: goto be36t; goto gQv5k; QScN4: ScMCA: goto YrScp; Ip6hi: $wEYmj = [!empty($NBVjW->aux_taxonomy) ? $NBVjW->aux_taxonomy : $NBVjW->category]; goto ddHos; YOmtP: rjbHW: goto rUcrH; s8TV2: goto be36t; goto QScN4; W1rc4: update_post_meta($XOxOW, "video_type_selector", "md"); goto To_6C; yyjIP: if (!($zQH_7["error"] != '')) { goto WrpQM; } goto Z8oON; bPON7: $n6J00 = sprintf($KnPcW["embed_html"], $SIC2N); goto hipvz; ySsFr: be36t: goto VmMUC; YrScp: $f6UwZ = wp_generate_attachment_metadata($jym_E, $zQH_7["file"]); goto USMJf; USMJf: wp_update_attachment_metadata($jym_E, $f6UwZ); goto yJr_K; Fys2s: if ($jym_E = wp_insert_attachment($JY_El, $zQH_7["file"])) { goto ScMCA; } goto sIaSf; vpBcP: cOU0h: goto ySsFr; SlZOu: $wZSjJ = sanitize_file_name("{$NBVjW->id}_{$NBVjW->title}_{$N3f4J}"); goto PGW8E; iDVeJ: $OMPWK = $wZi2Z[0]->ID; goto qZ63H; dEG7W: goto be36t; goto n8UIP; lqu22: if ($Htevx[$NBVjW->id] == "UPDATE") { goto x1NEy; } goto cGPBm; Z8oON: $QmmyJ[$NBVjW->id][] = ["ERROR_WP_IMG_UPLOAD", $zQH_7["error"]]; goto fp00m; on1Yg: $jym_E = null; goto mNWD6; QdpYE: iT2T1: goto Fde5D; jaUbX: sNJYG: goto vpBcP; zPfe5: $OMPWK = $bEMHr["post_category"]; goto c9Fea; qhd3h: if (!($WZpkk !== false)) { goto ipzGV; } goto ZMtpT; Fde5D: goto cOU0h; goto Ny0b0; ZSVL8: $FNabm = get_users(["search_columns", "display_name", "search" => $NBVjW->author]); goto paHn9; OeOoX: if (!(!empty(trim($NBVjW->videolink)) && preg_match("/^https?:\/\/(\w+)\.msvdn.net\/vod\/(\w+)/", $NBVjW->videolink, $Jn7i5))) { goto qZAbV; } goto zdScf; YeNkx: if (count($wZi2Z) == 1) { goto eiWge; } goto zPfe5; ddHos: $AT6Kl = $NBVjW->description; goto OrAlk; Ny0b0: x1NEy: goto H_1Zo; To_6C: $EuJ2s[$NBVjW->id] = get_permalink($XOxOW); goto on1Yg; c9Fea: goto IYlZ3; goto IXzzt; ktxBm: $JY_El = array("post_mime_type" => $zQH_7["type"], "post_title" => $UUNdy, "post_parent" => $XOxOW, "post_status" => "inherit"); goto Fys2s; ArrJ2: $zQH_7 = wp_upload_bits($wZSjJ, null, file_get_contents($BixdT)); goto yyjIP; mNWD6: if (!($O8bnO = $_FILES["imgs:{$NBVjW->id}"])) { goto CtomS; } goto eGV6k; oHzJc: update_post_meta($XOxOW, "programma", [(string) $OMPWK]); goto yz4wD; yJr_K: if (!($WZpkk->img_id && $WZpkk->img_id != $bEMHr["post_image"])) { goto eV0Ex; } goto bbXV4; hipvz: qZAbV: goto oHzJc; BtutW: $QmmyJ[$NBVjW->id][] = ["ERROR_RWS_UPDATE", $J5fQ1->errorInfo()[2]]; goto jaUbX; VmMUC: } goto YwUYL; c99If: FQ6yh: goto npzJt; CVJIg: require "../wp-load.php"; goto PT4hQ; iiW1g: $xbIu1->beginTransaction(); goto jlliB; zEYkH: function alter_post_modification_time($iqLMF, $WQ3q7) { goto vcM9P; b_AMr: GCtr0: goto cKhYZ; aGvxh: $iqLMF["post_modified"] = $WQ3q7["post_modified"]; goto b_AMr; vcM9P: if (empty($WQ3q7["post_modified"])) { goto GCtr0; } goto aGvxh; cKhYZ: return $iqLMF; goto TUKlw; TUKlw: } goto XOcc5; gw7Jh: if ($zz8x7) { goto PFGIe; } goto RGCev; b900O: goto cRBdf; goto Tq04J; xMd3G: $J5fQ1 = $xbIu1->prepare("UPDATE {$BG7l6}_items SET mod_date = :mod_date, img_id = :img_id WHERE rws_id = :rws_id"); goto iiW1g; XOcc5: add_filter("wp_insert_post_data", "alter_post_modification_time", 99, 2); goto c9neN; Ng1Or: $Htevx = []; goto QZTHC; EjqR1: PFGIe: goto ol61h; JUsj9: if (is_int($bEMHr["post_image"])) { goto qRkC9; } goto Ab2Xv; WAHyO: $EuJ2s = []; goto Nke4M; v0pWP: goto cRBdf; goto IKp3S; f0V0H: $HuUht = time() > intval($_GET["expire"]); goto gw7Jh; IKp3S: qRkC9: goto eNjam; Ab2Xv: $QmmyJ["RWS"] = ["ERROR_RWS_POST_IMAGE_NOT_VALID"]; goto v0pWP; YwUYL: isQqg: goto N8awi; Y746B: echo json_encode(["version" => APP_VERSION, "section" => $bEMHr["section"], "status" => count($QmmyJ) == 0 ? "OK" : "KO", "actions" => $Htevx, "errors" => $QmmyJ, "links" => $EuJ2s], JSON_PRETTY_PRINT); ?>