News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Array '$parts' undefined in Subs-package.php

Started by Cal O'Shaw, June 28, 2011, 09:29:25 PM

Previous topic - Next topic

Cal O'Shaw

Hello,

Getting errors in my log involving undefined offsets in Subs-Package.php:

  http://xxx/testg2/index.php?action=admin;area=packages;sa=browse;eb4a15d5=da194b1dffb4e75d0f69c496d9860204  8: Undefined offset:  6   File: /home/xxx/public_html/testg2/Sources/Subs-Package.php
Line: 1494


The offsets listed are 6,5,3,2,1

The errors appear to involve this piece of code:

        preg_match('~(\d+)(?:\.(\d+|))?(?:\.)?(\d+|)(?:(alpha|beta|rc)(\d+|)(?:\.)?(\d+|))?(?:(dev))?(\d+|)~', $clean, $parts);

        // Build an array of parts.
        $versions[$id] = array(
            'major' => (int) $parts[1],
            'minor' => (int) $parts[2],
            'patch' => (int) $parts[3],
            'type' => empty($parts[4]) ? 'stable' : $parts[4],
            'type_major' => (int) $parts[5],
            'type_minor' => (int) $parts[6],
            'dev' => !empty($parts[7]),
        );
    }


I get the set of 5 errors each time I do anything with packages (add or remove).

I've used the version emulate feature as not all of the packages are listed for 2.0 (some are for 2.0 RC5).

Is this enough info to help get an idea of what might be happening?  Is $parts[] part of SMF or from a MOD?

Grazie,

Cal

Illori


Advertisement: