GetSimple Support Forum
PROBLEM theme-editor.php - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: PROBLEM theme-editor.php (/showthread.php?tid=16922)



theme-editor.php - smdp-1971 - 2023-01-10

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 "\"


RE: theme-editor.php - islander - 2023-01-11

(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);




RE: theme-editor.php - smdp-1971 - 2023-01-11

(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!