} /** Decode torrent string * @param string data to decode * @return string decoded string */ static private function decode_string ( & $data ) { if ( self::char( $data ) === '0' && substr( $data, 1, 1 ) != ':' ) self::set_error( new Exception( 'Invalid string length, leading zero' ) ); if ( ! $colon = @strpos( $data, ':' ) ) return self::set_error( new Exception( 'Invalid string length, colon not found' ) ); $length = intval( substr( $data, 0, $colon ) ); if ( $length + $colon + 1 > strlen( $data ) ) return self::set_error( new Exception( 'Invalid string, input too short for string length' ) ); $string = substr( $data, $colon + 1, $length ); $data = substr( $data, $colon + $length + 1 ); return $string; } /** Decode torrent integer * @param string data to decode
$_GET = [ 'slug' => 'captain-tsubasa-new-kick-off-ds', ];