/** * We're interested in the extra keys for $INFO when its a media request */ function test_mediainfo() { global $NS, $IMG; $NS = ''; $IMG = 'testimage.png'; $info = $this->_get_info(); $info['image'] = 'testimage.png'; $this->assertEquals(mediainfo(), $info); }
<?php if (!defined('DOKU_INC')) { define('DOKU_INC', dirname(__FILE__) . '/../../'); } define('DOKU_MEDIADETAIL', 1); require_once DOKU_INC . 'inc/init.php'; $IMG = getID('media'); $ID = cleanID($INPUT->str('id')); $REV = $INPUT->int('rev'); // this makes some general info available as well as the info about the // "parent" page $INFO = array_merge(pageinfo(), mediainfo()); $tmp = array(); trigger_event('DETAIL_STARTED', $tmp); //close session session_write_close(); if ($conf['allowdebug'] && $INPUT->has('debug')) { print '<pre>'; foreach (explode(' ', 'basedir userewrite baseurl useslash') as $x) { print '$' . "conf['{$x}'] = '" . $conf[$x] . "';\n"; } foreach (explode(' ', 'DOCUMENT_ROOT HTTP_HOST SCRIPT_FILENAME PHP_SELF ' . 'REQUEST_URI SCRIPT_NAME PATH_INFO PATH_TRANSLATED') as $x) { print '$' . "_SERVER['{$x}'] = '" . $_SERVER[$x] . "';\n"; } print "getID('media'): " . getID('media') . "\n"; print "getID('media',false): " . getID('media', false) . "\n"; print '</pre>'; } $ERROR = false; // check image permissions
if ($INPUT->str('delete')) { $DEL = cleanID($INPUT->str('delete')); $IMG = $DEL; $NS = getNS($DEL); } elseif ($INPUT->str('edit')) { $IMG = cleanID($INPUT->str('edit')); $NS = getNS($IMG); } elseif ($INPUT->str('img')) { $IMG = cleanID($INPUT->str('img')); $NS = getNS($IMG); } else { $NS = cleanID($INPUT->str('ns')); $IMG = null; } global $INFO, $JSINFO; $INFO = !empty($INFO) ? array_merge($INFO, mediainfo()) : mediainfo(); $JSINFO = array('id' => '', 'namespace' => ''); $AUTH = $INFO['perm']; // shortcut for historical reasons $tmp = array(); trigger_event('MEDIAMANAGER_STARTED', $tmp); session_write_close(); //close session // do not display the manager if user does not have read access if ($AUTH < AUTH_READ && !$fullscreen) { http_status(403); die($lang['accessdenied']); } // handle flash upload if (isset($_FILES['Filedata'])) { $_FILES['upload'] =& $_FILES['Filedata'];