Check / rewrite value

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
User avatar
Kamahl
Member
Member
Posts: 135
Joined: 02 Jan 2008, 13:08
Real name: Martin
Location: Slovakia
Contact:

Check / rewrite value

Postby Kamahl » 04 Aug 2008, 12:44

||




User avatar
EY
Supporter
Supporter
Posts: 204
Joined: 05 Nov 2006, 23:13
Real name: Elias
Location: Montreal
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Check / rewrite value

Postby EY » 04 Aug 2008, 15:54

You are not suppose to use $_POST ;)

Check this topic:
http://phpbbmodders.net/board/viewtopic.php?f=55&t=2919
Never Say Never!

User avatar
Lord Le Brand
Website Team
Website Team
Posts: 223
Joined: 08 Sep 2006, 15:44
Real name: Leroy
Location: Parkstad, Limburg, the Netherlands (GMT+1)
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Check / rewrite value

Postby Lord Le Brand » 04 Aug 2008, 16:22

Kamahl: The way your doing it seems okay, although I would use integers in stead of strings in your request_var()'s

EY: The way he uses $_POST is okay ;) (only checking existence using isset($_POST['foobar']) is okay)

User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Check / rewrite value

Postby igorw » 04 Aug 2008, 16:23

In fact, in that way $_POST is allowed to be used. But that's an exception. :)

The way you are doing it is okay, you might want to check the [url=http://phpbbmodders.net/board/docs/coding-guidelines.html]coding guidelines[/url] about formatting. And also make sure you're using the correct type for the second request_var param. Check the topic EY linked to for more information.

- we're poor!


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “phpBB Development discussion”

Who is online

Users browsing this forum: No registered users and 23 guests