Plugin Directory

Changeset 2566592


Ignore:
Timestamp:
07/18/2021 10:31:01 AM (5 years ago)
Author:
ada2go
Message:

Important security an functionality fix

Location:
ada2go-text-modules/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ada2go-text-modules/trunk/a2g_tm_result.php

    r2561723 r2566592  
    11<?php
    22global $wpdb;
     3ob_start();
     4$current_file = file_get_contents(ABSPATH . 'wp-content/plugins/ada2go-text-modules/a2g-css-output.txt');
     5
     6echo "<html>
     7<head>
     8<style>
     9".$current_file."
     10</style>
     11</head>
     12<body class=\"a2g-out-body\">
     13<div class=\"a2g-out-html\">";
    314foreach ($_POST as $key => $value) {
    415    $a2g_catid_textid = explode(",",$value);
     
    617    echo "<br><br>";
    718}
     19echo "</div>
     20</body>
     21</html>";
     22
     23$a2g_tm_seiteninhalt = ob_get_contents();
     24
     25ob_end_flush();
     26
     27$a2g_tm_dir = ABSPATH . 'wp-content/plugins/ada2go-text-modules/reslut-safes/';
     28
     29$a2g_tm_filecount = 0;
     30
     31$a2g_tm_files = glob($a2g_tm_dir . "*");
     32
     33    if ($a2g_tm_files){
     34   
     35     $a2g_tm_filecount = count($a2g_tm_files);
     36     
     37    }
     38
     39$a2g_tm_name_time = time();
     40
     41$a2g_tm_file = fopen($a2g_tm_dir.$a2g_tm_filecount.'_'.$a2g_tm_name_time.'_safe.html', "w");
     42
     43fputs($a2g_tm_file, $a2g_tm_seiteninhalt);
     44
     45fclose($a2g_tm_file);
  • ada2go-text-modules/trunk/ada2go-text-modules.php

    r2566427 r2566592  
    33Plugin Name: Ada2go - Text Modules
    44Description: (DE) ada2go - Text Modules gibt im Frontend ein anklickbares Formular aus um vordefinierten Text auszugeben. Du kannst es beispielsweise f&uuml;r Teilnehmerfeedback, Arbeitszeugnisse oder &auml;hnliches nutzen. (EN) ada2go - Text Modules outputs a clickable form in the frontend to output predefined text. You can use it, for example, for participant feedback, job references or similar.
    5 Version: 1.1
     5Version: 1.2
    66Author: Heiko von ada2go.de
    77Author URI: https://ada2go.de/
     
    149149      return $a2g_built_text_table;
    150150    }
     151   
     152    /**
     153     * Function: a2g_tm_while_safed_textes
     154     * => Output the Text in Table
     155    */ 
     156    function a2g_tm_while_safed_textes() {
     157    global $wpdb;
     158        $directory = ABSPATH . 'wp-content/plugins/ada2go-text-modules/reslut-safes/';
     159        $files = glob($directory . '*.{html}', GLOB_BRACE);
     160       
     161        foreach($files as $file)
     162        {
     163            $path = parse_url($file, PHP_URL_PATH);
     164            $path = basename($path);
     165            echo "<tr><td>Pfad: ".$file." <br><a href='../wp-content/plugins/ada2go-text-modules/reslut-safes/". $path . "' target='_blank'>Datei &ouml;ffnen</a> | <a href=\"#\">Datei l&ouml;schen</a>" . "</td></tr>";
     166        } 
     167    return;
     168    }
    151169 
    152170    /**
  • ada2go-text-modules/trunk/readme.txt

    r2566425 r2566592  
    55Requires at least: 4.7
    66Tested up to: 5.8
    7 Stable tag: 1.1
     7Stable tag: 1.2
    88Requires PHP: 7.0
    99License: GPLv3 or later
     
    3333
    3434== Changelog ==
     35= 1.2 =
     36* Important security fixes
    3537
    3638= 1.1 =
  • ada2go-text-modules/trunk/settings_page.php

    r2566425 r2566592  
    2222          );
    2323            echo __('<div class="updated">
    24               <p>'.__('Erldigt! Alles gespeichert!', 'ada2go-text-modules').'</p>
     24              <p>'.__('Erledigt! Alles gespeichert!', 'ada2go-text-modules').'</p>
    2525            </div>');
    2626    }
     
    4545          );
    4646            echo __('<div class="updated">
    47               <p>'.__('Erldigt! Alles gespeichert!', 'ada2go-text-modules').'</p>
     47              <p>'.__('Erledigt! Alles gespeichert!', 'ada2go-text-modules').'</p>
    4848            </div>');
    4949    }
    5050   
     51   
     52    // Handle EDIT Output CSS
     53    if($_GET['action']=="editoutcss" AND (is_admin())) {
     54    $a2g_new_css_content = sanitize_text_field( $_POST["css-output"]);
     55        $file = ABSPATH . 'wp-content/plugins/ada2go-text-modules/a2g-css-output.txt';
     56        $current = file_get_contents($file);
     57        $current = $a2g_new_css_content;
     58        file_put_contents($file, $current);
     59            echo __('<div class="updated">
     60              <p>'.__('Erledigt! Alles gespeichert!', 'ada2go-text-modules').'</p>
     61            </div>');
     62    }
     63
    5164    // Handle DEL Kat
    5265    if($_GET['action']=="delcat" AND (is_admin())) {
     
    6477              }
    6578    }
     79   
    6680    // Handle DEL Text
    6781    if($_GET['action']=="deltext" AND (is_admin())) {
     
    161175  <button class="tablinks" onclick="a2gSettingTab(event, 'textEdit')"><?php echo __('Texte bearbeiten', 'ada2go-text-modules'); ?></button>
    162176  <button class="tablinks" onclick="a2gSettingTab(event, 'textAdd')"><?php echo __('Texte hinzuf&uuml;gen', 'ada2go-text-modules'); ?></button>
     177  <button class="tablinks" onclick="a2gSettingTab(event, 'textSafes')"><?php echo __('Gespeicherte Ergebnisse', 'ada2go-text-modules'); ?></button>
    163178</div>
    164179
     
    1791943. <?php echo __('Mit dem Shortcode [a2gtm] f&uuml;gst du ein Formular im FRONTEND ein das die Besucher nutzen k&ouml;nnen.', 'ada2go-text-modules'); ?><br>
    1801954. <?php echo __('Wenn nur ausgew&auml;hlte Benutzer diese Seite aufrufen sollen, sch&uuml;tze sie mit einem Passwort oder speziellen Plugin.', 'ada2go-text-modules'); ?>
     196<br><br>
     197<h3><?php echo __('CSS der Ausgabedatei bearbeiten', 'ada2go-text-modules'); ?></h3>
     198<?php echo __('Verwende folgende Klassen: .a2g-out-html, .a2g-out-body ohne HTML Tags (&lt;script&gt;)', 'ada2go-text-modules'); ?>
     199<br>
     200<form action="?page=a2g_tm_settings&action=editoutcss" method="post">
     201<?php
     202$current_file = file_get_contents(ABSPATH . 'wp-content/plugins/ada2go-text-modules/a2g-css-output.txt');
     203echo wp_editor( $current_file, 'css-output'); ?>
     204<br />
     205<br />
     206<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php echo __( 'CSS f&uuml;r die Ausgabedatei speichern', 'ada2go-text-modules' ); ?>">
     207</p>
     208</form>
     209
     210
     211
     212
    181213</div>
    182214
     
    204236<?php echo __( 'Beschreibung', 'ada2go-text-modules' ); ?><br />
    205237<?php
    206 echo wp_editor( '', 'kat-desc' ); ?>
     238echo wp_editor( '', 'kat-desc'); ?>
    207239<br />
    208240<br />
     
    236268<?php echo __( 'Text', 'ada2go-text-modules' ); ?><br />
    237269<?php
    238 echo wp_editor( '', 'text-desc', array(
    239         'media_buttons' => true,
    240         'tinymce' => array( 'plugins' => $mce_plugins )
    241     ) ); ?>
     270echo wp_editor( '', 'text-desc'); ?>
    242271    </div>
    243272<br />
     
    248277<input<?php if($a2g_tm_kat_exist=false) echo " disabled"; ?> type="submit" name="submit" id="submit" class="button button-primary" value="<?php echo __( 'Text speichern', 'ada2go-text-modules' ); ?>">
    249278</form>
     279</div>
     280
     281<div id="textSafes" class="tabcontent">
     282  <h3>Gespeicherte Ausgaben</h3>
     283<div class="a2g-p-container">
     284<?php
     285if(empty(a2g_tm_while_safed_textes())) {
     286echo __( 'Keine Dateien vorhanden.', 'ada2go-text-modules' );
     287} else {
     288?>
     289<table id="a2g-table">
     290<tr>
     291<th><?php echo __( 'Dateiname', 'ada2go-text-modules' ); ?></th>
     292</tr>
     293<?php
     294echo a2g_tm_while_safed_textes();
     295
     296}
     297
     298 ?>
     299</table>
     300</div>
    250301</div>
    251302
Note: See TracChangeset for help on using the changeset viewer.