Skip to content

Commit

Permalink
Remove allowAppDataPlugins.xml detection.
Browse files Browse the repository at this point in the history
Simply plugins loading emplacement:
NPPM_GETAPPDATAPLUGINSALLOWED to check to see if loading plugins from "%APPDATA%\..\Local\Notepad++\plugins" is allowed.
If doLocalConf no
else yes
  • Loading branch information
donho committed Nov 3, 2018
1 parent 7e555b6 commit e9a489c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 };

#define NPPM_GETAPPDATAPLUGINSALLOWED (NPPMSG + 87)
// BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0)
// Check to see if loading plugins from "%APPDATA%\Notepad++\plugins" is allowed.
// Check to see if loading plugins from "%APPDATA%\..\Local\Notepad++\plugins" is allowed.

#define NPPM_GETCURRENTVIEW (NPPMSG + 88)
// INT NPPM_GETCURRENTVIEW(0, 0)
Expand Down
15 changes: 10 additions & 5 deletions PowerEditor/src/NppBigSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2287,14 +2287,19 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
return _pFileSwitcherPanel->isVisible();
}

case NPPM_GETAPPDATAPLUGINSALLOWED: // if doLocal, it's always false - having doLocal environment cannot load plugins outside
{ // the presence of file "allowAppDataPlugins.xml" will be checked only when not doLocal
// OLD BEHAVIOUR:
// if doLocal, it's always false - having doLocal environment cannot load plugins outside
// the presence of file "allowAppDataPlugins.xml" will be checked only when not doLocal
//
// NEW BEHAVIOUR:
// No more file "allowAppDataPlugins.xml"
// if doLocal - not allowed. Otherwise - allowed.
case NPPM_GETAPPDATAPLUGINSALLOWED:
{
const TCHAR *appDataNpp = pNppParam->getAppDataNppDir();
if (appDataNpp[0]) // if not doLocal
{
generic_string allowAppDataPluginsPath(pNppParam->getNppPath());
PathAppend(allowAppDataPluginsPath, allowAppDataPluginsFile);
return ::PathFileExists(allowAppDataPluginsPath.c_str());
return TRUE;
}
return FALSE;
}
Expand Down
1 change: 0 additions & 1 deletion PowerEditor/src/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ const int COPYDATA_FILENAMESW = 2;
const TCHAR fontSizeStrs[][3] = {TEXT(""), TEXT("5"), TEXT("6"), TEXT("7"), TEXT("8"), TEXT("9"), TEXT("10"), TEXT("11"), TEXT("12"), TEXT("14"), TEXT("16"), TEXT("18"), TEXT("20"), TEXT("22"), TEXT("24"), TEXT("26"), TEXT("28")};

const TCHAR localConfFile[] = TEXT("doLocalConf.xml");
const TCHAR allowAppDataPluginsFile[] = TEXT("allowAppDataPlugins.xml");
const TCHAR notepadStyleFile[] = TEXT("asNotepad.xml");

void cutString(const TCHAR *str2cut, std::vector<generic_string> & patternVect);
Expand Down

0 comments on commit e9a489c

Please sign in to comment.