php-general Digest 8 Oct 2013 14:48:05 -0000 Issue 8389
Topics (messages 322258 through 322262):
Re: PHP Fatal error: Call to undefined function ()
322258 by: Stuart Dallas
322259 by: Michael Alaimo
322260 by: Stuart Dallas
Re: date time problem
322261 by: Jim Giner
php.ini
322262 by: Jim Giner
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
On 7 Oct 2013, at 14:24, Michael Alaimo <malaimo...@gmail.com> wrote:
> We have a server that gets a large number of requests each month.
>
> After a period of time I began to see this error in our error logs this
> weekend.
>
> PHP Fatal error: Call to undefined function ()
>
> It does not reference a function, so I found it odd. It did give a line to
> a function with array_merge on it.
>
> Has anyone seen this in the apache error logs? We are using PHP 5.3.3.
Show us the line, and a few lines around it.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--- End Message ---
--- Begin Message ---
public static function getInfo($params = array())
{
$results = array();
$url = 'http://google.com';
$props = array
(
'key' => Yii::app()->params['param1'],
's' => Yii::app()->params['param2']
);
if (!empty($params))
{
$props = array_merge($props, $params);
$url = $url . http_build_query($props, '', '/');
It may be possible that params has unsafe data in it. The previous dev did
not validate the data passed in via get.
The code populating params looks like:
$params = array
(
'd' => $_GET['d'],
);
$job = Job::getInfo($params);
On Mon, Oct 7, 2013 at 9:29 AM, Stuart Dallas <stu...@3ft9.com> wrote:
> On 7 Oct 2013, at 14:24, Michael Alaimo <malaimo...@gmail.com> wrote:
>
> > We have a server that gets a large number of requests each month.
> >
> > After a period of time I began to see this error in our error logs this
> > weekend.
> >
> > PHP Fatal error: Call to undefined function ()
> >
> > It does not reference a function, so I found it odd. It did give a line
> to
> > a function with array_merge on it.
> >
> > Has anyone seen this in the apache error logs? We are using PHP 5.3.3.
>
> Show us the line, and a few lines around it.
>
> -Stuart
>
> --
> Stuart Dallas
> 3ft9 Ltd
> http://3ft9.com/
>
--- End Message ---
--- Begin Message ---
On 7 Oct 2013, at 14:34, Michael Alaimo <malaimo...@gmail.com> wrote:
> On Mon, Oct 7, 2013 at 9:29 AM, Stuart Dallas <stu...@3ft9.com> wrote:
>> On 7 Oct 2013, at 14:24, Michael Alaimo <malaimo...@gmail.com> wrote:
>>
>> > We have a server that gets a large number of requests each month.
>> >
>> > After a period of time I began to see this error in our error logs this
>> > weekend.
>> >
>> > PHP Fatal error: Call to undefined function ()
>> >
>> > It does not reference a function, so I found it odd. It did give a line to
>> > a function with array_merge on it.
>> >
>> > Has anyone seen this in the apache error logs? We are using PHP 5.3.3.
>>
>> Show us the line, and a few lines around it.
> public static function getInfo($params = array())
> {
> $results = array();
>
> $url = 'http://google.com';
>
>
> $props = array
> (
> 'key' => Yii::app()->params['param1'],
> 's' => Yii::app()->params['param2']
> );
>
> if (!empty($params))
> {
> $props = array_merge($props, $params);
>
> $url = $url . http_build_query($props, '', '/');
>
>
> It may be possible that params has unsafe data in it. The previous dev did
> not validate the data passed in via get.
>
> The code populating params looks like:
>
> $params = array
> (
> 'd' => $_GET['d'],
> );
>
> $job = Job::getInfo($params);
My best guess is that either $props or $params contain a function reference or
similar construct. Examine their contents with var_dump.
As a check you could expand out the effect of array_merge and see if you still
get the same with a PHP implementation.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--- End Message ---
--- Begin Message ---
On 10/6/2013 11:21 PM, Romain CIACCAFAVA wrote:
An easier way to do that would be using the diff() method of a DateTime object
on another.
Regards
Romain Ciaccafava
Romain - you were so right. A little less calculating to be done and I
got the result I wished. For anyone interested here's the function I'm
using to determine how much time there is until a cookie expires. The
cookie in question contains the expiration datetime that was used to
create a paired cookie.
function GetTimeLeft($applid)
{
if (isset($_COOKIE[$applid]))
{
if (isset($_COOKIE[$applid."expire"]))
{
$curr_time = new datetime();
$cookietime = $_COOKIE[$applid."expire"];
$exp_time = new datetime();
$exp_time->setTimeStamp($cookietime);
$diff = $curr_time->diff($exp_time);
$days = $diff->format("%d");
$days = ($days > 1) ? "$days days": ($days == 1) ?
"$days day" : '';
$hms = $diff->format("%h:%i:%s");
return "Time left: $days $hms";
}
else
return '?';
}
else
return '0';
}
--- End Message ---
--- Begin Message ---
Can someone give me an understanding of how the .ini settings are
located and combined? I am under the impression that there is a full
settings .ini file somewhere up high in my host's server tree and that
any settings I create in .ini files in each of my domain folders are
appended/updated against the 'main' ini settings to give me a 'current'
group of php.ini settings.
What I'm looking to find out is does an ini setting established in a
test subdomain of my site affect those ini settings outside of my test
subdomain?
--- End Message ---