зеркало из https://github.com/mozilla/gecko-dev.git
Fixing bug 156893: strip control characters out of strings which are to become bookmark titles, to avoid saving corrupt XML.
This commit is contained in:
Родитель
a4fc30822e
Коммит
217b99dddb
|
@ -37,6 +37,8 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#import "NSString+Utils.h"
|
||||
|
||||
#import "BookmarksDataSource.h"
|
||||
#import "BookmarkInfoController.h"
|
||||
|
||||
|
@ -150,12 +152,15 @@
|
|||
|
||||
} else { // Folder
|
||||
mCachedHref = nil;
|
||||
title = NS_LITERAL_STRING("New Folder");
|
||||
title = NS_LITERAL_STRING("New Folder"); // XXX localize me
|
||||
}
|
||||
|
||||
NSTextField* textField = [mBrowserWindowController getAddBookmarkTitle];
|
||||
[textField setStringValue: [NSString stringWithCharacters: title.get() length: title.Length()]];
|
||||
NSTextField* textField = [mBrowserWindowController getAddBookmarkTitle];
|
||||
NSString* bookmarkTitle = [NSString stringWithCharacters: title.get() length: title.Length()];
|
||||
NSString* cleanedTitle = [bookmarkTitle stringByReplacingCharactersInSet:[NSCharacterSet controlCharacterSet] withString:@" "];
|
||||
|
||||
[textField setStringValue: cleanedTitle];
|
||||
|
||||
[mBrowserWindowController cacheBookmarkDS: self];
|
||||
|
||||
// Show/hide the bookmark all tabs checkbox as appropriate.
|
||||
|
|
|
@ -21,9 +21,12 @@
|
|||
* Joe Hewitt <hewitt@netscape.com> (Original Author)
|
||||
*/
|
||||
|
||||
#import "NSString+Utils.h"
|
||||
|
||||
#import "CHPageProxyIcon.h"
|
||||
#import "BookmarksService.h"
|
||||
#import "MainController.h"
|
||||
|
||||
#include "nsCRT.h"
|
||||
|
||||
@implementation CHPageProxyIcon
|
||||
|
@ -50,25 +53,20 @@
|
|||
|
||||
- (void) mouseDragged: (NSEvent*) event
|
||||
{
|
||||
NSPasteboard *pboard;
|
||||
NSDictionary* data;
|
||||
NSArray* dataVals;
|
||||
NSArray* dataKeys;
|
||||
NSString* url;
|
||||
NSString* title;
|
||||
|
||||
nsAutoString hrefStr, titleStr;
|
||||
BookmarksService::GetTitleAndHrefForBrowserView(
|
||||
[[[[self window] windowController] getBrowserWrapper] getBrowserView], titleStr, hrefStr);
|
||||
|
||||
url = [NSString stringWithCharacters: hrefStr.get() length: nsCRT::strlen(hrefStr.get())];
|
||||
title = [NSString stringWithCharacters: titleStr.get() length: nsCRT::strlen(titleStr.get())];
|
||||
NSString *url = [NSString stringWithCharacters: hrefStr.get() length: nsCRT::strlen(hrefStr.get())];
|
||||
NSString *title = [NSString stringWithCharacters: titleStr.get() length: nsCRT::strlen(titleStr.get())];
|
||||
|
||||
dataVals = [NSArray arrayWithObjects: url, title, nil];
|
||||
dataKeys = [NSArray arrayWithObjects: @"url", @"title", nil];
|
||||
data = [NSDictionary dictionaryWithObjects:dataVals forKeys:dataKeys];
|
||||
NSString *cleanedTitle = [title stringByReplacingCharactersInSet:[NSCharacterSet controlCharacterSet] withString:@" "];
|
||||
|
||||
pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
|
||||
NSArray *dataVals = [NSArray arrayWithObjects: url, cleanedTitle, nil];
|
||||
NSArray *dataKeys = [NSArray arrayWithObjects: @"url", @"title", nil];
|
||||
NSDictionary *data = [NSDictionary dictionaryWithObjects:dataVals forKeys:dataKeys];
|
||||
|
||||
NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
|
||||
[pboard declareTypes:[NSArray arrayWithObjects:@"MozURLType", NSURLPboardType, NSStringPboardType, nil] owner:self];
|
||||
[pboard setPropertyList:data forType: @"MozURLType"];
|
||||
[[NSURL URLWithString:url] writeToPasteboard: pboard];
|
||||
|
|
Двоичные данные
camino/English.lproj/Localizable.strings
Двоичные данные
camino/English.lproj/Localizable.strings
Двоичный файл не отображается.
Двоичные данные
camino/resources/localized/English.lproj/Localizable.strings
Двоичные данные
camino/resources/localized/English.lproj/Localizable.strings
Двоичный файл не отображается.
|
@ -37,6 +37,8 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#import "NSString+Utils.h"
|
||||
|
||||
#import "BookmarksDataSource.h"
|
||||
#import "BookmarkInfoController.h"
|
||||
|
||||
|
@ -150,12 +152,15 @@
|
|||
|
||||
} else { // Folder
|
||||
mCachedHref = nil;
|
||||
title = NS_LITERAL_STRING("New Folder");
|
||||
title = NS_LITERAL_STRING("New Folder"); // XXX localize me
|
||||
}
|
||||
|
||||
NSTextField* textField = [mBrowserWindowController getAddBookmarkTitle];
|
||||
[textField setStringValue: [NSString stringWithCharacters: title.get() length: title.Length()]];
|
||||
NSTextField* textField = [mBrowserWindowController getAddBookmarkTitle];
|
||||
NSString* bookmarkTitle = [NSString stringWithCharacters: title.get() length: title.Length()];
|
||||
NSString* cleanedTitle = [bookmarkTitle stringByReplacingCharactersInSet:[NSCharacterSet controlCharacterSet] withString:@" "];
|
||||
|
||||
[textField setStringValue: cleanedTitle];
|
||||
|
||||
[mBrowserWindowController cacheBookmarkDS: self];
|
||||
|
||||
// Show/hide the bookmark all tabs checkbox as appropriate.
|
||||
|
|
|
@ -21,9 +21,12 @@
|
|||
* Joe Hewitt <hewitt@netscape.com> (Original Author)
|
||||
*/
|
||||
|
||||
#import "NSString+Utils.h"
|
||||
|
||||
#import "CHPageProxyIcon.h"
|
||||
#import "BookmarksService.h"
|
||||
#import "MainController.h"
|
||||
|
||||
#include "nsCRT.h"
|
||||
|
||||
@implementation CHPageProxyIcon
|
||||
|
@ -50,25 +53,20 @@
|
|||
|
||||
- (void) mouseDragged: (NSEvent*) event
|
||||
{
|
||||
NSPasteboard *pboard;
|
||||
NSDictionary* data;
|
||||
NSArray* dataVals;
|
||||
NSArray* dataKeys;
|
||||
NSString* url;
|
||||
NSString* title;
|
||||
|
||||
nsAutoString hrefStr, titleStr;
|
||||
BookmarksService::GetTitleAndHrefForBrowserView(
|
||||
[[[[self window] windowController] getBrowserWrapper] getBrowserView], titleStr, hrefStr);
|
||||
|
||||
url = [NSString stringWithCharacters: hrefStr.get() length: nsCRT::strlen(hrefStr.get())];
|
||||
title = [NSString stringWithCharacters: titleStr.get() length: nsCRT::strlen(titleStr.get())];
|
||||
NSString *url = [NSString stringWithCharacters: hrefStr.get() length: nsCRT::strlen(hrefStr.get())];
|
||||
NSString *title = [NSString stringWithCharacters: titleStr.get() length: nsCRT::strlen(titleStr.get())];
|
||||
|
||||
dataVals = [NSArray arrayWithObjects: url, title, nil];
|
||||
dataKeys = [NSArray arrayWithObjects: @"url", @"title", nil];
|
||||
data = [NSDictionary dictionaryWithObjects:dataVals forKeys:dataKeys];
|
||||
NSString *cleanedTitle = [title stringByReplacingCharactersInSet:[NSCharacterSet controlCharacterSet] withString:@" "];
|
||||
|
||||
pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
|
||||
NSArray *dataVals = [NSArray arrayWithObjects: url, cleanedTitle, nil];
|
||||
NSArray *dataKeys = [NSArray arrayWithObjects: @"url", @"title", nil];
|
||||
NSDictionary *data = [NSDictionary dictionaryWithObjects:dataVals forKeys:dataKeys];
|
||||
|
||||
NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
|
||||
[pboard declareTypes:[NSArray arrayWithObjects:@"MozURLType", NSURLPboardType, NSStringPboardType, nil] owner:self];
|
||||
[pboard setPropertyList:data forType: @"MozURLType"];
|
||||
[[NSURL URLWithString:url] writeToPasteboard: pboard];
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#import "NSString+Utils.h"
|
||||
|
||||
#import "BookmarksDataSource.h"
|
||||
#import "BookmarkInfoController.h"
|
||||
|
||||
|
@ -150,12 +152,15 @@
|
|||
|
||||
} else { // Folder
|
||||
mCachedHref = nil;
|
||||
title = NS_LITERAL_STRING("New Folder");
|
||||
title = NS_LITERAL_STRING("New Folder"); // XXX localize me
|
||||
}
|
||||
|
||||
NSTextField* textField = [mBrowserWindowController getAddBookmarkTitle];
|
||||
[textField setStringValue: [NSString stringWithCharacters: title.get() length: title.Length()]];
|
||||
NSTextField* textField = [mBrowserWindowController getAddBookmarkTitle];
|
||||
NSString* bookmarkTitle = [NSString stringWithCharacters: title.get() length: title.Length()];
|
||||
NSString* cleanedTitle = [bookmarkTitle stringByReplacingCharactersInSet:[NSCharacterSet controlCharacterSet] withString:@" "];
|
||||
|
||||
[textField setStringValue: cleanedTitle];
|
||||
|
||||
[mBrowserWindowController cacheBookmarkDS: self];
|
||||
|
||||
// Show/hide the bookmark all tabs checkbox as appropriate.
|
||||
|
|
|
@ -21,9 +21,12 @@
|
|||
* Joe Hewitt <hewitt@netscape.com> (Original Author)
|
||||
*/
|
||||
|
||||
#import "NSString+Utils.h"
|
||||
|
||||
#import "CHPageProxyIcon.h"
|
||||
#import "BookmarksService.h"
|
||||
#import "MainController.h"
|
||||
|
||||
#include "nsCRT.h"
|
||||
|
||||
@implementation CHPageProxyIcon
|
||||
|
@ -50,25 +53,20 @@
|
|||
|
||||
- (void) mouseDragged: (NSEvent*) event
|
||||
{
|
||||
NSPasteboard *pboard;
|
||||
NSDictionary* data;
|
||||
NSArray* dataVals;
|
||||
NSArray* dataKeys;
|
||||
NSString* url;
|
||||
NSString* title;
|
||||
|
||||
nsAutoString hrefStr, titleStr;
|
||||
BookmarksService::GetTitleAndHrefForBrowserView(
|
||||
[[[[self window] windowController] getBrowserWrapper] getBrowserView], titleStr, hrefStr);
|
||||
|
||||
url = [NSString stringWithCharacters: hrefStr.get() length: nsCRT::strlen(hrefStr.get())];
|
||||
title = [NSString stringWithCharacters: titleStr.get() length: nsCRT::strlen(titleStr.get())];
|
||||
NSString *url = [NSString stringWithCharacters: hrefStr.get() length: nsCRT::strlen(hrefStr.get())];
|
||||
NSString *title = [NSString stringWithCharacters: titleStr.get() length: nsCRT::strlen(titleStr.get())];
|
||||
|
||||
dataVals = [NSArray arrayWithObjects: url, title, nil];
|
||||
dataKeys = [NSArray arrayWithObjects: @"url", @"title", nil];
|
||||
data = [NSDictionary dictionaryWithObjects:dataVals forKeys:dataKeys];
|
||||
NSString *cleanedTitle = [title stringByReplacingCharactersInSet:[NSCharacterSet controlCharacterSet] withString:@" "];
|
||||
|
||||
pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
|
||||
NSArray *dataVals = [NSArray arrayWithObjects: url, cleanedTitle, nil];
|
||||
NSArray *dataKeys = [NSArray arrayWithObjects: @"url", @"title", nil];
|
||||
NSDictionary *data = [NSDictionary dictionaryWithObjects:dataVals forKeys:dataKeys];
|
||||
|
||||
NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
|
||||
[pboard declareTypes:[NSArray arrayWithObjects:@"MozURLType", NSURLPboardType, NSStringPboardType, nil] owner:self];
|
||||
[pboard setPropertyList:data forType: @"MozURLType"];
|
||||
[[NSURL URLWithString:url] writeToPasteboard: pboard];
|
||||
|
|
Двоичные данные
chimera/English.lproj/Localizable.strings
Двоичные данные
chimera/English.lproj/Localizable.strings
Двоичный файл не отображается.
Двоичные данные
chimera/resources/localized/English.lproj/Localizable.strings
Двоичные данные
chimera/resources/localized/English.lproj/Localizable.strings
Двоичный файл не отображается.
|
@ -37,6 +37,8 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#import "NSString+Utils.h"
|
||||
|
||||
#import "BookmarksDataSource.h"
|
||||
#import "BookmarkInfoController.h"
|
||||
|
||||
|
@ -150,12 +152,15 @@
|
|||
|
||||
} else { // Folder
|
||||
mCachedHref = nil;
|
||||
title = NS_LITERAL_STRING("New Folder");
|
||||
title = NS_LITERAL_STRING("New Folder"); // XXX localize me
|
||||
}
|
||||
|
||||
NSTextField* textField = [mBrowserWindowController getAddBookmarkTitle];
|
||||
[textField setStringValue: [NSString stringWithCharacters: title.get() length: title.Length()]];
|
||||
NSTextField* textField = [mBrowserWindowController getAddBookmarkTitle];
|
||||
NSString* bookmarkTitle = [NSString stringWithCharacters: title.get() length: title.Length()];
|
||||
NSString* cleanedTitle = [bookmarkTitle stringByReplacingCharactersInSet:[NSCharacterSet controlCharacterSet] withString:@" "];
|
||||
|
||||
[textField setStringValue: cleanedTitle];
|
||||
|
||||
[mBrowserWindowController cacheBookmarkDS: self];
|
||||
|
||||
// Show/hide the bookmark all tabs checkbox as appropriate.
|
||||
|
|
|
@ -21,9 +21,12 @@
|
|||
* Joe Hewitt <hewitt@netscape.com> (Original Author)
|
||||
*/
|
||||
|
||||
#import "NSString+Utils.h"
|
||||
|
||||
#import "CHPageProxyIcon.h"
|
||||
#import "BookmarksService.h"
|
||||
#import "MainController.h"
|
||||
|
||||
#include "nsCRT.h"
|
||||
|
||||
@implementation CHPageProxyIcon
|
||||
|
@ -50,25 +53,20 @@
|
|||
|
||||
- (void) mouseDragged: (NSEvent*) event
|
||||
{
|
||||
NSPasteboard *pboard;
|
||||
NSDictionary* data;
|
||||
NSArray* dataVals;
|
||||
NSArray* dataKeys;
|
||||
NSString* url;
|
||||
NSString* title;
|
||||
|
||||
nsAutoString hrefStr, titleStr;
|
||||
BookmarksService::GetTitleAndHrefForBrowserView(
|
||||
[[[[self window] windowController] getBrowserWrapper] getBrowserView], titleStr, hrefStr);
|
||||
|
||||
url = [NSString stringWithCharacters: hrefStr.get() length: nsCRT::strlen(hrefStr.get())];
|
||||
title = [NSString stringWithCharacters: titleStr.get() length: nsCRT::strlen(titleStr.get())];
|
||||
NSString *url = [NSString stringWithCharacters: hrefStr.get() length: nsCRT::strlen(hrefStr.get())];
|
||||
NSString *title = [NSString stringWithCharacters: titleStr.get() length: nsCRT::strlen(titleStr.get())];
|
||||
|
||||
dataVals = [NSArray arrayWithObjects: url, title, nil];
|
||||
dataKeys = [NSArray arrayWithObjects: @"url", @"title", nil];
|
||||
data = [NSDictionary dictionaryWithObjects:dataVals forKeys:dataKeys];
|
||||
NSString *cleanedTitle = [title stringByReplacingCharactersInSet:[NSCharacterSet controlCharacterSet] withString:@" "];
|
||||
|
||||
pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
|
||||
NSArray *dataVals = [NSArray arrayWithObjects: url, cleanedTitle, nil];
|
||||
NSArray *dataKeys = [NSArray arrayWithObjects: @"url", @"title", nil];
|
||||
NSDictionary *data = [NSDictionary dictionaryWithObjects:dataVals forKeys:dataKeys];
|
||||
|
||||
NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
|
||||
[pboard declareTypes:[NSArray arrayWithObjects:@"MozURLType", NSURLPboardType, NSStringPboardType, nil] owner:self];
|
||||
[pboard setPropertyList:data forType: @"MozURLType"];
|
||||
[[NSURL URLWithString:url] writeToPasteboard: pboard];
|
||||
|
|
Загрузка…
Ссылка в новой задаче