Browse Source

Bug localized.

The parser doesn't work well when // and # and /* */ are inside a string.
philippe_mingo 23 năm trước cách đây
mục cha
commit
48cccb180c
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      plugins/administrator/options.php

+ 1 - 0
plugins/administrator/options.php

@@ -25,6 +25,7 @@ function parseConfig( $cfg_file ) {
         do {
         do {
             // Remove comments
             // Remove comments
             $c = trim( $cfg[$i] );
             $c = trim( $cfg[$i] );
+            // This is not correct. We should extract strings before removing comments.
             $c = preg_replace( '/\/\*.*\*\//', '', $c );
             $c = preg_replace( '/\/\*.*\*\//', '', $c );
             $c = preg_replace( '/#.*$/', '', $c );
             $c = preg_replace( '/#.*$/', '', $c );
             $c = preg_replace( '/\/\/.*$/', '', $c );
             $c = preg_replace( '/\/\/.*$/', '', $c );