<commit_before><?php

header("Content-type: text/html; charset=utf8");
$type = substr($media['mimetype'], strrpos($media['mimetype'], '/') + 1);
if ($type == 'jpeg') {
    $type = 'jpg';
}
$element = str_replace(
    ['[', ']'],
    ['\\\\\\[', '\\\\\\]'],
    $_GET['element']
);

?>
<!doctype html>
<html><body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
<?php if (isset($_GET['redir'])) { ?>
/**
 * @see http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_%28Uploader%29/Custom_File_Browser
 */
// Helper function to get parameters from the query string.
function getUrlParam(paramName)
{
    var reParam = new RegExp('(?:[\?&]|&amp;)' + paramName + '=([^&]+)', 'i');
    var str = '<?=urldecode($_GET['redir'])?>';
    var match = str.match(reParam);
    return (match && match.length > 1) ? match[1] : '';
}
window.opener.CKEDITOR.tools.callFunction(
    getUrlParam('CKEditorFuncNum'),
    '<?=$url('monad/admin/media', ['id' => $media['id'], 'type' => $type])?>'
);
window.close();
<?php } else { ?>
window.parent.Monad.file.done('<?=$element?>', <?=json_encode([
    'id' => $media['id'],
    'alt' => $media['originalname'],
    'src' => $url('monad/admin/view_file', ['id' => $media['id']]),
])?>);
<?php } ?>
</script></body></html>
<commit_msg>Squashed commit of the following:<commit_after><?php

header("Content-type: text/html; charset=utf8");
$type = substr($media['mimetype'], strrpos($media['mimetype'], '/') + 1);
if ($type == 'jpeg') {
    $type = 'jpg';
}

?>
<!doctype html>
<html><body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
<?php if (isset($_GET['redir'])) { ?>
/**
 * @see http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_%28Uploader%29/Custom_File_Browser
 */
// Helper function to get parameters from the query string.
function getUrlParam(paramName)
{
    var reParam = new RegExp('(?:[\?&]|&amp;)' + paramName + '=([^&]+)', 'i');
    var str = '<?=urldecode($_GET['redir'])?>';
    var match = str.match(reParam);
    return (match && match.length > 1) ? match[1] : '';
}
window.opener.CKEDITOR.tools.callFunction(
    getUrlParam('CKEditorFuncNum'),
    '<?=$url('monad/admin/media', ['id' => $media['id'], 'type' => $type])?>'
);
window.close();
<?php

} else {
    $element = str_replace(
        ['[', ']'],
        ['\\\\\\[', '\\\\\\]'],
        $_GET['element']
    );

?>
window.parent.Monad.file.done('<?=$element?>', <?=json_encode([
    'id' => $media['id'],
    'alt' => $media['originalname'],
    'src' => $url('monad/admin/view_file', ['id' => $media['id']]),
])?>);
<?php } ?>
</script></body></html>

{'fraction_non_alphanumeric': 0.27541106128550075, 'fraction_numerical': 0.007473841554559043, 'mean_word_length': 4.300990099009901, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4028459', 'n_tokens_mistral': 1024, 'n_tokens_neox': 994, 'n_words': 158}