Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php goto bkrxK; AMCWg: if (!$options->markdown) { ?> <script> (function () { const ..
Decoded Output download
<?php
goto bkrxK; AMCWg: if (!$options->markdown) { ?>
<script>
(function () {
const textarea = $('#text');
//
Typecho.insertFileToEditor = function (file, url, isImage) {
const sel = textarea.getSelection(),
html = isImage ? '<img src="' + url + '" alt="' + file + '" />'
: '<a href="' + url + '">' + file + '</a>',
offset = (sel ? sel.start : 0) + html.length;
textarea.replaceSelection(html);
textarea.setSelection(offset, offset);
};
})();
</script>
<?php } else { ?>
<script src="<?php $options->adminStaticUrl("js", "hyperdown.js"); ?>
"></script>
<script src="<?php $options->adminStaticUrl("js", "pagedown.js"); ?>
"></script>
<script src="<?php $options->adminStaticUrl("js", "purify.js"); ?>
"></script>
<script>
$(document).ready(function () {
const textarea = $('#text'),
toolbar = $('<div class="editor" id="wmd-button-bar" />').insertBefore(textarea.parent()),
preview = $('<div id="wmd-preview" class="wmd-hidetab" />').insertAfter('.editor');
let isFullScreen = false;
const options = {}, isMarkdown = <?php echo json_encode(!$content->have() || $content->isMarkdown); ?>
;
options.strings = {
bold: '<?php _e(""); ?>
<strong> Ctrl+B',
boldexample: '<?php _e(""); ?>
',
italic: '<?php _e(""); ?>
<em> Ctrl+I',
italicexample: '<?php _e(""); ?>
',
link: '<?php _e(""); ?>
<a> Ctrl+L',
linkdescription: '<?php _e(""); ?>
',
quote: '<?php _e(""); ?>
<blockquote> Ctrl+Q',
quoteexample: '<?php _e(""); ?>
',
code: '<?php _e(""); ?>
<pre><code> Ctrl+K',
codeexample: '<?php _e(""); ?>
',
image: '<?php _e(""); ?>
<img> Ctrl+G',
imagedescription: '<?php _e(""); ?>
',
olist: '<?php _e(""); ?>
<ol> Ctrl+O',
ulist: '<?php _e(""); ?>
<ul> Ctrl+U',
litem: '<?php _e(""); ?>
',
heading: '<?php _e(""); ?>
<h1>/<h2> Ctrl+H',
headingexample: '<?php _e(""); ?>
',
hr: '<?php _e(""); ?>
<hr> Ctrl+R',
more: '<?php _e(""); ?>
<!--more--> Ctrl+M',
undo: '<?php _e(""); ?>
- Ctrl+Z',
redo: '<?php _e(""); ?>
- Ctrl+Y',
redomac: '<?php _e(""); ?>
- Ctrl+Shift+Z',
fullscreen: '<?php _e(""); ?>
- Ctrl+J',
exitFullscreen: '<?php _e(""); ?>
- Ctrl+E',
fullscreenUnsupport: '<?php _e(""); ?>
',
imagedialog: '<p><b><?php _e(""); ?>
</b></p><p><?php _e(""); ?>
</p><p><?php _e(""); ?>
</p>',
linkdialog: '<p><b><?php _e(""); ?>
</b></p><p><?php _e(""); ?>
</p>',
ok: '<?php _e(""); ?>
',
cancel: '<?php _e(""); ?>
',
help: '<?php _e("Markdown"); ?>
'
};
const converter = new HyperDown(),
editor = new Markdown.Editor(converter, '', options);
//
converter.enableHtml(true);
converter.enableLine(true);
const reloadScroll = scrollableEditor(textarea, preview);
//
converter.hook('makeHtml', function (html) {
html = html.replace('<p><!--more--></p>', '<!--more-->');
if (html.indexOf('<!--more-->') > 0) {
var parts = html.split(/\s*<\!\-\-more\-\->\s*/),
summary = parts.shift(),
details = parts.join('');
html = '<div class="summary">' + summary + '</div>'
+ '<div class="details">' + details + '</div>';
}
// block
html = html.replace(/<(iframe|embed)\s+([^>]*)>/ig, function (all, tag, src) {
if (src[src.length - 1] === '/') {
src = src.substring(0, src.length - 1);
}
return '<div class="embed"><strong>'
+ tag + '</strong> : ' + $.trim(src) + '</div>';
});
return DOMPurify.sanitize(html, {USE_PROFILES: {html: true}});
});
editor.hooks.chain('onPreviewRefresh', function () {
const images = $('img', preview);
let count = images.length;
if (count === 0) {
reloadScroll(true);
} else {
images.bind('load error', function () {
count --;
if (count === 0) {
reloadScroll(true);
}
});
}
});
<?php \Typecho\Plugin::factory("admin/editor-js.php")->call("markdownEditor", $content); ?>
let th = textarea.height(), ph = preview.height();
const uploadBtn = $('<button type="button" id="btn-fullscreen-upload" class="btn btn-link">'
+ '<i class="i-upload"><?php _e(""); ?>
</i></button>')
.prependTo('.submit .right')
.click(function() {
$('a', $('.typecho-option-tabs li').not('.active')).trigger('click');
return false;
});
$('.typecho-option-tabs li').click(function () {
uploadBtn.find('i').toggleClass('i-upload-active',
$('#tab-files-btn', this).length > 0);
});
editor.hooks.chain('enterFakeFullScreen', function () {
th = textarea.height();
ph = preview.height();
$(document.body).addClass('fullscreen');
const h = $(window).height() - toolbar.outerHeight();
textarea.css('height', h);
preview.css('height', h);
isFullScreen = true;
});
editor.hooks.chain('enterFullScreen', function () {
$(document.body).addClass('fullscreen');
const h = window.screen.height - toolbar.outerHeight();
textarea.css('height', h);
preview.css('height', h);
isFullScreen = true;
});
editor.hooks.chain('exitFullScreen', function () {
$(document.body).removeClass('fullscreen');
textarea.height(th);
preview.height(ph);
isFullScreen = false;
});
editor.hooks.chain('commandExecuted', function () {
textarea.trigger('input');
});
editor.hooks.chain('save', function () {
Typecho.savePost();
});
function initMarkdown() {
editor.run();
const imageButton = $('#wmd-image-button'),
linkButton = $('#wmd-link-button');
Typecho.insertFileToEditor = function (file, url, isImage) {
const button = isImage ? imageButton : linkButton;
options.strings[isImage ? 'imagename' : 'linkname'] = file;
button.trigger('click');
let checkDialog = setInterval(function () {
if ($('.wmd-prompt-dialog').length > 0) {
$('.wmd-prompt-dialog input').val(url).select();
clearInterval(checkDialog);
checkDialog = null;
}
}, 10);
};
Typecho.uploadComplete = function (attachment) {
Typecho.insertFileToEditor(attachment.title, attachment.url, attachment.isImage);
};
//
const edittab = $('.editor').prepend('<div class="wmd-edittab"><a href="#wmd-editarea" class="active"><?php _e(""); ?>
</a><a href="#wmd-preview"><?php _e(""); ?>
</a></div>'),
editarea = $(textarea.parent()).attr("id", "wmd-editarea");
$(".wmd-edittab a").click(function() {
$(".wmd-edittab a").removeClass('active');
$(this).addClass("active");
$("#wmd-editarea, #wmd-preview").addClass("wmd-hidetab");
const selected_tab = $(this).attr("href"),
selected_el = $(selected_tab).removeClass("wmd-hidetab");
//
if (selected_tab === "#wmd-preview") {
$("#wmd-button-row").addClass("wmd-visualhide");
} else {
$("#wmd-button-row").removeClass("wmd-visualhide");
}
//
$("#wmd-preview").outerHeight($("#wmd-editarea").innerHeight());
return false;
});
//
textarea.bind('paste', function (e) {
const items = (e.clipboardData || e.originalEvent.clipboardData).items;
for (const item of items) {
if (item.kind === 'file') {
const file = item.getAsFile();
if (file.size > 0) {
if (!file.name) {
file.name = (new Date()).toISOString().replace(/\..+$/, '')
+ '.' + file.type.split('/').pop();
}
Typecho.uploadFile(file);
}
}
}
});
}
if (isMarkdown) {
initMarkdown();
} else {
const notice = $('<div class="message notice"><?php _e("Markdown, Markdown?"); ?>
'
+ '<button class="btn btn-xs primary yes"><?php _e(""); ?>
</button> '
+ '<button class="btn btn-xs no"><?php _e(""); ?>
</button></div>')
.hide().insertBefore(textarea).slideDown();
$('.yes', notice).click(function () {
notice.remove();
$('<input type="hidden" name="markdown" value="1" />').appendTo('.submit');
initMarkdown();
});
$('.no', notice).click(function () {
notice.remove();
});
}
});
</script>
<?php } goto otKzj; uFwyf: ?>
<script>
(function () {
$('#text').on('change', function (e) {
e.preventDefault();
e.stopPropagation();
}).on('input', function () {
$(this).parents('form').trigger('write');
});
})();
</script>
<?php goto AMCWg; YW9kQ: $content = !empty($post) ? $post : $page; goto uFwyf; bkrxK: if (!defined("__TYPECHO_ADMIN__")) { die; } goto YW9kQ; otKzj: ?>
Did this file decode correctly?
Original Code
<?php
goto bkrxK; AMCWg: if (!$options->markdown) { ?>
<script>
(function () {
const textarea = $('#text');
//
Typecho.insertFileToEditor = function (file, url, isImage) {
const sel = textarea.getSelection(),
html = isImage ? '<img src="' + url + '" alt="' + file + '" />'
: '<a href="' + url + '">' + file + '</a>',
offset = (sel ? sel.start : 0) + html.length;
textarea.replaceSelection(html);
textarea.setSelection(offset, offset);
};
})();
</script>
<?php } else { ?>
<script src="<?php $options->adminStaticUrl("\152\163", "\150\x79\160\x65\162\144\x6f\167\156\56\152\x73"); ?>
"></script>
<script src="<?php $options->adminStaticUrl("\x6a\163", "\160\x61\x67\x65\144\157\167\x6e\x2e\x6a\x73"); ?>
"></script>
<script src="<?php $options->adminStaticUrl("\x6a\x73", "\x70\x75\x72\151\x66\x79\x2e\152\x73"); ?>
"></script>
<script>
$(document).ready(function () {
const textarea = $('#text'),
toolbar = $('<div class="editor" id="wmd-button-bar" />').insertBefore(textarea.parent()),
preview = $('<div id="wmd-preview" class="wmd-hidetab" />').insertAfter('.editor');
let isFullScreen = false;
const options = {}, isMarkdown = <?php echo json_encode(!$content->have() || $content->isMarkdown); ?>
;
options.strings = {
bold: '<?php _e("\xe5\x8a\xa0\347\262\x97"); ?>
<strong> Ctrl+B',
boldexample: '<?php _e("\345\212\xa0\xe7\262\227\xe6\226\x87\345\255\227"); ?>
',
italic: '<?php _e("\346\x96\234\xe4\275\223"); ?>
<em> Ctrl+I',
italicexample: '<?php _e("\346\x96\x9c\xe4\xbd\x93\346\226\207\xe5\255\x97"); ?>
',
link: '<?php _e("\xe9\223\276\xe6\216\xa5"); ?>
<a> Ctrl+L',
linkdescription: '<?php _e("\xe8\xaf\267\350\xbe\x93\xe5\205\245\xe9\x93\276\xe6\216\245\346\x8f\x8f\xe8\277\260"); ?>
',
quote: '<?php _e("\345\xbc\225\xe7\224\xa8"); ?>
<blockquote> Ctrl+Q',
quoteexample: '<?php _e("\xe5\xbc\225\347\224\250\xe6\x96\x87\xe5\xad\227"); ?>
',
code: '<?php _e("\xe4\273\243\347\xa0\x81"); ?>
<pre><code> Ctrl+K',
codeexample: '<?php _e("\350\xaf\267\350\xbe\223\345\205\xa5\344\273\243\347\240\x81"); ?>
',
image: '<?php _e("\345\233\276\347\211\x87"); ?>
<img> Ctrl+G',
imagedescription: '<?php _e("\350\257\267\350\276\x93\xe5\x85\xa5\345\233\xbe\347\211\207\346\x8f\217\xe8\xbf\xb0"); ?>
',
olist: '<?php _e("\346\225\xb0\xe5\xad\x97\xe5\210\x97\xe8\xa1\250"); ?>
<ol> Ctrl+O',
ulist: '<?php _e("\xe6\x99\xae\351\x80\232\xe5\x88\227\350\xa1\250"); ?>
<ul> Ctrl+U',
litem: '<?php _e("\xe5\x88\x97\350\xa1\xa8\351\241\xb9\347\x9b\xae"); ?>
',
heading: '<?php _e("\xe6\xa0\x87\351\xa2\x98"); ?>
<h1>/<h2> Ctrl+H',
headingexample: '<?php _e("\xe6\xa0\207\xe9\xa2\230\xe6\x96\x87\xe5\255\227"); ?>
',
hr: '<?php _e("\xe5\210\x86\345\211\xb2\347\xba\xbf"); ?>
<hr> Ctrl+R',
more: '<?php _e("\346\x91\230\xe8\xa6\201\345\210\x86\345\x89\xb2\xe7\272\xbf"); ?>
<!--more--> Ctrl+M',
undo: '<?php _e("\xe6\x92\xa4\xe9\224\200"); ?>
- Ctrl+Z',
redo: '<?php _e("\xe9\x87\x8d\xe5\201\232"); ?>
- Ctrl+Y',
redomac: '<?php _e("\xe9\207\215\xe5\201\232"); ?>
- Ctrl+Shift+Z',
fullscreen: '<?php _e("\345\205\xa8\345\261\x8f"); ?>
- Ctrl+J',
exitFullscreen: '<?php _e("\xe9\200\x80\xe5\207\xba\345\x85\250\xe5\261\217"); ?>
- Ctrl+E',
fullscreenUnsupport: '<?php _e("\346\xad\244\xe6\xb5\x8f\xe8\247\210\345\231\250\xe4\270\x8d\xe6\224\257\xe6\214\201\xe5\205\xa8\345\261\217\346\x93\215\344\xbd\234"); ?>
',
imagedialog: '<p><b><?php _e("\xe6\x8f\x92\xe5\205\xa5\xe5\233\xbe\347\x89\207"); ?>
</b></p><p><?php _e("\xe8\xaf\267\345\x9c\250\xe4\xb8\213\xe6\226\xb9\347\x9a\204\xe8\xbe\x93\345\205\xa5\346\xa1\206\xe5\206\205\xe8\xbe\x93\xe5\205\245\350\246\201\346\x8f\x92\xe5\205\xa5\347\232\204\350\277\234\xe7\250\x8b\345\233\276\347\211\x87\345\x9c\260\345\x9d\x80"); ?>
</p><p><?php _e("\xe6\202\250\344\xb9\x9f\xe5\217\xaf\xe4\xbb\245\xe4\275\xbf\xe7\x94\250\xe9\x99\x84\344\273\xb6\xe5\x8a\237\xe8\203\275\346\x8f\222\xe5\x85\245\344\xb8\212\344\xbc\xa0\xe7\232\204\346\x9c\xac\xe5\x9c\260\xe5\233\xbe\347\x89\x87"); ?>
</p>',
linkdialog: '<p><b><?php _e("\346\x8f\222\xe5\205\245\xe9\x93\xbe\346\x8e\245"); ?>
</b></p><p><?php _e("\xe8\xaf\xb7\345\x9c\250\xe4\270\213\xe6\x96\271\347\x9a\x84\xe8\xbe\x93\345\x85\xa5\346\241\x86\xe5\206\x85\xe8\276\223\xe5\x85\xa5\xe8\246\201\346\x8f\222\345\x85\245\347\x9a\204\351\x93\xbe\346\216\xa5\xe5\234\260\xe5\235\x80"); ?>
</p>',
ok: '<?php _e("\xe7\xa1\256\xe5\xae\232"); ?>
',
cancel: '<?php _e("\345\x8f\x96\xe6\266\x88"); ?>
',
help: '<?php _e("\x4d\141\x72\x6b\x64\x6f\167\156\xe8\257\255\xe6\xb3\225\xe5\270\256\345\x8a\xa9"); ?>
'
};
const converter = new HyperDown(),
editor = new Markdown.Editor(converter, '', options);
//
converter.enableHtml(true);
converter.enableLine(true);
const reloadScroll = scrollableEditor(textarea, preview);
//
converter.hook('makeHtml', function (html) {
html = html.replace('<p><!--more--></p>', '<!--more-->');
if (html.indexOf('<!--more-->') > 0) {
var parts = html.split(/\s*<\!\-\-more\-\->\s*/),
summary = parts.shift(),
details = parts.join('');
html = '<div class="summary">' + summary + '</div>'
+ '<div class="details">' + details + '</div>';
}
// block
html = html.replace(/<(iframe|embed)\s+([^>]*)>/ig, function (all, tag, src) {
if (src[src.length - 1] === '/') {
src = src.substring(0, src.length - 1);
}
return '<div class="embed"><strong>'
+ tag + '</strong> : ' + $.trim(src) + '</div>';
});
return DOMPurify.sanitize(html, {USE_PROFILES: {html: true}});
});
editor.hooks.chain('onPreviewRefresh', function () {
const images = $('img', preview);
let count = images.length;
if (count === 0) {
reloadScroll(true);
} else {
images.bind('load error', function () {
count --;
if (count === 0) {
reloadScroll(true);
}
});
}
});
<?php \Typecho\Plugin::factory("\x61\144\x6d\151\x6e\x2f\x65\x64\151\x74\x6f\162\55\152\163\56\x70\150\x70")->call("\155\141\x72\x6b\144\157\x77\156\105\144\x69\164\157\x72", $content); ?>
let th = textarea.height(), ph = preview.height();
const uploadBtn = $('<button type="button" id="btn-fullscreen-upload" class="btn btn-link">'
+ '<i class="i-upload"><?php _e("\351\x99\x84\344\xbb\xb6"); ?>
</i></button>')
.prependTo('.submit .right')
.click(function() {
$('a', $('.typecho-option-tabs li').not('.active')).trigger('click');
return false;
});
$('.typecho-option-tabs li').click(function () {
uploadBtn.find('i').toggleClass('i-upload-active',
$('#tab-files-btn', this).length > 0);
});
editor.hooks.chain('enterFakeFullScreen', function () {
th = textarea.height();
ph = preview.height();
$(document.body).addClass('fullscreen');
const h = $(window).height() - toolbar.outerHeight();
textarea.css('height', h);
preview.css('height', h);
isFullScreen = true;
});
editor.hooks.chain('enterFullScreen', function () {
$(document.body).addClass('fullscreen');
const h = window.screen.height - toolbar.outerHeight();
textarea.css('height', h);
preview.css('height', h);
isFullScreen = true;
});
editor.hooks.chain('exitFullScreen', function () {
$(document.body).removeClass('fullscreen');
textarea.height(th);
preview.height(ph);
isFullScreen = false;
});
editor.hooks.chain('commandExecuted', function () {
textarea.trigger('input');
});
editor.hooks.chain('save', function () {
Typecho.savePost();
});
function initMarkdown() {
editor.run();
const imageButton = $('#wmd-image-button'),
linkButton = $('#wmd-link-button');
Typecho.insertFileToEditor = function (file, url, isImage) {
const button = isImage ? imageButton : linkButton;
options.strings[isImage ? 'imagename' : 'linkname'] = file;
button.trigger('click');
let checkDialog = setInterval(function () {
if ($('.wmd-prompt-dialog').length > 0) {
$('.wmd-prompt-dialog input').val(url).select();
clearInterval(checkDialog);
checkDialog = null;
}
}, 10);
};
Typecho.uploadComplete = function (attachment) {
Typecho.insertFileToEditor(attachment.title, attachment.url, attachment.isImage);
};
//
const edittab = $('.editor').prepend('<div class="wmd-edittab"><a href="#wmd-editarea" class="active"><?php _e("\346\222\xb0\xe5\x86\231"); ?>
</a><a href="#wmd-preview"><?php _e("\xe9\xa2\204\350\xa7\x88"); ?>
</a></div>'),
editarea = $(textarea.parent()).attr("id", "wmd-editarea");
$(".wmd-edittab a").click(function() {
$(".wmd-edittab a").removeClass('active');
$(this).addClass("active");
$("#wmd-editarea, #wmd-preview").addClass("wmd-hidetab");
const selected_tab = $(this).attr("href"),
selected_el = $(selected_tab).removeClass("wmd-hidetab");
//
if (selected_tab === "#wmd-preview") {
$("#wmd-button-row").addClass("wmd-visualhide");
} else {
$("#wmd-button-row").removeClass("wmd-visualhide");
}
//
$("#wmd-preview").outerHeight($("#wmd-editarea").innerHeight());
return false;
});
//
textarea.bind('paste', function (e) {
const items = (e.clipboardData || e.originalEvent.clipboardData).items;
for (const item of items) {
if (item.kind === 'file') {
const file = item.getAsFile();
if (file.size > 0) {
if (!file.name) {
file.name = (new Date()).toISOString().replace(/\..+$/, '')
+ '.' + file.type.split('/').pop();
}
Typecho.uploadFile(file);
}
}
}
});
}
if (isMarkdown) {
initMarkdown();
} else {
const notice = $('<div class="message notice"><?php _e("\350\xbf\x99\xe7\xaf\x87\346\226\207\347\xab\240\344\270\215\346\230\257\347\x94\xb1\115\x61\x72\153\x64\157\x77\x6e\xe8\257\xad\346\263\225\xe5\x88\233\xe5\273\272\347\232\204\54\40\347\273\xa7\347\273\255\344\xbd\277\347\224\250\x4d\141\x72\153\x64\x6f\x77\x6e\xe7\xbc\x96\350\xbe\x91\xe5\xae\x83\xe5\x90\227\x3f"); ?>
'
+ '<button class="btn btn-xs primary yes"><?php _e("\xe6\230\257"); ?>
</button> '
+ '<button class="btn btn-xs no"><?php _e("\345\220\xa6"); ?>
</button></div>')
.hide().insertBefore(textarea).slideDown();
$('.yes', notice).click(function () {
notice.remove();
$('<input type="hidden" name="markdown" value="1" />').appendTo('.submit');
initMarkdown();
});
$('.no', notice).click(function () {
notice.remove();
});
}
});
</script>
<?php } goto otKzj; uFwyf: ?>
<script>
(function () {
$('#text').on('change', function (e) {
e.preventDefault();
e.stopPropagation();
}).on('input', function () {
$(this).parents('form').trigger('write');
});
})();
</script>
<?php goto AMCWg; YW9kQ: $content = !empty($post) ? $post : $page; goto uFwyf; bkrxK: if (!defined("\x5f\137\124\x59\120\105\103\x48\x4f\137\101\x44\115\111\x4e\137\137")) { die; } goto YW9kQ; otKzj: ?>
Function Calls
None |
Stats
MD5 | b9127401e71b3ac02aa5733206494237 |
Eval Count | 0 |
Decode Time | 97 ms |