Changeset 3695
- Timestamp:
- 07/06/07 00:51:55 (1 year ago)
- Files:
-
- trunk/Models/JVStyle.m (modified) (1 diff)
- trunk/Plug-Ins/Web Interface/JVWebInterfacePlugin.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Models/JVStyle.m
r3615 r3695 445 445 if( path ) return [NSURL fileURLWithPath:path]; 446 446 447 path = [[NSString stringWithFormat:@"~/Library/Application Support/%@/Styles/Variants/%@/%@.css", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"], [self identifier], name] stringByExpandingTildeInPath]; 448 if( [[NSFileManager defaultManager] isReadableFileAtPath:path] ) 447 NSString *root = [[NSString stringWithFormat:@"~/Library/Application Support/%@/Styles/Variants/", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]] stringByStandardizingPath]; 448 path = [[NSString stringWithFormat:@"%@/%@/%@.css", root, [self identifier], name] stringByExpandingTildeInPath]; 449 if( [path hasPrefix:root] && [[NSFileManager defaultManager] isReadableFileAtPath:path] ) 449 450 return [NSURL fileURLWithPath:path]; 450 451 trunk/Plug-Ins/Web Interface/JVWebInterfacePlugin.m
r3677 r3695 110 110 path = [NSString pathWithComponents:parts]; 111 111 path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:path]; 112 113 passThruFile( path, req, resp, server ); 112 path = [path stringByStandardizingPath]; 113 114 if( ! [path hasPrefix:[[NSBundle mainBundle] resourcePath]] ) { 115 resp -> status_code = 404; 116 resp -> reason_phrase = "Not Found"; 117 resp -> printf( resp, "404: Not Found" ); 118 return; 119 } 120 121 if( path && [path length] ) 122 passThruFile( path, req, resp, server ); 114 123 115 124 [pool release]; … … 159 168 } else { 160 169 path = [[[style bundle] resourcePath] stringByAppendingPathComponent:path]; 161 } 162 163 passThruFile( path, req, resp, server ); 170 path = [path stringByStandardizingPath]; 171 172 if( ! [path hasPrefix:[[style bundle] resourcePath]] ) { 173 resp -> status_code = 404; 174 resp -> reason_phrase = "Not Found"; 175 resp -> printf( resp, "404: Not Found" ); 176 return; 177 } 178 } 179 180 if( path && [path length] ) 181 passThruFile( path, req, resp, server ); 164 182 165 183 [pool release]; … … 192 210 path = [NSString pathWithComponents:parts]; 193 211 path = [[emoticons resourcePath] stringByAppendingPathComponent:path]; 194 195 passThruFile( path, req, resp, server ); 212 path = [path stringByStandardizingPath]; 213 214 if( ! [path hasPrefix:[emoticons resourcePath]] ) { 215 resp -> status_code = 404; 216 resp -> reason_phrase = "Not Found"; 217 resp -> printf( resp, "404: Not Found" ); 218 return; 219 } 220 221 if( path && [path length] ) 222 passThruFile( path, req, resp, server ); 196 223 197 224 [pool release];
