Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PROBLEM theme-editor.php
#1
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 "\"
Reply
#2
(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);



GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#3
(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!
Reply




Users browsing this thread: 1 Guest(s)