Skip to content

Commit 5b89a17

Browse files
committed
ensure working name
1 parent b0c9cc8 commit 5b89a17

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Piwigo URL Uploader
2+
3+
* Internal name: `url_uploader` (directory name in `plugins/`)
4+
* Plugin page: http://piwigo.org/ext/extension_view.php?eid=668
5+
* Translation: http://piwigo.org/translate/project.php?project=url_uploader

main.inc.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,20 @@
1010

1111
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
1212

13+
if (basename(dirname(__FILE__)) != 'url_uploader')
14+
{
15+
add_event_handler('init', 'urluploader_error');
16+
function urluploader_error()
17+
{
18+
global $page;
19+
$page['errors'][] = 'URL Uploader folder name is incorrect, uninstall the plugin and rename it to "url_uploader"';
20+
}
21+
return;
22+
}
23+
1324

14-
define('URLUPLOADER_ID', basename(dirname(__FILE__)));
15-
define('URLUPLOADER_PATH' , PHPWG_PLUGINS_PATH . URLUPLOADER_ID . '/');
16-
define('URLUPLOADER_ADMIN', get_root_url() . 'admin.php?page=plugin-' . URLUPLOADER_ID);
25+
define('URLUPLOADER_PATH' , PHPWG_PLUGINS_PATH . 'url_uploader/');
26+
define('URLUPLOADER_ADMIN', get_root_url() . 'admin.php?page=plugin-url_uploader');
1727

1828

1929
if (defined('IN_ADMIN'))

0 commit comments

Comments
 (0)