diff options
-rw-r--r-- | Auth/OpenID/URINorm.php | 8 | ||||
-rw-r--r-- | Services/Yadis/Misc.php | 4 | ||||
-rw-r--r-- | Services/Yadis/XRI.php | 10 | ||||
-rw-r--r-- | Tests/Auth/OpenID/Discover.php | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/Auth/OpenID/URINorm.php b/Auth/OpenID/URINorm.php index 6c07a0d..d1c653e 100644 --- a/Auth/OpenID/URINorm.php +++ b/Auth/OpenID/URINorm.php @@ -90,15 +90,15 @@ function Auth_OpenID_remove_dot_segments($path) $result_segments = array(); while ($path) { - if (_startswith($path, '../')) { + if (Services_Yadis_startswith($path, '../')) { $path = substr($path, 3); - } else if (_startswith($path, './')) { + } else if (Services_Yadis_startswith($path, './')) { $path = substr($path, 2); - } else if (_startswith($path, '/./')) { + } else if (Services_Yadis_startswith($path, '/./')) { $path = substr($path, 2); } else if ($path == '/.') { $path = '/'; - } else if (_startswith($path, '/../')) { + } else if (Services_Yadis_startswith($path, '/../')) { $path = substr($path, 3); if ($result_segments) { array_pop($result_segments); diff --git a/Services/Yadis/Misc.php b/Services/Yadis/Misc.php index a719058..794b62e 100644 --- a/Services/Yadis/Misc.php +++ b/Services/Yadis/Misc.php @@ -41,7 +41,7 @@ function Services_Yadis_getIPrivateChars() ); } -function _pct_escape_unicode($char_match) +function Services_Yadis_pct_escape_unicode($char_match) { $c = $char_match[0]; $result = ""; @@ -51,7 +51,7 @@ function _pct_escape_unicode($char_match) return $result; } -function _startswith($s, $stuff) +function Services_Yadis_startswith($s, $stuff) { return strpos($s, $stuff) === 0; } diff --git a/Services/Yadis/XRI.php b/Services/Yadis/XRI.php index ef456ce..91d385e 100644 --- a/Services/Yadis/XRI.php +++ b/Services/Yadis/XRI.php @@ -42,7 +42,7 @@ function Services_Yadis_getXrefRE() function Services_Yadis_identifierScheme($identifier) { - if (_startswith($identifier, 'xri://') || + if (Services_Yadis_startswith($identifier, 'xri://') || (in_array($identifier[0], Services_Yadis_getXRIAuthorities()))) { return "XRI"; } else { @@ -52,7 +52,7 @@ function Services_Yadis_identifierScheme($identifier) function Services_Yadis_toIRINormal($xri) { - if (!_startswith($xri, 'xri://')) { + if (!Services_Yadis_startswith($xri, 'xri://')) { $xri = 'xri://' . $xri; } @@ -88,7 +88,7 @@ function Services_Yadis_iriToURI($iri) } else { // According to RFC 3987, section 3.1, "Mapping of IRIs to URIs" return preg_replace_callback(Services_Yadis_getEscapeRE(), - '_pct_escape_unicode', $iri); + 'Services_Yadis_pct_escape_unicode', $iri); } } @@ -146,7 +146,7 @@ function Services_Yadis_rootAuthority($xri) $root = null; - if (_startswith($xri, 'xri://')) { + if (Services_Yadis_startswith($xri, 'xri://')) { $xri = substr($xri, 6); } @@ -177,7 +177,7 @@ function Services_Yadis_rootAuthority($xri) function Services_Yadis_XRI($xri) { - if (!_startswith($xri, 'xri://')) { + if (!Services_Yadis_startswith($xri, 'xri://')) { $xri = 'xri://' . $xri; } return $xri; diff --git a/Tests/Auth/OpenID/Discover.php b/Tests/Auth/OpenID/Discover.php index d302fa9..b01835c 100644 --- a/Tests/Auth/OpenID/Discover.php +++ b/Tests/Auth/OpenID/Discover.php @@ -318,7 +318,7 @@ class _MockFetcherForXRIProxy { trigger_error('Error in mock XRI fetcher: no headers or query'); } - if (_startswith($xri, '/')) { + if (Services_Yadis_startswith($xri, '/')) { $xri = substr($xri, 1); } |