Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with bulk installing pre-packaged/bundled plugins. #321

Merged
merged 2 commits into from
Apr 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion class-tgm-plugin-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,16 @@ public function column_plugin( $item ) {
*/
public function column_cb( $item ) {

$plugin_url = ( 'repo' === $item['url'] ) ? $item['url'] : esc_url( $item['url'] );
$plugin_url = $item['url']; // 'repo' (no escaping needed), URL or file path
if ( __( 'Private Repository', 'tgmpa' ) === $item['source'] ) {
// Escape external URLs
$plugin_url = esc_url( $plugin_url );
}
elseif ( __( 'Pre-Packaged', 'tgmpa' ) === $item['source'] ) {
// Encode file path for use in attribute
$plugin_url = urlencode( $plugin_url );
}

$value = $item['file_path'] . ',' . $plugin_url . ',' . $item['sanitized_plugin'];
return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" id="%3$s" />', $this->_args['singular'], $value, $item['sanitized_plugin'] );

Expand Down