Page MenuHomePhabricator

Stop using is_resource()
Open, Needs TriagePublic

Description

PHP is migrating away from resource type, replacing it with opaque (i.e. no userland-visible methods or properties) classes. This means that code like this will break:

$curl = curl_init( 'http://example.com' );
if ( !is_resource( $curl ) ) {
    die( 'Something horrible happened' );
}

It will always report errors because the handle is not a resource anymore:

>>> var_dump( $curl );
object(CurlHandle)#1 (0) {
}

Instead, return values should be used like this:

if ( !$curl ) { ... }

or

if ( $curl === false ) { ... }

The current progress of PHP's migration can be tracked here. As of PHP 8.0 feature freeze, the following extensions have been migrated:

  • curl
  • openssl
  • shmop
  • sockets
  • sysvmsg
  • sysvsem
  • sysvshm
  • xmlrpc
  • zip
  • zlib

The rest will be done in 8.1 or later, but to avoid having another pass at it and make the code more future-proof, all uses of is_resource() should be removed.

Event Timeline

MaxSem updated the task description. (Show Details)
TheDJ added a subscriber: TheDJ.

CodeEditor/CodeMirror can be removed, because those are only in the language-mode definition for highlighting, not in the extension's php code.

Change 621948 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/tools/codesniffer@master] Disallow is_resource()

https://gerrit.wikimedia.org/r/621948

ssastry added a subscriber: ssastry.

Parsoid's hits are all in the vendor libraries and presumably when core upgrades libraries and we match, this will go away. So, I am untagging Parsoid.

Change 621948 merged by jenkins-bot:
[mediawiki/tools/codesniffer@master] Disallow is_resource()

https://gerrit.wikimedia.org/r/621948

Change 644837 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Enable MediaWiki.Usage.ForbiddenFunctions.is_resource

https://gerrit.wikimedia.org/r/644837

Change 644837 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Enable MediaWiki.Usage.ForbiddenFunctions.is_resource

https://gerrit.wikimedia.org/r/644837

Most of them seem to be in vendored code...

Targets
    Occurrences of 'is_resource' in Directory /Users/reedy/PhpstormProjects/mediawiki
Found Occurrences  (180 usages found)
    Unclassified  (156 usages found)
        mediawiki  (28 usages found)
            core  (20 usages found)
                includes  (19 usages found)
                    api  (1 usage found)
                        ApiResult.php  (1 usage found)
                            366 if ( is_resource( $value ) ) {
                    debug  (3 usages found)
                        logger  (3 usages found)
                            monolog  (2 usages found)
                                LegacyHandler.php  (2 usages found)
                                    152 if ( !is_resource( $this->sink ) ) {
                                    226 if ( is_resource( $this->sink ) ) {
                            LegacyLogger.php  (1 usage found)
                                456 if ( is_resource( $item ) ) {
                    libs  (12 usages found)
                        http  (2 usages found)
                            MultiHttpClient.php  (2 usages found)
                                331 if ( is_resource( $req['body'] ) ) {
                                361 if ( is_resource( $req['body'] ) || $req['body'] !== '' ) {
                        objectcache  (9 usages found)
                            utils  (9 usages found)
                                MemcachedClient.php  (9 usages found)
                                    350 if ( !is_resource( $sock ) ) {
                                    392 if ( !is_resource( $sock ) ) {
                                    485 if ( !is_resource( $sock ) ) {
                                    543 if ( !is_resource( $sock ) ) {
                                    635 if ( !is_resource( $sock ) ) {
                                    883 if ( is_resource( $sock ) ) {
                                    929 if ( !is_resource( $sock ) ) {
                                    1062 if ( !is_resource( $sock ) ) {
                                    1293 if ( !is_resource( $f ) ) {
                        rdbms  (1 usage found)
                            database  (1 usage found)
                                Database.php  (1 usage found)
                                    5498 if ( is_resource( $this->conn ) ) {
                    resourceloader  (1 usage found)
                        ResourceLoaderImage.php  (1 usage found)
                            434 if ( is_resource( $process ) ) {
                    site  (1 usage found)
                        SiteExporter.php  (1 usage found)
                            41 if ( !is_resource( $sink ) || get_resource_type( $sink ) !== 'stream' ) {
                    OrderedStreamingForkController.php  (1 usage found)
                        110 if ( is_resource( $socket ) ) {
                vendor  (1 usage found)
                    bin  (1 usage found)
                        phan_client  (1 usage found)
                            223 if (!\is_resource($client)) {
            extensions  (8 usages found)
                Html2Wiki  (3 usages found)
                    specials  (3 usages found)
                        SpecialHtml2Wiki.php  (3 usages found)
                            483 if ( is_resource( $zipHandle ) ) {
                            514 if ( is_resource( $zipHandle ) ) {
                            968 if ( is_resource( $process ) ) {
                PhabTaskGraph  (2 usages found)
                    arcanist  (2 usages found)
                        src  (2 usages found)
                            future  (2 usages found)
                                exec  (2 usages found)
                                    ExecFuture.php  (1 usage found)
                                        645 if (!is_resource($proc)) {
                                    PhutilExecPassthru.php  (1 usage found)
                                        84 if (!is_resource($proc)) {
                QuickGV  (1 usage found)
                    QuickGV.body.php  (1 usage found)
                        510 if (is_resource($proc)) {
                SemanticWebBrowser  (1 usage found)
                    lib  (1 usage found)
                        EasyRdf  (1 usage found)
                            Utils.php  (1 usage found)
                                245 if (is_resource($process)) {
                TimedMediaHandler  (1 usage found)
                    includes  (1 usage found)
                        handlers  (1 usage found)
                            OggHandler  (1 usage found)
                                File_Ogg  (1 usage found)
                                    File  (1 usage found)
                                        Ogg.php  (1 usage found)
                                            197 if (!is_resource($this->_filePointer))
        PHP  (128 usages found)
            core  (128 usages found)
                vendor  (128 usages found)
                    composer  (1 usage found)
                        xdebug-handler  (1 usage found)
                            src  (1 usage found)
                                XdebugHandler.php  (1 usage found)
                                    269 if (is_resource($process)) {
                    doctrine  (22 usages found)
                        dbal  (22 usages found)
                            src  (22 usages found)
                                Driver  (6 usages found)
                                    IBMDB2  (2 usages found)
                                        Statement.php  (2 usages found)
                                            21 use function is_resource;
                                            134 if (is_resource($source)) {
                                    Mysqli  (2 usages found)
                                        Statement.php  (2 usages found)
                                            24 use function is_resource;
                                            162 if (is_resource($value)) {
                                    OCI8  (2 usages found)
                                        Statement.php  (2 usages found)
                                            15 use function is_resource;
                                            70 assert(is_resource($stmt));
                                Types  (16 usages found)
                                    ArrayType.php  (2 usages found)
                                        7 use function is_resource;
                                        45 $value = is_resource($value) ? stream_get_contents($value) : $value;
                                    BinaryType.php  (3 usages found)
                                        12 use function is_resource;
                                        39 assert(is_resource($fp));
                                        45 if (! is_resource($value)) {
                                    BlobType.php  (3 usages found)
                                        12 use function is_resource;
                                        39 assert(is_resource($fp));
                                        45 if (! is_resource($value)) {
                                    JsonType.php  (2 usages found)
                                        7 use function is_resource;
                                        56 if (is_resource($value)) {
                                    ObjectType.php  (2 usages found)
                                        7 use function is_resource;
                                        44 $value = is_resource($value) ? stream_get_contents($value) : $value;
                                    SimpleArrayType.php  (2 usages found)
                                        11 use function is_resource;
                                        50 $value = is_resource($value) ? stream_get_contents($value) : $value;
                                    TextType.php  (2 usages found)
                                        7 use function is_resource;
                                        28 return is_resource($value) ? stream_get_contents($value) : $value;
                    guzzlehttp  (5 usages found)
                        guzzle  (2 usages found)
                            src  (2 usages found)
                                Handler  (1 usage found)
                                    MockHandler.php  (1 usage found)
                                        125 if (\is_resource($sink)) {
                                Utils.php  (1 usage found)
                                    67 if (\is_resource($value)) {
                        psr7  (3 usages found)
                            src  (3 usages found)
                                Stream.php  (2 usages found)
                                    49 if (!is_resource($stream)) {
                                    107 if (is_resource($this->stream)) {
                                UploadedFile.php  (1 usage found)
                                    96 } elseif (is_resource($streamOrFile)) {
                    hamcrest  (1 usage found)
                        hamcrest-php  (1 usage found)
                            hamcrest  (1 usage found)
                                Hamcrest  (1 usage found)
                                    TypeSafeMatcher.php  (1 usage found)
                                        95 return is_resource($value)
                    mediawiki  (1 usage found)
                        mediawiki-codesniffer  (1 usage found)
                            HISTORY.md  (1 usage found)
                                39 * `ForbiddenFunctionsSniff`: Disallow is_resource() (Kunal Mehta)
                    monolog  (14 usages found)
                        monolog  (14 usages found)
                            src  (14 usages found)
                                Monolog  (14 usages found)
                                    Formatter  (2 usages found)
                                        JsonFormatter.php  (1 usage found)
                                            160 if (is_resource($data)) {
                                        NormalizerFormatter.php  (1 usage found)
                                            173 if (is_resource($data)) {
                                    Handler  (12 usages found)
                                        SyslogUdp  (2 usages found)
                                            UdpSocket.php  (2 usages found)
                                                41 if (is_resource($this->socket)) {
                                                49 if (!is_resource($this->socket)) {
                                        ProcessHandler.php  (3 usages found)
                                            106 if (is_resource($this->process) === false) {
                                            139 if (is_resource($this->process) === false || empty($errors) === false) {
                                            185 if (is_resource($this->process)) {
                                        SlackHandler.php  (1 usage found)
                                            157 if (is_resource($res)) {
                                        SocketHandler.php  (2 usages found)
                                            82 if (is_resource($this->resource)) {
                                            204 return is_resource($this->resource)
                                        StreamHandler.php  (4 usages found)
                                            46 if (is_resource($stream)) {
                                            63 if ($this->url && is_resource($this->stream)) {
                                            95 if (!is_resource($this->stream)) {
                                            107 if (!is_resource($this->stream)) {
                    myclabs  (1 usage found)
                        deep-copy  (1 usage found)
                            src  (1 usage found)
                                DeepCopy  (1 usage found)
                                    DeepCopy.php  (1 usage found)
                                        129 if (is_resource($var)) {
                    nmred  (3 usages found)
                        kafka-php  (3 usages found)
                            src  (3 usages found)
                                Kafka  (3 usages found)
                                    Socket.php  (3 usages found)
                                        204 if (is_resource($this->stream)) {
                                        244 if (is_resource($this->stream)) {
                                        376 if (is_resource($this->stream)) {
                    pear  (29 usages found)
                        mail_mime  (4 usages found)
                            Mail  (4 usages found)
                                mime.php  (2 usages found)
                                    811 if (!is_resource($filename)) {
                                    832 if (!is_resource($filename)) {
                                mimePart.php  (2 usages found)
                                    379 if (!is_resource($filename)) {
                                    400 if (!is_resource($filename)) {
                        net_smtp  (3 usages found)
                            Net  (3 usages found)
                                SMTP.php  (3 usages found)
                                    1149 if (!is_string($data) && !is_resource($data)) {
                                    1158 if (is_resource($data)) {
                                    1197 if (is_resource($data)) {
                        net_socket  (20 usages found)
                            Net  (20 usages found)
                                Socket.php  (20 usages found)
                                    117 if (is_resource($this->fp)) {
                                    190 if (!is_resource($this->fp)) {
                                    235 if (!is_resource($this->fp)) {
                                    257 if (!is_resource($this->fp)) {
                                    287 if (!is_resource($this->fp)) {
                                    315 if (!is_resource($this->fp)) {
                                    336 if (!is_resource($this->fp)) {
                                    361 if (!is_resource($this->fp)) {
                                    384 if (!is_resource($this->fp)) {
                                    447 if (!is_resource($this->fp)) {
                                    464 return (!is_resource($this->fp) || feof($this->fp));
                                    476 if (!is_resource($this->fp)) {
                                    492 if (!is_resource($this->fp)) {
                                    509 if (!is_resource($this->fp)) {
                                    527 if (!is_resource($this->fp)) {
                                    547 if (!is_resource($this->fp)) {
                                    567 if (!is_resource($this->fp)) {
                                    599 if (!is_resource($this->fp)) {
                                    624 if (!is_resource($this->fp)) {
                                    676 if (!is_resource($this->fp)) {
                        pear-core-minimal  (2 usages found)
                            src  (2 usages found)
                                System.php  (2 usages found)
                                    359 if (is_resource($outputfd)) {
                                    367 if (is_resource($outputfd)) {
                    phan  (19 usages found)
                        phan  (19 usages found)
                            .phan  (2 usages found)
                                plugins  (2 usages found)
                                    InvokePHPNativeSyntaxCheckPlugin.php  (2 usages found)
                                        230 if (!is_resource($process)) {
                                        248 if (!is_resource($process)) {
                            src  (15 usages found)
                                Phan  (15 usages found)
                                    AST  (1 usage found)
                                        ASTReverter.php  (1 usage found)
                                            72 if (\is_resource($node)) {
                                    Daemon  (1 usage found)
                                        Transport  (1 usage found)
                                            StreamResponder.php  (1 usage found)
                                                28 if (!\is_resource($connection)) {
                                    Debug  (2 usages found)
                                        Frame.php  (2 usages found)
                                            23 use function is_resource;
                                            68 if (is_resource($value)) {
                                    ForkPool  (4 usages found)
                                        Reader.php  (1 usage found)
                                            56 if (!\is_resource($input)) {
                                        Writer.php  (3 usages found)
                                            32 if (!\is_resource($output)) {
                                            43 return \is_resource(self::$output);
                                            68 if (!\is_resource(self::$output)) {
                                    LanguageServer  (2 usages found)
                                        Logger.php  (2 usages found)
                                            98 if (!\is_resource($new_file)) {
                                            102 if (\is_resource($old_file)) {
                                    Output  (1 usage found)
                                        Printer  (1 usage found)
                                            CSVPrinter.php  (1 usage found)
                                                62 if (!\is_resource($stream)) {
                                    CLI.php  (2 usages found)
                                        50 use function is_resource;
                                        623 if (!is_resource($output_file)) {
                                    Daemon.php  (2 usages found)
                                        104 if (!\is_resource($conn)) {
                                        159 if (!\is_resource($conn)) {
                            NEWS.md  (1 usage found)
                                1163 + Properly infer real types for `is_resource` checks and other cases where UnionType::fromFullyQualifiedRealString() was used.
                            phan_client  (1 usage found)
                                223 if (!\is_resource($client)) {
                    phpdocumentor  (2 usages found)
                        reflection-docblock  (2 usages found)
                            src  (2 usages found)
                                DocBlock  (2 usages found)
                                    Tags  (2 usages found)
                                        InvalidTag.php  (2 usages found)
                                            19 use function is_resource;
                                            122 } elseif (is_resource($value)) {
                    phpspec  (2 usages found)
                        prophecy  (2 usages found)
                            src  (2 usages found)
                                Prophecy  (2 usages found)
                                    Util  (2 usages found)
                                        ExportUtil.php  (1 usage found)
                                            131 if (is_resource($value)) {
                                        StringUtil.php  (1 usage found)
                                            55 if (is_resource($value)) {
                    phpunit  (5 usages found)
                        phpunit  (5 usages found)
                            src  (5 usages found)
                                Framework  (1 usage found)
                                    Constraint  (1 usage found)
                                        IsType.php  (1 usage found)
                                            174 if (\is_resource($other)) {
                                Util  (4 usages found)
                                    PHP  (1 usage found)
                                        DefaultPhpProcess.php  (1 usage found)
                                            90 if (!\is_resource($process)) {
                                    Printer.php  (3 usages found)
                                        80 \assert(\is_resource($this->out));
                                        96 \assert(\is_resource($this->out));
                                        107 \assert(\is_resource($this->out));
                    psy  (2 usages found)
                        psysh  (2 usages found)
                            src  (2 usages found)
                                ExecutionLoop  (1 usage found)
                                    ProcessForker.php  (1 usage found)
                                        267 if (\is_resource($value) || $value instanceof \Closure) {
                                Output  (1 usage found)
                                    ProcOutputPager.php  (1 usage found)
                                        95 if (!\is_resource($this->proc)) {
                    sebastian  (11 usages found)
                        comparator  (1 usage found)
                            src  (1 usage found)
                                ResourceComparator.php  (1 usage found)
                                    27 return \is_resource($expected) && \is_resource($actual);
                        environment  (2 usages found)
                            src  (2 usages found)
                                Console.php  (2 usages found)
                                    87 if (\is_resource($fileDescriptor)) {
                                    149 if (\is_resource($process)) {
                        exporter  (1 usage found)
                            src  (1 usage found)
                                Exporter.php  (1 usage found)
                                    216 if (\is_resource($value)) {
                        global-state  (6 usages found)
                            src  (6 usages found)
                                Snapshot.php  (6 usages found)
                                    337 if (\is_resource($variable)) {
                                    342 if (\is_resource($value)) {
                                    383 if (!\is_array($element) && !\is_object($element) && !\is_resource($element)) {
                                    387 if (!\is_resource($element)) {
                                    401 if (!\is_array($value) && !\is_object($value) && !\is_resource($value)) {
                                    405 if (!\is_resource($value)) {
                        version  (1 usage found)
                            src  (1 usage found)
                                Version.php  (1 usage found)
                                    92 if (!is_resource($process)) {
                    squizlabs  (3 usages found)
                        php_codesniffer  (3 usages found)
                            src  (3 usages found)
                                Standards  (2 usages found)
                                    PSR2  (2 usages found)
                                        Tests  (2 usages found)
                                            ControlStructures  (2 usages found)
                                                SwitchDeclarationUnitTest.inc  (1 usage found)
                                                    55 case is_resource($value):
                                                SwitchDeclarationUnitTest.inc.fixed  (1 usage found)
                                                    55     case is_resource($value):
                                Config.php  (1 usage found)
                                    386 while (is_resource($handle) === true && feof($handle) === false) {
                    symfony  (5 usages found)
                        console  (2 usages found)
                            Output  (1 usage found)
                                StreamOutput.php  (1 usage found)
                                    44 if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) {
                            Terminal.php  (1 usage found)
                                163 if (!\is_resource($process)) {
                        polyfill-php80  (1 usage found)
                            Php80.php  (1 usage found)
                                62 if (!\is_resource($res) && null === @get_resource_type($res)) {
                        var-dumper  (1 usage found)
                            Dumper  (1 usage found)
                                CliDumper.php  (1 usage found)
                                    584 if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) {
                        yaml  (1 usage found)
                            Inline.php  (1 usage found)
                                122 case \is_resource($value):
                    webmozart  (2 usages found)
                        assert  (2 usages found)
                            src  (2 usages found)
                                Assert.php  (2 usages found)
                                    236 if (!\is_resource($value)) {
                                    1999 if (\is_resource($value)) {
    Usage in comments  (1 usage found)
        PHP  (1 usage found)
            core  (1 usage found)
                vendor  (1 usage found)
                    phan  (1 usage found)
                        phan  (1 usage found)
                            src  (1 usage found)
                                Phan  (1 usage found)
                                    LanguageServer  (1 usage found)
                                        LanguageServer.php  (1 usage found)
                                            340                 if (!\is_resource($conn)) {
    Usage in string constants  (23 usages found)
        mediawiki  (13 usages found)
            core  (1 usage found)
                .phpcs.xml  (1 usage found)
                    23 <exclude name="MediaWiki.Usage.ForbiddenFunctions.is_resource" />
            extensions  (12 usages found)
                CodeEditor  (6 usages found)
                    modules  (6 usages found)
                        ace  (6 usages found)
                            mode-php.js  (3 usages found)
                                1407 is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isabstract|\
                                5747 "is_resource": [
                                5748 "bool is_resource(mixed var)",
                            mode-php_laravel_blade.js  (3 usages found)
                                1407 is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isabstract|\
                                5918 "is_resource": [
                                5919 "bool is_resource(mixed var)",
                CodeMirror  (1 usage found)
                    resources  (1 usage found)
                        lib  (1 usage found)
                            codemirror  (1 usage found)
                                mode  (1 usage found)
                                    php  (1 usage found)
                                        php.js  (1 usage found)
                                            89 doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object
                Html2Wiki  (1 usage found)
                    .phpcs.xml  (1 usage found)
                        17 <exclude name="MediaWiki.Usage.ForbiddenFunctions.is_resource" />
                PagesList  (1 usage found)
                    modules  (1 usage found)
                        DataTables  (1 usage found)
                            examples  (1 usage found)
                                resources  (1 usage found)
                                    syntax  (1 usage found)
                                        shCore.js  (1 usage found)
                                            1962 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
                PhabTaskGraph  (3 usages found)
                    arcanist  (2 usages found)
                        resources  (2 usages found)
                            php  (2 usages found)
                                symbol-information.json  (2 usages found)
                                    7435 "is_resource": {
                                    44534 "XC_IS_RESOURCE": {
                    .phpcs.xml  (1 usage found)
                        29 <exclude name="MediaWiki.Usage.ForbiddenFunctions.is_resource" />
        PHP  (10 usages found)
            core  (10 usages found)
                vendor  (10 usages found)
                    mediawiki  (1 usage found)
                        mediawiki-codesniffer  (1 usage found)
                            MediaWiki  (1 usage found)
                                Sniffs  (1 usage found)
                                    Usage  (1 usage found)
                                        ForbiddenFunctionsSniff.php  (1 usage found)
                                            65 'is_resource' => false,
                    phan  (9 usages found)
                        phan  (9 usages found)
                            .phan  (1 usage found)
                                plugins  (1 usage found)
                                    NotFullyQualifiedUsagePlugin.php  (1 usage found)
                                        86 'is_resource' => true,
                            src  (8 usages found)
                                Phan  (8 usages found)
                                    Analysis  (2 usages found)
                                        ConditionVisitor.php  (1 usage found)
                                            921 'is_resource' => $make_direct_assertion_callback('resource'),
                                        NegatedConditionVisitor.php  (1 usage found)
                                            667 'is_resource' => $make_basic_negated_assertion_callback(ResourceType::class),
                                    AST  (1 usage found)
                                        ContextNode.php  (1 usage found)
                                            2566 'is_resource' => true,
                                    Language  (3 usages found)
                                        Internal  (3 usages found)
                                            FunctionDocumentationMap.php  (1 usage found)
                                                8025 'is_resource' => 'Finds whether a variable is a resource',
                                            FunctionSignatureMap.php  (1 usage found)
                                                6514 'is_resource' => ['bool', 'value'=>'mixed'],
                                            FunctionSignatureMapReal_php73.php  (1 usage found)
                                                541 'is_resource' => 'bool',
                                    Plugin  (2 usages found)
                                        Internal  (2 usages found)
                                            RedundantConditionCallPlugin.php  (1 usage found)
                                                306 'is_resource' => $resource_callback,
                                            UseReturnValuePlugin.php  (1 usage found)
                                                550 'is_resource' => true,

Change 748380 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/TimedMediaHandler@master] Remove usage of deprecated is_resource()

https://gerrit.wikimedia.org/r/748380

Change 748380 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] Remove usage of deprecated is_resource()

https://gerrit.wikimedia.org/r/748380

brion added a subscriber: brion.

Removing TimedMediaHandler as the patch landed last month.

For debug output, is_resource() is often appropriate, e.g.

		if ( is_resource( $item ) ) {
			return '[Resource ' . get_resource_type( $item ) . ']';
		}

Also, for input handling where the input may be either a scalar or a stream, there is currently no alternative to is_resource(), e.g.

			if ( is_resource( $req['body'] ) ) {
				curl_setopt( $ch, CURLOPT_INFILE, $req['body'] );

So that is also a correct usage of is_resource(). My core patch will ignore such usages.

Change 756745 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] Stop using is_resource() where possible

https://gerrit.wikimedia.org/r/756745

Change 756745 merged by jenkins-bot:

[mediawiki/core@master] Stop using is_resource() where possible

https://gerrit.wikimedia.org/r/756745

Change 757864 had a related patch set uploaded (by Reedy; author: Tim Starling):

[mediawiki/core@REL1_37] Stop using is_resource() where possible

https://gerrit.wikimedia.org/r/757864

Change 757865 had a related patch set uploaded (by Reedy; author: Tim Starling):

[mediawiki/core@REL1_36] Stop using is_resource() where possible

https://gerrit.wikimedia.org/r/757865

Change 758006 had a related patch set uploaded (by Reedy; author: Tim Starling):

[mediawiki/core@REL1_35] Stop using is_resource() where possible

https://gerrit.wikimedia.org/r/758006

Change 758006 merged by jenkins-bot:

[mediawiki/core@REL1_35] Stop using is_resource() where possible

https://gerrit.wikimedia.org/r/758006

Change 757865 merged by jenkins-bot:

[mediawiki/core@REL1_36] Stop using is_resource() where possible

https://gerrit.wikimedia.org/r/757865

Change 757864 merged by jenkins-bot:

[mediawiki/core@REL1_37] Stop using is_resource() where possible

https://gerrit.wikimedia.org/r/757864