Skip to content

Commit c3c7c74

Browse files
improve: add validation, parse secret words and update the README
1 parent 7efbed2 commit c3c7c74

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

Model/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function getSecrets(): array
7878
self::WEBAPI_LOGS_LOG_SECRET_WORDS,
7979
ScopeInterface::SCOPE_WEBSITE
8080
);
81-
return explode(PHP_EOL, $secrets);
81+
return preg_split('/\n|\r\n?/', $secrets);
8282
}
8383

8484
/**

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ You can select an entry to see more details about the request and the response
2626

2727
# Attention!
2828

29-
Enable this module only for debug reason, please don't let it enabled in production environment because it can slow down all your webapi request and overload your database.
30-
31-
This module logs everything passes in the webapi calls (tokens and passwords too!), remember to clean logs by clicking the `Delete All Logs` button:
29+
If you disable the Secret Mode Enable this module logs everything passes in the webapi calls (tokens and passwords too!), then remember to clean logs by clicking the `Delete All Logs` button:
3230

3331
<img src="https://github.com/ghostunicorns/module-webapi-logs/blob/main/screenshots/screen4.png" />
3432

etc/adminhtml/system.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<depends>
3838
<field id="webapi_logs/log/enabled">1</field>
3939
</depends>
40+
<validate>validate-number validate-greater-than-zero</validate>
4041
</field>
4142
</group>
4243
</section>

screenshots/screen1.png

39.1 KB
Loading

0 commit comments

Comments
 (0)