File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,17 @@ class Form {
165165 private function generate_verbose_name (): string {
166166 # Separate the class name's words with spaces, allow consecutive capital characters like 'DNS'
167167 $ form_name = $ this ->get_class_shortname ();
168- return preg_replace ('/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/ ' , ': ' , $ form_name );
168+ $ verbose_name = preg_replace ('/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/ ' , ' ' , $ form_name );
169+
170+ # Add a colon after the first word if the class name is more than one word
171+ if (str_contains ($ verbose_name , ' ' )) {
172+ $ verbose_name = explode (' ' , $ verbose_name );
173+ $ verbose_name [0 ] .= ': ' ;
174+ $ verbose_name = implode (' ' , $ verbose_name );
175+ }
176+
177+ # Return the verbose name with the 'Form' suffix removed
178+ return str_replace (' Form ' , '' , $ verbose_name );
169179 }
170180
171181 /**
You can’t perform that action at this time.
0 commit comments