Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/08/2009 09:15:53 PM (17 years ago)
Author:
mdawaffe
Message:

Grab just the first commented area from the file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-admin/includes/functions.bb-plugin.php

    r2051 r2052  
    183183
    184184    // Pull only the first 8kiB of the file in.
    185     $plugin_data = fread( $fp, 8192 );
     185    $plugin_code = fread( $fp, 8192 );
    186186
    187187    // PHP will close file handle, but we are good citizens.
    188188    fclose($fp);
     189
     190    // Grab just the first commented area from the file
     191    if ( !preg_match( '|/\*(.*?Plugin Name:.*?)\*/|ims', $plugin_code, $plugin_block ) )
     192        return false;
     193        $plugin_data = trim( $plugin_block[1] );
    189194
    190195    preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $name );
Note: See TracChangeset for help on using the changeset viewer.