Ladies/Gents:

I recently applied a patch that fixes the multi-line get_meta_tags bug.  A
tag like this would fail:

<meta name="keywords"
content="this is my content>

Now it doesn't.  However, I received emails about other bugs that exist in
it, for example, it doesn't read the HTTP-EQUIV attribute.  I couldn't think
of a way to implement it that would allow for that data to be returned.  But
here is the solution that I will implement, but I wanted to check with the
rest of you first.

get_meta_tags() will now return a multi-dimensional array.  Here is a sample
document:

<meta http-equiv="refresh" content="10;http://www.php.net/">
<meta name="keywords" content="hello" lang="en">
<meta name="keywords" content="hola"  lang="es">

And here is what I propose we return to the user:

$returnval[0]["name"]       == NULL
$returnval[0]["http-equiv"] == "refresh"
$returnval[0]["content"]    == "10;http://www.php.net/"
$returnval[0]["scheme"]     == NULL
$returnval[0]["lang"]       == NULL
$returnval[0]["dir"]        == NULL

$returnval[1]["name"]       == "keywords"
$returnval[1]["http-equiv"] == NULL
$returnval[1]["content"]    == "hello"
$returnval[1]["scheme"]     == NULL
$returnval[1]["lang"]       == "en"
$returnval[1]["dir"]        == NULL

$returnval[1]["name"]       == "keywords"
$returnval[1]["http-equiv"] == NULL
$returnval[1]["content"]    == "hola"
$returnval[1]["scheme"]     == NULL
$returnval[1]["lang"]       == "es"
$returnval[1]["dir"]        == NULL

This will break backwards compatibility, and I am not really in favor of
adding a new param to get_meta_tags in order to include this new
functionality, that will just obfuscate the code more than it needs to be.
I think we should just change one implementation, to another, better one.  I
can't imagine that that many people are using this tag often enough to
require a huge change in their code.

Anyway, let me know what you all think.

Thanks
--
===================================================================
Sean Bright
[EMAIL PROTECTED] / [EMAIL PROTECTED] / http://www.seanbright.com/
===================================================================


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to