Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

fRequest::get() makes value null?

posted by slick 7 years ago

Hi, I just installed my app on an older machine running os leopard with php 5.3.5. Using mamp 1.9

my problem is when using fRequest::get('somevalue'); it always returns null?

$validator = new fValidation();
$validator->addRequiredFields('username', 'password');
if (!$admin = User::find(fRequest::get('username'), 'username')) {
    throw new Exception('Invalid Admin and/or Password. Please try again.');

But it never passes validate because post values are null. But when I print_r($_POST); the values are there correctly. any idea why? i narrowed it down to the static function cast in fRequest.php

I think it has something to do with fUTF8::clean iconv.

okay i figured it out after looking in fUTF8::iconv . I saw the comments that theres a problem with MAMP 1.9.4 and i am using 1.9.6 though?

Is the return value explicitly NULL? I.e. if you do a var_dump() it actually says NULL? Does phpinfo() actually show iconv as being available? Perhaps for some reason it's not included in MAMP? Looking at the source it appears you should essentially be getting the return of iconv, which reports on PHP.net as returning FALSE on failure, not NULL. Presumably if it stripped all characters it would return an empty string.

posted by mattsah 7 years ago

I don't believe MAMP fixed their broken version of iconv until version 2.0, but I could be wrong.

posted by wbond 7 years ago