Search the Community
Showing results for tags 'key'.
Hello forum, this is my first security related post, so I'm a bit of a newbie. I understand that when I have direct front-input from user I should sanitize the input, but how about when I use a secret key for showing a API for a third-party supplier? Should I sanitize the input->get() key? I've tested this issue and I tried ?key=<?php echo $page->field; ?> And without adding any sanitization it comes back: /?key=<?php%20echo%20$page->field;%20?> So can I rely on this, or should I still use $sanitizer just in case? Thanks for the help!
I am looking to hide a googlemap api key from general source code. The first suggestions were to use an environmental variable, then because that doesn't hide the info to then encrypt it. Others have suggested using a config file. (Can I put an array in the config file?) What do you guys do to hide API keys from general source code like this?
Hi all! having some trouble working with the getRandom - or actually, getting it to work another way. I'm currently selecting a random image from an imageArray by using the getRandom function. Now I want to know which image it picked though, so I thought of using php's own rand() function this way: rand(0, $arrayTitle->count()); Works like a blast, until it hit the first image at $arrayTitle(0)... I get the following error: Error: Uncaught Error: Method name must be a string in /Users/JCN/Sites/ffa/wire/core/WireArray.php:1648 Stack trace: #0 /Users/JCN/Sites/ffa/site/templates/head.inc(12): WireArray->__invoke(0) #1 /Users/JCN/Sites/ffa/site/templates/home.php(1): include_once('/Users/JCN/Site...') #2 /Users/JCN/Sites/ffa/wire/core/TemplateFile.php(182): require('/Users/JCN/Site...') #3 /Users/JCN/Sites/ffa/wire/core/Wire.php(398): TemplateFile->___render() #4 /Users/JCN/Sites/ffa/wire/core/Wire.php(333): Wire->runHooks('render', Array) #5 /Users/JCN/Sites/ffa/wire/modules/PageRender.module(422): Wire->__call('render', Array) #6 /Users/JCN/Sites/ffa/wire/core/Wire.php(398): PageRender->___renderPage(Object(HookEvent)) #7 /Users/JCN/Sites/ffa/wire/core/Wire.php(333): Wire->runHooks('renderPage', Array) #8 /Users/JCN/Sites/ffa/wire/core/Wire.php(459): Wire->__call('renderPage', Array) #9 /Users/JCN/Sites/ffa/wire/core/Wire.php(333): Wire->runHooks('render', Array) #10 /Users/JCN/Sites/ffa/wire/modules/Process/ProcessPageView.module(187) (line 1648 of /Users/JCN/Sites/ffa/wire/core/WireArray.php) ...all other images work fine though. Is this something I can fix in the .htaccess? And how come I've never had this before, in other projects? Love to hear your take on things... cheers!