Date:2010-08-03 17:46:34 (8 years 4 months ago)
Author:bartbes
Commit:e9941dc4fd55e11be0269c6d6a88e767b3746518
Message:Now only allows file browsing up to /, CARD_ROOT is /card/

Files: src/browsedialog.cpp (1 diff)
src/gmenu2x.cpp (1 diff)
src/selector.cpp (1 diff)

Change Details

src/browsedialog.cpp
167167    if (p == path.size() - 1)
168168        p = path.rfind("/", p - 1);
169169
170    if (p == string::npos || path.compare(0, CARD_ROOT_LEN, CARD_ROOT) != 0 || path.length() <= CARD_ROOT_LEN) {
170    if (p == string::npos || path.compare(0, 1, "/") != 0 || path.length() < 2) {
171171        close = true;
172172        result = false;
173173    } else {
src/gmenu2x.cpp
7777//#include <pnd_discovery.h>
7878#endif
7979
80const char *CARD_ROOT = "/"; //Note: Add a trailing /!
81const int CARD_ROOT_LEN = 1;
80const char *CARD_ROOT = "/card/"; //Note: Add a trailing /!
81const int CARD_ROOT_LEN = 5;
8282
8383using namespace std;
8484using namespace fastdelegate;
src/selector.cpp
152152        if ( gmenu2x->input[ACTION_X] ) {
153153            if (link->getSelectorBrowser()) {
154154                string::size_type p = dir.rfind("/", dir.size()-2);
155                if (p==string::npos || dir.compare(0, CARD_ROOT_LEN, CARD_ROOT) != 0 || dir.length() <= CARD_ROOT_LEN) {
155                if (p==string::npos || dir.compare(0, 1, "/") != 0 || dir.length() < 2) {
156156                    close = true;
157157                    result = false;
158158                } else {

Archive Download the corresponding diff file



interactive