OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the XSL implementation. | 2 * This file is part of the XSL implementation. |
3 * | 3 * |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. |
5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org> | 5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org> |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 sheet->omitXmlDeclaration = true; | 339 sheet->omitXmlDeclaration = true; |
340 | 340 |
341 xsltTransformContextPtr transform_context = | 341 xsltTransformContextPtr transform_context = |
342 xsltNewTransformContext(sheet, source_doc); | 342 xsltNewTransformContext(sheet, source_doc); |
343 RegisterXSLTExtensions(transform_context); | 343 RegisterXSLTExtensions(transform_context); |
344 | 344 |
345 xsltSecurityPrefsPtr security_prefs = xsltNewSecurityPrefs(); | 345 xsltSecurityPrefsPtr security_prefs = xsltNewSecurityPrefs(); |
346 // Read permissions are checked by docLoaderFunc. | 346 // Read permissions are checked by docLoaderFunc. |
347 if (0 != xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_WRITE_FILE, | 347 if (0 != xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_WRITE_FILE, |
348 xsltSecurityForbid)) | 348 xsltSecurityForbid)) |
349 CRASH(); | 349 IMMEDIATE_CRASH(); |
350 if (0 != xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_CREATE_DIRECTORY, | 350 if (0 != xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_CREATE_DIRECTORY, |
351 xsltSecurityForbid)) | 351 xsltSecurityForbid)) |
352 CRASH(); | 352 IMMEDIATE_CRASH(); |
353 if (0 != xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_WRITE_NETWORK, | 353 if (0 != xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_WRITE_NETWORK, |
354 xsltSecurityForbid)) | 354 xsltSecurityForbid)) |
355 CRASH(); | 355 IMMEDIATE_CRASH(); |
356 if (0 != xsltSetCtxtSecurityPrefs(security_prefs, transform_context)) | 356 if (0 != xsltSetCtxtSecurityPrefs(security_prefs, transform_context)) |
357 CRASH(); | 357 IMMEDIATE_CRASH(); |
358 | 358 |
359 // <http://bugs.webkit.org/show_bug.cgi?id=16077>: XSLT processor | 359 // <http://bugs.webkit.org/show_bug.cgi?id=16077>: XSLT processor |
360 // <xsl:sort> algorithm only compares by code point. | 360 // <xsl:sort> algorithm only compares by code point. |
361 xsltSetCtxtSortFunc(transform_context, XsltUnicodeSortFunction); | 361 xsltSetCtxtSortFunc(transform_context, XsltUnicodeSortFunction); |
362 | 362 |
363 // This is a workaround for a bug in libxslt. | 363 // This is a workaround for a bug in libxslt. |
364 // The bug has been fixed in version 1.1.13, so once we ship that this | 364 // The bug has been fixed in version 1.1.13, so once we ship that this |
365 // can be removed. | 365 // can be removed. |
366 if (!transform_context->globalVars) | 366 if (!transform_context->globalVars) |
367 transform_context->globalVars = xmlHashCreate(20); | 367 transform_context->globalVars = xmlHashCreate(20); |
(...skipping 20 matching lines...) Expand all Loading... |
388 | 388 |
389 sheet->method = orig_method; | 389 sheet->method = orig_method; |
390 SetXSLTLoadCallBack(0, 0, 0); | 390 SetXSLTLoadCallBack(0, 0, 0); |
391 xsltFreeStylesheet(sheet); | 391 xsltFreeStylesheet(sheet); |
392 stylesheet_ = nullptr; | 392 stylesheet_ = nullptr; |
393 | 393 |
394 return success; | 394 return success; |
395 } | 395 } |
396 | 396 |
397 } // namespace blink | 397 } // namespace blink |
OLD | NEW |