OSDN Git Service
(root)
/
pukiwiki
/
pukiwiki_sandbox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
734d5a4
)
uri_pickup_implode(): enable 'user' and 'pass'
author
henoheno
<henoheno>
Sun, 4 Jan 2009 08:43:10 +0000
(17:43 +0900)
committer
henoheno
<henoheno>
Sun, 4 Jan 2009 08:43:10 +0000
(17:43 +0900)
spam/spam_pickup.php
patch
|
blob
|
history
diff --git
a/spam/spam_pickup.php
b/spam/spam_pickup.php
index
1bd2a38
..
70965ae
100644
(file)
--- a/
spam/spam_pickup.php
+++ b/
spam/spam_pickup.php
@@
-1,5
+1,5
@@
<?php
<?php
-// $Id: spam_pickup.php,v 1.
69 2009/01/02 10:45:5
0 henoheno Exp $
+// $Id: spam_pickup.php,v 1.
70 2009/01/04 08:43:1
0 henoheno Exp $
// Copyright (C) 2006-2007 PukiWiki Developers Team
// License: GPL v2 or (at your option) any later version
//
// Copyright (C) 2006-2007 PukiWiki Developers Team
// License: GPL v2 or (at your option) any later version
//
@@
-29,7
+29,7
@@
function uri_pickup($string = '')
// Refer RFC3986 (Regex below is not strict)
'#(\b[a-z][a-z0-9.+-]{1,8}):[/\\\]+' . // 1: Scheme
'(?:' .
// Refer RFC3986 (Regex below is not strict)
'#(\b[a-z][a-z0-9.+-]{1,8}):[/\\\]+' . // 1: Scheme
'(?:' .
- '([^\s<>"\'\[\]/\#?@]*)' . // 2: Userinfo (Username)
+ '([^\s<>"\'\[\]/\#?@]*)' . // 2: Userinfo (Username
and/or password
)
'@)?' .
'(' .
// 3: Host
'@)?' .
'(' .
// 3: Host
@@
-90,27
+90,43
@@
function uri_pickup_implode($uri = array())
$tmp[] = & $uri['scheme'];
$tmp[] = '://';
}
$tmp[] = & $uri['scheme'];
$tmp[] = '://';
}
+
if (isset($uri['userinfo']) && $uri['userinfo'] !== '') {
$tmp[] = & $uri['userinfo'];
$tmp[] = '@';
if (isset($uri['userinfo']) && $uri['userinfo'] !== '') {
$tmp[] = & $uri['userinfo'];
$tmp[] = '@';
+ } else if (isset($uri['user']) || isset($uri['pass'])) {
+ if (isset($uri['user']) && $uri['user'] !== '') {
+ $tmp[] = & $uri['user'];
+ }
+ $tmp[] = ':';
+ if (isset($uri['pass']) && $uri['pass'] !== '') {
+ $tmp[] = & $uri['pass'];
+ }
+ $tmp[] = '@';
}
}
+
if (isset($uri['host']) && $uri['host'] !== '') {
$tmp[] = & $uri['host'];
}
if (isset($uri['host']) && $uri['host'] !== '') {
$tmp[] = & $uri['host'];
}
+
if (isset($uri['port']) && $uri['port'] !== '') {
$tmp[] = ':';
$tmp[] = & $uri['port'];
}
if (isset($uri['port']) && $uri['port'] !== '') {
$tmp[] = ':';
$tmp[] = & $uri['port'];
}
+
if (isset($uri['path']) && $uri['path'] !== '') {
$tmp[] = & $uri['path'];
}
if (isset($uri['path']) && $uri['path'] !== '') {
$tmp[] = & $uri['path'];
}
+
if (isset($uri['file']) && $uri['file'] !== '') {
$tmp[] = & $uri['file'];
}
if (isset($uri['file']) && $uri['file'] !== '') {
$tmp[] = & $uri['file'];
}
+
if (isset($uri['query']) && $uri['query'] !== '') {
$tmp[] = '?';
$tmp[] = & $uri['query'];
}
if (isset($uri['query']) && $uri['query'] !== '') {
$tmp[] = '?';
$tmp[] = & $uri['query'];
}
+
if (isset($uri['fragment']) && $uri['fragment'] !== '') {
$tmp[] = '#';
$tmp[] = & $uri['fragment'];
if (isset($uri['fragment']) && $uri['fragment'] !== '') {
$tmp[] = '#';
$tmp[] = & $uri['fragment'];
@@
-119,6
+135,7
@@
function uri_pickup_implode($uri = array())
return implode('', $tmp);
}
return implode('', $tmp);
}
+
// ---------------------
// URI normalization
// ---------------------
// URI normalization