Plugin Directory

Changeset 2281290


Ignore:
Timestamp:
04/11/2020 05:49:48 AM (6 years ago)
Author:
therealwebdisrupt
Message:

Fixed installing themes locally

Location:
task-runner
Files:
68 added
3 edited

Legend:

Unmodified
Added
Removed
  • task-runner/trunk/README.txt

    r2280223 r2281290  
    33Tags: easy, build, out, script, commands, better, cli, one-click, setup, install, activate, web disrupt
    44Tested up to: 5.4
    5 Stable tag: 1.0.3
     5Stable tag: 1.0.4
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6565== Changelog ==
    6666
     67= 1.0.4 =
     68* Fixed a problem with local themes not being referenced correctly
    6769= 1.0.3 =
    6870* Increased filtering against bad data for getting library items
  • task-runner/trunk/modules/WordPress/wordpress.php

    r2279772 r2281290  
    151151    if ( current_user_can('install_themes') ){
    152152      if(isset($_POST['options'][1])){ // Install theme local
    153         $themeSrc = $this->filter_directory_keywords(sanitize_file_name($_POST['options'][0]));
    154         $themeDest = get_theme_root()."/".sanitize_file_name($_POST['options'][1]);
    155         editor::copy_recursive($themeSrc, $themeDest);
    156         echo "Theme ". end(explode("/", $themeDest))." installed successfully.";
     153        $themeSrc = $this->filter_directory_keywords(sanitize_text_field($_POST['options'][0]));
     154        $themeDest = get_theme_root()."/".sanitize_text_field($_POST['options'][1]);
     155        base::copy_recursive($themeSrc, $themeDest);
     156        echo '{ "message" : "Theme '. end(explode("/", $themeDest)).' installed successfully." }';
    157157      } else { // Install theme
    158         $themeSlug = sanitize_file_name($_POST['options'][0]);
     158        $themeSlug = sanitize_text_field($_POST['options'][0]);
    159159        echo admin_url("update.php?action=install-theme&theme=".$themeSlug."&_wpnonce=".wp_create_nonce("install-theme_".$themeSlug));
    160160      }
     
    173173  public function activate_theme(){
    174174    if ( current_user_can('switch_themes') ){
    175       $themeFullName = sanitize_file_name($_POST['options'][0]);
     175      $themeFullName = sanitize_text_field($_POST['options'][0]);
    176176      echo admin_url("themes.php?action=activate&stylesheet=".$themeFullName."&_wpnonce=".wp_create_nonce("switch-theme_".$themeFullName));
    177177    } else {
     
    189189  public function delete_theme(){
    190190    if ( current_user_can('delete_themes') ){
    191       $themeFullName = sanitize_file_name($_POST['options'][0]);
     191      $themeFullName = sanitize_text_field($_POST['options'][0]);
    192192      echo admin_url("themes.php?action=delete&stylesheet=".$themeFullName."&_wpnonce=".wp_create_nonce("delete-theme_".$themeFullName));
    193193    } else {
  • task-runner/trunk/task-runner.php

    r2280223 r2281290  
    44 * Description: Powerful task automator that can be used to make repeatable tasks and build processes inside WordPress.
    55 * Plugin URI: https://www.webdisrupt.com/task-runner/
    6  * Version: 1.0.3
     6 * Version: 1.0.4
    77 * Author: Web Disrupt
    88 * Author URI: https://webdisrupt.com
     
    7575     * Main Constructor that sets up all static data associated with this plugin.
    7676     *
    77      * @since  1.0.3
     77     * @since  1.0.4
    7878     * @return void
    7979     */
     
    8484            "name"            => "Task Runner",
    8585            "slug"            => "task-runner",
    86             "version"         => "1.0.3",
     86            "version"         => "1.0.4",
    8787            "author"          => "Web Disrupt",
    8888            "description"     => "Powerful task automator that can be used to make repeatable tasks and build processes inside WordPress.",
Note: See TracChangeset for help on using the changeset viewer.