GetSimple Support Forum

Full Version: theme-editor.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For example, if style.css is changed - eg:
Code:
content: "\00d7";

After saving the changes it looks like this:
Code:
content: "�0d7";

The problem seems to be in "\"
(2023-01-10, 23:38:13)smdp-1971 Wrote: [ -> ]For example, if style.css is changed - eg:
Code:
content: "\00d7";

After saving the changes it looks like this:
Code:
content: "�0d7";

The problem seems to be in "\"

Thanks for the catch!

Edit file admin/theme-edit.php
Starting at line 55, replace this code:
PHP Code:
    # save edited template file
    
$SavedFile $_POST['edited_file'];
//    $FileContents = get_magic_quotes_gpc() ? stripslashes($_POST['content']) : $_POST['content'];    
    
$FileContents stripslashes($_POST['content']);    

    
$fh fopen(GSTHEMESPATH $SavedFile'w') or die("can't open file");
    
fwrite($fh$FileContents);
    
fclose($fh);
    
$success sprintf(i18n_r('TEMPLATE_FILE'), $SavedFile);

With this:
PHP Code:
    # save edited template file
    
$SavedFile $_POST['edited_file'];
    
$FileContents $_POST['content'];
    
$fh fopen(GSTHEMESPATH $SavedFile'w') or die("can't open file");
    
fwrite($fh$FileContents);
    
fclose($fh);
    
$success sprintf(i18n_r('TEMPLATE_FILE'), $SavedFile);

(2023-01-11, 04:07:57)islander Wrote: [ -> ]
(2023-01-10, 23:38:13)smdp-1971 Wrote: [ -> ]For example, if style.css is changed - eg:
Code:
content: "\00d7";

After saving the changes it looks like this:
Code:
content: "�0d7";

The problem seems to be in "\"

Thanks for the catch!

Edit file admin/theme-edit.php
Starting at line 55, replace this code:
PHP Code:
    # save edited template file
    
$SavedFile $_POST['edited_file'];
//    $FileContents = get_magic_quotes_gpc() ? stripslashes($_POST['content']) : $_POST['content'];    
    
$FileContents stripslashes($_POST['content']);    

    
$fh fopen(GSTHEMESPATH $SavedFile'w') or die("can't open file");
    
fwrite($fh$FileContents);
    
fclose($fh);
    
$success sprintf(i18n_r('TEMPLATE_FILE'), $SavedFile);

With this:
PHP Code:
    # save edited template file
    
$SavedFile $_POST['edited_file'];
    
$FileContents $_POST['content'];
    
$fh fopen(GSTHEMESPATH $SavedFile'w') or die("can't open file");
    
fwrite($fh$FileContents);
    
fclose($fh);
    
$success sprintf(i18n_r('TEMPLATE_FILE'), $SavedFile);


Great, now it works! Thank you!