View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Request handling - Page 2 - ProjeQtOr
 

Request handling

More
25 Mar 2017 16:30 #7 by babynus
Replied by babynus on topic Request handling
I took your work into account.
Thanks !

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
27 Mar 2017 09:06 #8 by antonio.grr
Replied by antonio.grr on topic Request handling
I notice now that you used a different signature in RequestHandler in order to distinguish between optional and mandatory parameters in Request.
I used $default = 'none' so missing argument can be easily detected to assume that parameter is mandatory.
If you really prefer your approach, you should use $required=true as it refers to the condition of accessing $_REQUEST element with no previous isset test.
This is, for example, what happened in original getSingleElement.php code; using my version and $required=false, exception will be avoided, but I'm not sure that you really want this.
Let me know before I proceed supplying you other code.
Best Regards

Please Log in or Create an account to join the conversation.

More
27 Mar 2017 14:49 #9 by babynus
Replied by babynus on topic Request handling

I used $default = 'none' so missing argument can be easily detected to assume that parameter is mandatory.

I prefer the explicit $required parameter, because 'none' is a string and could be a possible default value.

If you really prefer your approach, you should use $required=true as it refers to the condition of accessing $_REQUEST element with no previous isset test.

You're right. I prefered the default to false because it would not raise "Hack Detected" when not necessary. But in the other hand it will not when nedded...
I think best is to set signature as
getValue($code,$required,$default=null)
with no default value for $required.
This way, we'll have to think about need for a required Request attribute or not.
I'll keep existing signature until sure all calls have been upgraded...

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.040 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.