aboutsummaryrefslogtreecommitdiffstats
path: root/includes/libs/mime/MSCompoundFileReader.php
Commit message (Collapse)AuthorAgeFilesLines
* libs: Use type declaration on undocumented private functionsUmherirrender2025-03-311-8/+8
| | | | Change-Id: I9a74c316b87ae35597ce846a830a55542d9aa14c
* Add namespace to remaining parts of Wikimedia\Mime and Wikimedia\StatsJames D. Forrester2024-09-271-0/+7
| | | | | Bug: T353458 Change-Id: If0137003ab625017d322d57870448a02569668c3
* Merge "libs: Add missing documentation to class properties"jenkins-bot2024-09-141-0/+10
|\
| * libs: Add missing documentation to class propertiesUmherirrender2024-09-131-0/+10
| | | | | | | | | | | | | | | | | | | | Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I46f46f1855ca32c89a276b06f4e2051ff541886e
* | Use const keyword for constant list of strings or intsUmherirrender2024-09-111-3/+3
|/ | | | | | Also changed visiblity of some to private Change-Id: I113b040321d27c84fe9b807c162736909e96fb20
* mime: Improve docs, add ingroup tags to class doc blocksTimo Tijhof2024-03-131-8/+5
| | | | | | | | | | | | | | | | | | * Remove redundant file-level description and ensure the class desc and ingroup tag are on the class block instead. Ref https://gerrit.wikimedia.org/r/q/owner:Krinkle+message:ingroup Also remove `@group` from `@file` block in MediaHandler.php, which caused an unhelpful duplicate to be shown in the navigation on doc.wikimedia.org. * Create a new "Mime" doc group, and tag all wikimedia/mime classes with it. Organize it as a subgroup of "Media", matching the way its tests and other classes relating to handling of media uploads. * Remove dependency on wikimedia/at-ease per T253461. Change-Id: If7629db2f33ba8059c5d58d2992488f8f49be373
* Replace some more usages of Wikimedia\(suppress|restore)Warnings()Reedy2022-02-241-4/+6
| | | | Change-Id: I2eb133a9e32116cd155f59086245bc4d15ecbfcc
* Remove some more comments that literally repeat the codeThiemo Kreuz2021-12-091-1/+1
| | | | | | | | Nothing to learn from these. You can find a longer explanation in the comments in I93751e6. Change-Id: I195aae70fc282b58be5b18160783f27d38605d15
* Using @return never documentation on always-throw-functionUmherirrender2021-09-071-0/+5
| | | | | | | | | | This helps phan to detect unreachable code and also impossible types after the functions. It helps phan to avoid false positives for array keys when the keys are checked before Bug: T240141 Change-Id: I895f70e82b3053a46cd44135b15437e6f82a07b2
* build: Updating mediawiki/mediawiki-phan-config to 0.10.5Umherirrender2020-12-121-2/+0
| | | | Change-Id: I343d2bae626a3903eb1e67c05bf5caef4314b7dd
* Fix more libs PSR12.Properties.ConstantVisibility.NotFoundReedy2020-05-161-11/+11
| | | | Change-Id: If3bac6b0ff6fbb89bfa2b9fa91809135a76c610b
* Minor cleanupsMax Semenik2019-11-031-1/+0
| | | | | | | | | * Identifier case * Returning a void function result * Unused variable * Missing documentation Change-Id: Ibfd2fc5ae1d91c7c9c6a34bcd4523384d3bca576
* Unsuppress other phan issues with low countDaimona Eaytoy2019-08-301-0/+11
| | | | | | | | | And also update approximated counts, which for the most part are lower than reported (hooray!) Bug: T231636 Depends-On: Ica50297ec7c71a81ba2204f9763499da925067bd Change-Id: I78354bf5f0c831108c8f606e50c87cf6bc00d8bd
* Globally unsuppress phan issues with low countDaimona Eaytoy2019-08-301-0/+2
| | | | | | | | | | | | All of these suppression prevent the detection of many common mistakes, and could easily prevent things like T231488. Especially if there are few issues of a given type, it's way better to suppress them inline, instead of disabling them for the whole core. This patch only touches the one with a lower count (although those counts may be out of date). Bug: T231636 Change-Id: Ica50297ec7c71a81ba2204f9763499da925067bd
* mime,logging: Remove unused private methodsDerick Alangi2019-08-291-5/+0
| | | | | | These methods are defined but not used. Change-Id: I91003a9a3f2a56114de5baede6a1034ee4ed8d80
* Make MSCompoundFileReader::readFile platform-agnosticMáté Szabó2019-07-081-1/+1
| | | | | | | | | | | | | | | | | MSCompoundFileReader::readFile uses iconv to convert information given in UTF-16 character set with little-endian byte order to the UTF-8 character set. The input string has no BOM and the byte order is not explicitly given, causing iconv to try to guess the byte order based on the host operating system. This causes the method to return different results for the same file in different environments. This patch explicitly provides the byte order for the input to be converted (UTF-16LE) to ensure portability and predictability. As part of this, move MSCompoundFileReaderTest into the unit test tree. Bug: T225019 Change-Id: I62154897d303b28c288c3a4f2f5456bedcc81852
* build: Updating mediawiki/mediawiki-codesniffer to 24.0.0Kunal Mehta2019-02-071-3/+0
| | | | Change-Id: I66b1775b7c1d36076d9ca78cbeb42787a743f2aa
* Better detection for old MS Office filesTim Starling2019-01-231-0/+355
* Introduce MSCompoundFileReader, which reads the CFB directory and detects the file type from well-known names in the root directory * Do not detect a ZIP file if the EOCDR is not at the end. Other containers, especially CFB files, may contain ZIP files embedded within them in the last 64KB, but this is not a security concern unless the EOCDR is exactly at the end of the file. Bug: T40432 Change-Id: Id5b1a258ccf3c3c8951e32f6b7a5b1bafe941082