瀏覽代碼

Update custom_fields.php

https://www.opengamepanel.org/forum/viewthread.php?thread_id=5931

The conditional needs to be `true` in order to update the custom field. `empty()` isn't appropriate due to `0` being considered empty, nor is `isset` - `$value` will always be set.

Checking the length of $value (after trimming it - removing whitespace) has the same effect. If strlen returns true, insert whatever the user gave - without the trimming.
Adjokip 8 年之前
父節點
當前提交
bf7772cb16
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      modules/user_games/custom_fields.php

+ 2 - 2
modules/user_games/custom_fields.php

@@ -146,7 +146,7 @@ function exec_ogp_module()
 						}														
 					}
 					
-					if(!empty($value)){
+					if (strlen(trim($value)) > 0) {
 						$updatedSettings[$key] = $value;
 					}
 					
@@ -180,4 +180,4 @@ function exec_ogp_module()
     $ft->add_button("submit","update_settings",get_lang('update_settings'));
     $ft->end_form();
 }
-?>
+?>