[fix] bad path in preview img in admin page

This commit is contained in:
Knah Tsaeb 2013-09-30 11:37:20 +02:00
parent 3d72e66ed3
commit e842105701

View file

@ -212,7 +212,7 @@ if (isset($ui['log']) && ($ui['log'] === 'suspect' || $ui['log'] === 'retry' ||
if (isset($ui['cache']) && (int)$ui['cache'] === 1) {
$success['filePath'] = pathForFile($ui['s'], $ui['hash']).'.png';
if (!file_exists($success['filePath'])) {
$success['filePath'] = 'data:image/png;base64,'.base64_encode(file_get_contents('bin/error.png'));
$success['base64'] = 'data:image/png;base64,'.base64_encode(file_get_contents('bin/error.png'));
}
}
if (isset($ui['keep']) && (int)$ui['keep'] === 1) {
@ -235,7 +235,7 @@ if (isset($ui['log']) && ($ui['log'] === 'suspect' || $ui['log'] === 'retry' ||
echo '</div>';
if (!empty($success)) {
echo '<div id="result">';
echo '<img src="', $success['filePath'], '?r=', time(), '" style="width:100%;"/>';
echo '<img src="', $success['base64'], '" style="width:100%;"/>';
echo '<p><input type="text" value="http://', $_SERVER['SERVER_NAME'], '/', $success['filePath'], '" onclick="this.select()"/></p>';
echo '<a href="?p=admin&log=', $ui['log'], '&hash=', $ui['hash'], '&root=1">Try with root domain</a> / ';
echo '<a href="?p=admin&log=', $ui['log'], '&hash=', $ui['hash'], '&keep=1">Keep this thumbshot</a>';