@@ -19,21 +19,25 @@ private static function getDefaulSensitiveXmlTags(){
1919 }
2020 public static function getSensitiveXmlTags (){
2121 $ sensitiveTags = array ();
22- if (file_exists (ANET_SENSITIVE_XMLTAGS_JSON_FILE )) {
22+ $ configFilePath = dirname (__FILE__ ) . "/ " . ANET_SENSITIVE_XMLTAGS_JSON_FILE ;
23+ $ userConfigFilePath = ANET_SENSITIVE_XMLTAGS_JSON_FILE ;
24+ if (file_exists ($ userConfigFilePath )) { //client config for tags
2325 //read list of tags(and associate regex-patterns and replacements) from .json file
24- $ sensitiveTags = json_decode (file_get_contents (ANET_SENSITIVE_XMLTAGS_JSON_FILE ));
25- if (json_last_error () === JSON_ERROR_NONE ) {
26- // JSON is valid
26+ $ sensitiveTags = json_decode (file_get_contents ($ configFilePath ));
27+ if (json_last_error () === JSON_ERROR_NONE ) {// JSON is valid
2728 }
2829 else {
29- echo "ERROR: Invalid json in: " . ANET_SENSITIVE_XMLTAGS_JSON_FILE . " json_last_error_msg : " . json_last_error_msg ();
30+ echo "ERROR: Invalid json in: " . $ userConfigFilePath . " json_last_error_msg : " . json_last_error_msg ();
3031 return self ::getDefaulSensitiveXmlTags ();
3132 }
3233 }
33- else {
34- // if not present, create a local config file
35- $ sensitiveTags = self ::getDefaulSensitiveXmlTags ();
36- file_put_contents (ANET_SENSITIVE_XMLTAGS_JSON_FILE , json_encode ($ sensitiveTags , JSON_PRETTY_PRINT ));
34+ else if (file_exists ($ configFilePath )) { //default sdk config for tags
35+ $ sensitiveTags = json_decode (file_get_contents ($ configFilePath ));
36+ if (json_last_error () === JSON_ERROR_NONE ) {
37+ }
38+ else {
39+ exit ("ERROR: Invalid json in: " . $ configFilePath . " json_last_error_msg : " . json_last_error_msg ());
40+ }
3741 }
3842 //Check for disableMask flag in case of client json.
3943 $ applySensitiveTags = array ();
0 commit comments