OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2012 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2012 Apple Inc. All rights reserv
ed. |
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 const AtomicString& code = getAttribute(codeAttr); | 144 const AtomicString& code = getAttribute(codeAttr); |
145 paramNames.append("code"); | 145 paramNames.append("code"); |
146 paramValues.append(code.string()); | 146 paramValues.append(code.string()); |
147 | 147 |
148 // If the 'codebase' attribute is set, it serves as a relative root for the
file that the Java | 148 // If the 'codebase' attribute is set, it serves as a relative root for the
file that the Java |
149 // plugin will load. If the 'code' attribute is set, and the 'archive' is no
t set, then we need | 149 // plugin will load. If the 'code' attribute is set, and the 'archive' is no
t set, then we need |
150 // to check the url generated by resolving 'code' against 'codebase'. If the
'archive' | 150 // to check the url generated by resolving 'code' against 'codebase'. If the
'archive' |
151 // attribute is set, then 'code' points to a class inside the archive, so we
need to check the | 151 // attribute is set, then 'code' points to a class inside the archive, so we
need to check the |
152 // url generated by resolving 'archive' against 'codebase'. | 152 // url generated by resolving 'archive' against 'codebase'. |
153 KURL urlToCheck; | 153 KURL urlToCheck; |
154 KURL rootURL = codeBase.isNull() ? document().url() : document().completeURL
(codeBase); | 154 KURL rootURL; |
| 155 if (!codeBase.isNull()) |
| 156 rootURL = document().completeURL(codeBase); |
| 157 if (rootURL.isNull() || !rootURL.isValid()) |
| 158 rootURL = document().url(); |
| 159 |
155 if (!archive.isNull()) | 160 if (!archive.isNull()) |
156 urlToCheck = KURL(rootURL, archive); | 161 urlToCheck = KURL(rootURL, archive); |
157 else if (!code.isNull()) | 162 else if (!code.isNull()) |
158 urlToCheck = KURL(rootURL, code); | 163 urlToCheck = KURL(rootURL, code); |
159 if (!canEmbedURL(urlToCheck)) | 164 if (!canEmbedURL(urlToCheck)) |
160 return; | 165 return; |
161 | 166 |
162 const AtomicString& name = document().isHTMLDocument() ? getNameAttribute()
: getIdAttribute(); | 167 const AtomicString& name = document().isHTMLDocument() ? getNameAttribute()
: getIdAttribute(); |
163 if (!name.isNull()) { | 168 if (!name.isNull()) { |
164 paramNames.append("name"); | 169 paramNames.append("name"); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 233 |
229 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) | 234 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) |
230 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum
ent(), m_serviceType, m_serviceType, url)) { | 235 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum
ent(), m_serviceType, m_serviceType, url)) { |
231 layoutEmbeddedObject()->setPluginUnavailabilityReason(LayoutEmbeddedObje
ct::PluginBlockedByContentSecurityPolicy); | 236 layoutEmbeddedObject()->setPluginUnavailabilityReason(LayoutEmbeddedObje
ct::PluginBlockedByContentSecurityPolicy); |
232 return false; | 237 return false; |
233 } | 238 } |
234 return true; | 239 return true; |
235 } | 240 } |
236 | 241 |
237 } | 242 } |
OLD | NEW |