Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103751 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 65630 invoked from network); 16 Jan 2019 11:24:00 -0000 Received: from unknown (HELO mail-pl1-f172.google.com) (209.85.214.172) by pb1.pair.com with SMTP; 16 Jan 2019 11:24:00 -0000 Received: by mail-pl1-f172.google.com with SMTP id y1so2622808plp.9 for ; Wed, 16 Jan 2019 00:00:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=eMmM9LOs9UhHlEYwCkPusDQydirDCn+UdQi2MpkmRHM=; b=MJ7GOvQnbSUmWW2bDtXz60STl3GloI4m04Tzu5aQC9VCo4Wx1j8sM7t2JXSZfVJe2c aZ7cR5uqFw5LAwVO75wDB7/klEKe6Mk4jtwwEjxPZ3XgB41BFAD/cP/4Qm8oe6jK8mKi 9ItgmYC3WiQ9w9qk9guLsBaTnQP3ZMws7flmnP3cHBniL4x5PKmFpSCa82/q8Y3xQkuc 94h1BlbYd2Hmrx5lrlZH61qOpiDOq7EUQcPWs3ULpvbkZeUOyIuZBPrv+VPIikazzV7b x1jcemA+K7/ffBmc7vHbK9Z8FWo5GwleVx9BjfVNTt8fqs751/NooycNjxF0Z9dy0VYi Q1aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=eMmM9LOs9UhHlEYwCkPusDQydirDCn+UdQi2MpkmRHM=; b=XSozD9/On6M75Jocb+7o4JmsNbsek/wL2z/trjqf8bE6jCIxS8Iy0u83xg+r10zmcc wXSbwsrtZEn+/02ntknYP/aJVlVEX5Qoo7rm+rCZq+sd/lgdP/2Ddc3X0UNtm4372nfd 3nwRoOmovHKJBgC/07k9XZWQBb2Xb3dvGjnBZ3Yccvd6R9JGBxD+MzmP3yngM2n1xXPa lvkm8fpqS5XmmH82KGy24360pDVXmeY+5PJD675lp3j5T/CJ8eVHe1mN6qbePH0C1NEE RcZPtUkBUFC2MSdD9S4Lb1jiY4MCDKRglgY0Qszp2A7Uacwfng3XTaVzkqkW0GvfNjWd nPFA== X-Gm-Message-State: AJcUukfTDyZgLoRIwS9hMRmv8xzB51NmWt+K4G9z31HOBXr5JbOMoeMn P7V0TpkJZrc4zp8eVGwH3i8o0Q8QjbHgXF9hYXfsDA8ktiE= X-Google-Smtp-Source: ALg8bN6uM404VJRDiPJb4ptndXeemuBHJMnxewF2Be0mvHHCK4bcIhSr8uU6cT4VU6LLy5eO6oOQVfTEPBcu3i8QzSk= X-Received: by 2002:a17:902:c85:: with SMTP id 5mr8618317plt.339.1547625604110; Wed, 16 Jan 2019 00:00:04 -0800 (PST) MIME-Version: 1.0 Date: Wed, 16 Jan 2019 08:59:55 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="00000000000060ef0a057f8eaa51" Subject: Possible bug in the implementation of php://input streams? From: rasmus@mindplay.dk (Rasmus Schultz) --00000000000060ef0a057f8eaa51 Content-Type: text/plain; charset="UTF-8" We've noticed something odd about the "php://input" stream. This type of stream resource reports itself as seekable: assert(stream_get_meta_data(fopen("php://input", "r"))["seekable"] === true); https://3v4l.org/EFLiO If you attempt to rewind() it after reading the stream, rewind() returns true, and ftell() subequently returns 0. However, attempting to read the stream again after that returns nothing. On the other hand, if you fopen() a new resource, it is readable again after all. So it seems, either the "php://input" stream implementation is somehow broken - or it's incorrectly reporting as seekable? Any idea? --00000000000060ef0a057f8eaa51--