backward.php
1 month ago
get_taxonomies_by_object_type.php
1 month ago
pmxe_filter.php
1 month ago
pmxe_functions.php
1 month ago
pmxe_prepare_price.php
1 month ago
pmxe_render_xml_attributes.php
1 month ago
pmxe_render_xml_element.php
1 month ago
pmxe_render_xml_text.php
1 month ago
str_getcsv.php
1 month ago
wp_all_export_check_children_assign.php
1 month ago
wp_all_export_clear_xss.php
1 month ago
wp_all_export_comments_clauses.php
1 month ago
wp_all_export_generate_export_file.php
1 month ago
wp_all_export_get_cpt_name.php
1 month ago
wp_all_export_get_export_format.php
1 month ago
wp_all_export_is_compatible.php
1 month ago
wp_all_export_parse_field_name.php
1 month ago
wp_all_export_posts_join.php
1 month ago
wp_all_export_posts_where.php
1 month ago
wp_all_export_pre_user_query.php
1 month ago
wp_all_export_prepare_template_csv.php
1 month ago
wp_all_export_prepare_template_xml.php
1 month ago
wp_all_export_rand_char.php
1 month ago
wp_all_export_remove_colons.php
1 month ago
wp_all_export_remove_source.php
1 month ago
wp_all_export_reverse_rules_html.php
1 month ago
wp_all_export_rmdir.php
1 month ago
wp_all_export_secure_file.php
1 month ago
wp_all_export_terms_clauses.php
1 month ago
wp_all_export_url_title.php
1 month ago
wp_all_export_write_article.php
1 month ago
wp_redirect_or_javascript.php
1 month ago
wp_all_export_secure_file.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound,WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound,WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- legitimate plugin prefixes (pmxe/PMXE/wpae/Wpae/wp_all_export/wpallexport/XmlExport/CdataStrategy/VariableProductTitle/Soflyy/GF_Export); Plugin Check does not honor phpcs.xml prefix declaration |
| 4 | defined( 'ABSPATH' ) || exit; |
| 5 | |
| 6 | if ( ! function_exists('wp_all_export_secure_file') ){ |
| 7 | |
| 8 | function wp_all_export_secure_file( $targetDir, $ID = false){ |
| 9 | |
| 10 | $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure'); |
| 11 | |
| 12 | if ( $is_secure_import ){ |
| 13 | |
| 14 | $dir = $targetDir . DIRECTORY_SEPARATOR . ( ( $ID ) ? md5( $ID . wp_salt( 'nonce' ) ) : md5( time() . wp_salt( 'nonce' ) ) ); |
| 15 | |
| 16 | // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_mkdir -- export plugin reads/writes its own files in uploads dir, WP_Filesystem not viable for streamed CSV/XML output |
| 17 | if ( ! is_dir($dir) ) @mkdir($dir, 0755); |
| 18 | |
| 19 | // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_is_writable -- export plugin reads/writes its own files in uploads dir, WP_Filesystem not viable for streamed CSV/XML output |
| 20 | if (@is_writable($dir) and @is_dir($dir)){ |
| 21 | $targetDir = $dir; |
| 22 | // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_touch -- export plugin reads/writes its own files in uploads dir, WP_Filesystem not viable for streamed CSV/XML output |
| 23 | @touch( $dir . DIRECTORY_SEPARATOR . 'index.php' ); |
| 24 | } |
| 25 | |
| 26 | } |
| 27 | |
| 28 | return $targetDir; |
| 29 | } |
| 30 | } |