// Get variables $title = strip_tags(get_input("title")); $description = plugins_strip_tags(get_input("description")); $tags = get_input("tags"); $summary = strip_tags(elgg_substr(get_input('summary'), 0, 250)); $homepage = strip_tags(get_input('homepage')); $donate = strip_tags(get_input('donate')); $repo = strip_tags(get_input('repo')); $license = get_input('license'); $plugincat = get_input('plugincat', 'uncategorized'); $project_access_id = get_input("project_access_id", ACCESS_PUBLIC); $plugin_type = get_input('plugin_type'); if ($plugin_type != 'theme' && $plugin_type != 'languagepack') { $plugin_type = 'plugin'; } $release_notes = plugins_strip_tags(get_input('release_notes')); $elgg_version = get_input('elgg_version', 'Not specified'); $comments = get_input('comments', 'yes'); $version = strip_tags(get_input('version', 'Not specified')); $recommended = get_input('recommended', FALSE); $release_access_id = get_input('release_access_id', ACCESS_PUBLIC); $user = get_loggedin_user(); // validate data if (!$title) { register_error(elgg_echo('plugins:error:notitle')); forward(REFERER); } if ($license == 'none' || !array_key_exists($license, $CONFIG->gpllicenses)) { register_error(elgg_echo('plugins:error:badlicense')); forward(REFERER); }
<?php /** * Update a plugin project */ namespace Elgg\CommunityPlugins; elgg_make_sticky_form('community_plugins'); // Get variables $title = strip_tags(get_input("title")); $desc = plugins_strip_tags(get_input("description")); $tags = get_input("tags"); $access_id = (int) get_input("project_access_id", ACCESS_PUBLIC); $donate = strip_tags(get_input('donate')); $license = get_input('license'); $homepage = strip_tags(get_input('homepage')); $repo = strip_tags(get_input('repo')); $summary = strip_tags(elgg_substr(get_input('summary'), 0, 250)); $plugincat = get_input('plugincat'); $plugin_type = get_input('plugin_type'); if ($plugin_type != 'theme' && $plugin_type != 'languagepack') { $plugin_type = 'plugin'; } $guid = (int) get_input('plugins_guid'); if (!($plugin_project = get_entity($guid))) { register_error(elgg_echo("plugins:error:uploadfailed")); forward("/plugins/" . elgg_get_logged_in_user_entity()->username); } // validate data if (!$title) { register_error(elgg_echo('plugins:error:notitle'));