Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-content
/
plugins
/
loco-translate
/
src
/
ajax
/
File Content:
DownloadController.php
<?php /** * Ajax "download" route, for outputting raw gettext file contents. */ class Loco_ajax_DownloadController extends Loco_mvc_AjaxController { /** * {@inheritdoc} */ public function render(){ $post = $this->validate(); // we need a path, but it may not need to exist $file = new Loco_fs_File( $this->get('path') ); $file->normalize( loco_constant( 'WP_CONTENT_DIR') ); // Restrict download to gettext file formats $ext = Loco_gettext_Data::ext($file); // posted source must be clean and must parse as whatever the file extension claims to be if( $raw = $post->source ){ // compile source if target is MO if( 'mo' === $ext ) { $raw = Loco_gettext_Data::fromSource($raw)->msgfmt(); } } // else file can be output directly if it exists. // note that files on disk will not be parsed or manipulated. they will download strictly as-is else if( $file->exists() ){ $raw = $file->getContents(); } // else we can't do anything except bail else { throw new Loco_error_Exception('File not found and no source posted'); } // Observe UTF-8 BOM setting for PO and POT only if( 'po' === $ext || 'pot' === $ext ){ $has_bom = "\xEF\xBB\xBF" === substr($raw,0,3); $use_bom = (bool) Loco_data_Settings::get()->po_utf8_bom; // only alter file if valid UTF-8. Deferring detection overhead until required if( $has_bom !== $use_bom && preg_match('//u',$raw) ){ if( $use_bom ){ $raw = "\xEF\xBB\xBF".$raw; // prepend } else { $raw = substr($raw,3); // strip bom } } } return $raw; } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
common
---
0755
ApisController.php
4590 bytes
0644
DiffController.php
1914 bytes
0644
DownloadConfController.php
945 bytes
0644
DownloadController.php
1900 bytes
0644
FsConnectController.php
7112 bytes
0644
FsReferenceController.php
7772 bytes
0644
MsginitController.php
6683 bytes
0644
PingController.php
647 bytes
0644
SaveController.php
3455 bytes
0644
SyncController.php
5940 bytes
0644
UploadController.php
3685 bytes
0644
XgettextController.php
2906 bytes
0644
class-sitemaps-admin.php
3665 bytes
0644
class-wpseo-statistics.php
1443 bytes
0644
class.pack.database.php
30838 bytes
0644
ctrl.package.php
17073 bytes
0644
duplicator.php
1781 bytes
0644
elFinderPlugin.php
3331 bytes
0644
elFinderVolumeDropbox.class.php
41782 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500-20260706072032.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class.php
48544 bytes
0644
exceptions.php
708 bytes
0644
manager.php
14659 bytes
0644
module.php
1297 bytes
0644
setup.php
2699 bytes
0644
N4ST4R_ID | Naxtarrr