View Issue Details

IDProjectCategoryView StatusLast Update
0017366mantisbtplug-inspublic2014-12-08 00:34
ReportergrangewayAssigned Todregad 
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version1.2.17 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0017366: Remove direct access to global variable in plugin.php
Description

In plugin.php we have a block of code:

global $g_plugin_cache;
if ( !isset( $g_plugin_cache[$t_basename] ) ) {
trigger_error( ERROR_PLUGIN_NOT_REGISTERED, ERROR );
}

It strikes me that we might be better moving this to a plugin function (and dropping the direct access to global $g_plugin_cache)

This would then also affect if( plugin_needs_upgrade( $g_plugin_cache[$t_basename] ) ) {
i.e. i've not looked, but why does that function not just take a $t_basename

Additional Information

As initially reported in https://github.com/dregad/mantisbt/commit/54d2eb54253f3a6ac884e884b8aa96fe74aba0c8#commitcomment-6388647

TagsNo tags attached.

Activities

dregad

dregad

2014-05-22 11:37

developer   ~0040624

https://github.com/mantisbt/mantisbt/pull/179

grangeway

grangeway

2014-06-01 17:26

reporter   ~0040703

This just looks to be waiting merge

Related Changesets

MantisBT: master fb68df7f

2014-05-22 09:19:33

Damien Regad

Details Diff
Remove direct access to $g_plugin_cache global variable

Introduces 2 new API functions
- plugin_is_registered()
- plugin_get()

Fixes 0017366
mod - core/plugin_api.php Diff File
mod - manage_plugin_page.php Diff File
mod - plugin.php Diff File
mod - plugin_file.php Diff File

MantisBT: master 506088e1

2014-06-02 04:41:05

Damien Regad

Details Diff
Various plugin-related fixes and enhancements

- Check that a plugin is loaded when accessing its pages to prevent
errors
- Improved error messages
- Simplified handling of MantisCore pseudo-plugin
- Remove direct access to $g_plugin_cache global variable
- Improved plugin file validation regex
- No re-registration of previously registered plugins
- Fixed data type issues in plugin API
- Various code cleanup and whitespace fixes

Fixes 0017359, 0017366, 0017368
mod - core/constant_inc.php Diff File
mod - core/plugin_api.php Diff File
mod - core/print_api.php Diff File
mod - lang/strings_english.txt Diff File
mod - manage_plugin_page.php Diff File
mod - plugin.php Diff File
mod - plugin_file.php Diff File

Issue History

Date Modified Username Field Change
2014-05-22 04:25 dregad New Issue
2014-05-22 04:26 dregad Reporter dregad => grangeway
2014-05-22 04:26 dregad Status new => acknowledged
2014-05-22 11:37 dregad Note Added: 0040624
2014-05-22 11:37 dregad Assigned To => dregad
2014-05-22 11:37 dregad Status acknowledged => assigned
2014-06-01 17:26 grangeway Note Added: 0040703
2014-06-02 05:01 dregad Changeset attached => MantisBT master 506088e1
2014-06-02 05:02 dregad Changeset attached => MantisBT master fb68df7f
2014-06-02 05:03 dregad Status assigned => resolved
2014-06-02 05:03 dregad Fixed in Version => 1.3.0-beta.1
2014-06-02 05:03 dregad Resolution open => fixed
2014-12-08 00:34 vboctor Status resolved => closed