diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-01-08 20:56:09 +0000 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-01-08 20:56:09 +0000 |
commit | 07e9e2dc3241eef1b803e655a5273f79cb758806 (patch) | |
tree | 0846f3e3cbefd39041e580bffbc7556eb7f45c93 /_darcs/pristine/extlib/Auth/OpenID/KVForm.php | |
parent | e67affdbbcdcaa9f43750389922b802d0b425ddb (diff) |
Remove _darcs from git repository
Not sure how or why this got in there.
Diffstat (limited to '_darcs/pristine/extlib/Auth/OpenID/KVForm.php')
-rw-r--r-- | _darcs/pristine/extlib/Auth/OpenID/KVForm.php | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/_darcs/pristine/extlib/Auth/OpenID/KVForm.php b/_darcs/pristine/extlib/Auth/OpenID/KVForm.php deleted file mode 100644 index fb342a001..000000000 --- a/_darcs/pristine/extlib/Auth/OpenID/KVForm.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php - -/** - * OpenID protocol key-value/comma-newline format parsing and - * serialization - * - * PHP versions 4 and 5 - * - * LICENSE: See the COPYING file included in this distribution. - * - * @access private - * @package OpenID - * @author JanRain, Inc. <openid@janrain.com> - * @copyright 2005-2008 Janrain, Inc. - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache - */ - -/** - * Container for key-value/comma-newline OpenID format and parsing - */ -class Auth_OpenID_KVForm { - /** - * Convert an OpenID colon/newline separated string into an - * associative array - * - * @static - * @access private - */ - function toArray($kvs, $strict=false) - { - $lines = explode("\n", $kvs); - - $last = array_pop($lines); - if ($last !== '') { - array_push($lines, $last); - if ($strict) { - return false; - } - } - - $values = array(); - - for ($lineno = 0; $lineno < count($lines); $lineno++) { - $line = $lines[$lineno]; - $kv = explode(':', $line, 2); - if (count($kv) != 2) { - if ($strict) { - return false; - } - continue; - } - - $key = $kv[0]; - $tkey = trim($key); - if ($tkey != $key) { - if ($strict) { - return false; - } - } - - $value = $kv[1]; - $tval = trim($value); - if ($tval != $value) { - if ($strict) { - return false; - } - } - - $values[$tkey] = $tval; - } - - return $values; - } - - /** - * Convert an array into an OpenID colon/newline separated string - * - * @static - * @access private - */ - function fromArray($values) - { - if ($values === null) { - return null; - } - - ksort($values); - - $serialized = ''; - foreach ($values as $key => $value) { - if (is_array($value)) { - list($key, $value) = array($value[0], $value[1]); - } - - if (strpos($key, ':') !== false) { - return null; - } - - if (strpos($key, "\n") !== false) { - return null; - } - - if (strpos($value, "\n") !== false) { - return null; - } - $serialized .= "$key:$value\n"; - } - return $serialized; - } -} - -?>
\ No newline at end of file |