Auth_OpenID_SQLStore::_unoctify PHP Метод

_unoctify() публичный Метод

"Unoctifies" octal-escaped data from PostgreSQL and returns the resulting ASCII (possibly binary) string.
public _unoctify ( $str )
    function _unoctify($str)
    {
        $result = "";
        $i = 0;
        while ($i < strlen($str)) {
            $char = $str[$i];
            if ($char == "\\") {
                // Look to see if the next char is a backslash and
                // append it.
                if ($str[$i + 1] != "\\") {
                    $octal_digits = substr($str, $i + 1, 3);
                    $dec = octdec($octal_digits);
                    $char = chr($dec);
                    $i += 4;
                } else {
                    $char = "\\";
                    $i += 2;
                }
            } else {
                $i += 1;
            }
            $result .= $char;
        }
        return $result;
    }