Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be3630d009 |
No files matched your search
@@ -566,7 +566,7 @@ SSLRandomSeed connect builtin
|
||||
Alias /SOGo.woa/WebServerResources/ /usr/local/lib/GNUstep/SOGo/WebServerResources/
|
||||
Alias /SOGo/WebServerResources/ /usr/local/lib/GNUstep/SOGo/WebServerResources/
|
||||
|
||||
<Directory /usr/lib/x86_64-linux-gnu/GNUstep/SOGo/>
|
||||
<Directory /usr/lib/GNUstep/SOGo/>
|
||||
<IfVersion < 2.4>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
@@ -639,7 +639,7 @@ SSLRandomSeed connect builtin
|
||||
Alias /SOGo.woa/WebServerResources/ /usr/local/lib/GNUstep/SOGo/WebServerResources/
|
||||
Alias /SOGo/WebServerResources/ /usr/local/lib/GNUstep/SOGo/WebServerResources/
|
||||
|
||||
<Directory /usr/lib/x86_64-linux-gnu/GNUstep/SOGo/>
|
||||
<Directory /usr/lib/GNUstep/SOGo/>
|
||||
<IfVersion < 2.4>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
@@ -709,7 +709,7 @@ SSLRandomSeed connect builtin
|
||||
SSLCertificateFile /ssl/apache-selfsigned.crt
|
||||
SSLCertificateKeyFile /ssl/apache-selfsigned.key
|
||||
|
||||
<Directory /usr/lib/x86_64-linux-gnu/GNUstep/SOGo/>
|
||||
<Directory /usr/lib/GNUstep/SOGo/>
|
||||
<IfVersion < 2.4>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
Alias /SOGo.woa/WebServerResources/ \
|
||||
/usr/lib/x86_64-linux-gnu/GNUstep/SOGo/WebServerResources/
|
||||
/usr/lib/GNUstep/SOGo/WebServerResources/
|
||||
Alias /SOGo/WebServerResources/ \
|
||||
/usr/lib/x86_64-linux-gnu/GNUstep/SOGo/WebServerResources/
|
||||
/usr/lib/GNUstep/SOGo/WebServerResources/
|
||||
|
||||
<Directory /usr/lib/x86_64-linux-gnu/GNUstep/SOGo/>
|
||||
<Directory /usr/lib/GNUstep/SOGo/>
|
||||
AllowOverride None
|
||||
|
||||
<IfVersion < 2.4>
|
||||
|
||||
@@ -1089,14 +1089,75 @@ static int cssEscapingCount;
|
||||
}
|
||||
|
||||
- (NSString *) cleanInvalidHTMLTags {
|
||||
// Clean HTML invalid tags as reported in https://bugs.sogo.nu/view.php?id=5755
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithString: self];
|
||||
s = [s stringByReplacingOccurrencesOfString:@"<!-->" withString:@""];
|
||||
s = [s stringByReplacingOccurrencesOfString:@"<!--<!" withString:@"<!--"];
|
||||
// Clean HTML invalid tags as reported in https://bugs.sogo.nu/view.php?id=5755 and https://bugs.sogo.nu/view.php?id=6167
|
||||
// libxml2 (HTML4) sees a standalone empty comment (<!--> or <!--->) as an
|
||||
// unterminated comment and drops the rest of the document, so remove it.
|
||||
// Only do it outside of comments: the Outlook "downlevel-revealed" pattern
|
||||
// <!--[if !mso]><!--> ... <!--<![endif]--> ends its first comment with
|
||||
// "<!-->", and removing it would hide the content in between.
|
||||
NSString *result;
|
||||
unichar *in, *out;
|
||||
NSUInteger len, i, j, o;
|
||||
|
||||
return s;
|
||||
len = [self length];
|
||||
if (len == 0)
|
||||
return [NSString string];
|
||||
|
||||
// Work on raw buffers: linear time, bounded memory (no per-comment objects)
|
||||
in = NSZoneMalloc (NULL, len * sizeof (unichar));
|
||||
out = NSZoneMalloc (NULL, len * sizeof (unichar));
|
||||
[self getCharacters: in];
|
||||
i = o = 0;
|
||||
|
||||
while (i < len)
|
||||
{
|
||||
if (i + 3 < len
|
||||
&& in[i] == '<' && in[i+1] == '!' && in[i+2] == '-' && in[i+3] == '-')
|
||||
{
|
||||
j = i + 4;
|
||||
if (j < len && in[j] == '>')
|
||||
{
|
||||
// <!-->
|
||||
i = j + 1;
|
||||
continue;
|
||||
}
|
||||
if (j + 1 < len && in[j] == '-' && in[j+1] == '>')
|
||||
{
|
||||
// <!--->
|
||||
i = j + 2;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Regular comment: keep it untouched up to its end ("-->" or "--!>",
|
||||
// as libxml2 accepts both), or up to the end if unterminated
|
||||
while (j < len)
|
||||
{
|
||||
if (j + 2 < len && in[j] == '-' && in[j+1] == '-' && in[j+2] == '>')
|
||||
{
|
||||
j += 3;
|
||||
break;
|
||||
}
|
||||
if (j + 3 < len && in[j] == '-' && in[j+1] == '-'
|
||||
&& in[j+2] == '!' && in[j+3] == '>')
|
||||
{
|
||||
j += 4;
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
memcpy (out + o, in + i, (j - i) * sizeof (unichar));
|
||||
o += j - i;
|
||||
i = j;
|
||||
}
|
||||
else
|
||||
out[o++] = in[i++];
|
||||
}
|
||||
|
||||
result = [NSString stringWithCharacters: out length: o];
|
||||
NSZoneFree (NULL, in);
|
||||
NSZoneFree (NULL, out);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -127,7 +127,15 @@
|
||||
- (void) test_stringCleanInvalidHTMLTags
|
||||
{
|
||||
testEquals([[NSString stringWithString:@"<div>Test<!--></div>"] cleanInvalidHTMLTags], @"<div>Test</div>");
|
||||
testEquals([[NSString stringWithString:@"<div><!--[if !mso]><span>Test</span><!--<![endif]--></div>"] cleanInvalidHTMLTags], @"<div><!--[if !mso]><span>Test</span><!--[endif]--></div>");
|
||||
testEquals([[NSString stringWithString:@"<div>Test<!---></div>"] cleanInvalidHTMLTags], @"<div>Test</div>");
|
||||
testEquals([[NSString stringWithString:@"<div>A<!-->B<!-- c -->C<!-->D</div>"] cleanInvalidHTMLTags], @"<div>AB<!-- c -->CD</div>");
|
||||
testEquals([[NSString stringWithString:@"<div><!--[if !mso]><span>Test</span><!--<![endif]--></div>"] cleanInvalidHTMLTags], @"<div><!--[if !mso]><span>Test</span><!--<![endif]--></div>");
|
||||
// Outlook "downlevel-revealed" conditional comment: content must stay visible
|
||||
testEquals([[NSString stringWithString:@"<a><!--[if !mso]><!--> <div><img src=\"x\"/></div> <!--<![endif]--><!--[if mso]><v:fill/><![endif]--></a>"] cleanInvalidHTMLTags], @"<a><!--[if !mso]><!--> <div><img src=\"x\"/></div> <!--<![endif]--><!--[if mso]><v:fill/><![endif]--></a>");
|
||||
// libxml2 also ends a comment with "--!>"
|
||||
testEquals([[NSString stringWithString:@"A<!-- x --!>B<!-->C"] cleanInvalidHTMLTags], @"A<!-- x --!>BC");
|
||||
// unterminated comment is left as is
|
||||
testEquals([[NSString stringWithString:@"<div>A<!-- B</div>"] cleanInvalidHTMLTags], @"<div>A<!-- B</div>");
|
||||
}
|
||||
|
||||
- (void) test_stringRemoveHTMLTagsExceptAnchorTags
|
||||
|
||||
@@ -1 +1 @@
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/ActiveSync.SOGo
|
||||
usr/lib/GNUstep/SOGo/ActiveSync.SOGo
|
||||
@@ -1,2 +1,2 @@
|
||||
/usr/include/x86_64-linux-gnu/GNUstep/*
|
||||
usr/lib/x86_64-linux-gnu/sogo/lib*.so
|
||||
usr/include/GNUstep/*
|
||||
usr/lib/sogo/lib*.so
|
||||
@@ -4,24 +4,24 @@ etc/default/sogo
|
||||
etc/logrotate.d/sogo
|
||||
etc/sogo/sogo.conf
|
||||
usr/sbin/*
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/Frameworks/*
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/Libraries/*
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/OCSTypeModels/*
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SaxDrivers-4.9/*
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SaxMappings/*
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/WOxElemBuilders-4.9/*
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/Templates
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/WebServerResources
|
||||
usr/lib/x86_64-linux-gnu/sogo/lib*.so.*
|
||||
usr/lib/GNUstep/Frameworks/*
|
||||
usr/lib/GNUstep/Libraries/*
|
||||
usr/lib/GNUstep/OCSTypeModels/*
|
||||
usr/lib/GNUstep/SaxDrivers-4.9/*
|
||||
usr/lib/GNUstep/SaxMappings/*
|
||||
usr/lib/GNUstep/WOxElemBuilders-4.9/*
|
||||
usr/lib/GNUstep/SOGo/Templates
|
||||
usr/lib/GNUstep/SOGo/WebServerResources
|
||||
usr/lib/sogo/lib*.so.*
|
||||
usr/share/lintian/*
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/AdministrationUI.SOGo
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/Appointments.SOGo
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/CommonUI.SOGo
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/Contacts.SOGo
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/ContactsUI.SOGo
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/MailPartViewers.SOGo
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/Mailer.SOGo
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/MailerUI.SOGo
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/MainUI.SOGo
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/PreferencesUI.SOGo
|
||||
usr/lib/x86_64-linux-gnu/GNUstep/SOGo/SchedulerUI.SOGo
|
||||
usr/lib/GNUstep/SOGo/AdministrationUI.SOGo
|
||||
usr/lib/GNUstep/SOGo/Appointments.SOGo
|
||||
usr/lib/GNUstep/SOGo/CommonUI.SOGo
|
||||
usr/lib/GNUstep/SOGo/Contacts.SOGo
|
||||
usr/lib/GNUstep/SOGo/ContactsUI.SOGo
|
||||
usr/lib/GNUstep/SOGo/MailPartViewers.SOGo
|
||||
usr/lib/GNUstep/SOGo/Mailer.SOGo
|
||||
usr/lib/GNUstep/SOGo/MailerUI.SOGo
|
||||
usr/lib/GNUstep/SOGo/MainUI.SOGo
|
||||
usr/lib/GNUstep/SOGo/PreferencesUI.SOGo
|
||||
usr/lib/GNUstep/SOGo/SchedulerUI.SOGo
|
||||
@@ -19,7 +19,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin
|
||||
case "$1" in
|
||||
configure)
|
||||
# update timestamp on imgs,css,js to let apache know the files changed
|
||||
find /usr/lib/x86_64-linux-gnu/GNUstep/SOGo/WebServerResources -exec touch {} \;
|
||||
find /usr/lib/GNUstep/SOGo/WebServerResources -exec touch {} \;
|
||||
|
||||
# Make example scripts in /usr/share/doc/sogo/ executable
|
||||
# (they do not really belong there, we are violating Debian
|
||||
|
||||
Reference in new issue
Block a user