[geeklog-devel] Site breaks when there is one or more upcoming event?

Joe Mucchiello joe at ThrowingDice.com
Wed Mar 5 20:14:01 EST 2008


At 06:45 PM 3/5/2008, Blank, Jessica wrote:
>The code segment in question, located in the function 
>COM_createLink($content, $url, $attr = array()), is this:
>
>==========
>     foreach ($attr as $key => $value) {
>         $attr_str .= " $key=\"$value\"";
>     }
>==========
>
>As a 'band-aid' fix on the problem, to make the site viewable, I 
>wrapped these three lines of code in this:
>
>     if (count($attr) > 0) {
>     }

That works fine for me in PHP 5.2 and 4.4.7 in . What version of PHP 
are you running? This is my test app:

<?php

error_reporting( E_STRICT );
echo "hello<BR>";

function func($y = array())
{
     foreach ($y as $k => $v) {
         echo $k . ' => ' . $v . '<br>';
     }
}

func();
echo "goodbye<BR>";

?>

Output:
hello
goodbye

----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com 




More information about the geeklog-devel mailing list