backward.php
2 months ago
get_taxonomies_by_object_type.php
2 months ago
pmxe_filter.php
2 months ago
pmxe_functions.php
2 months ago
pmxe_prepare_price.php
2 months ago
pmxe_render_xml_attributes.php
2 months ago
pmxe_render_xml_element.php
2 months ago
pmxe_render_xml_text.php
2 months ago
str_getcsv.php
2 months ago
wp_all_export_check_children_assign.php
2 months ago
wp_all_export_clear_xss.php
2 months ago
wp_all_export_comments_clauses.php
2 months ago
wp_all_export_generate_export_file.php
2 months ago
wp_all_export_get_cpt_name.php
2 months ago
wp_all_export_get_export_format.php
2 months ago
wp_all_export_is_compatible.php
2 months ago
wp_all_export_parse_field_name.php
2 months ago
wp_all_export_posts_join.php
2 months ago
wp_all_export_posts_where.php
2 months ago
wp_all_export_pre_user_query.php
2 months ago
wp_all_export_prepare_template_csv.php
2 months ago
wp_all_export_prepare_template_xml.php
2 months ago
wp_all_export_rand_char.php
2 months ago
wp_all_export_remove_colons.php
2 months ago
wp_all_export_remove_source.php
2 months ago
wp_all_export_reverse_rules_html.php
2 months ago
wp_all_export_rmdir.php
2 months ago
wp_all_export_secure_file.php
2 months ago
wp_all_export_terms_clauses.php
2 months ago
wp_all_export_url_title.php
2 months ago
wp_all_export_write_article.php
2 months ago
wp_redirect_or_javascript.php
2 months ago
str_getcsv.php
24 lines
| 1 | <?php |
| 2 | |
| 3 | defined( 'ABSPATH' ) || exit; |
| 4 | |
| 5 | if ( ! function_exists('str_getcsv')): |
| 6 | /** |
| 7 | * str_getcsv function for PHP less than 5.3 |
| 8 | * @see http://php.net/manual/en/function.str-getcsv.php |
| 9 | * NOTE: function doesn't support escape paramter (in correspondance to fgetcsv not supporting it prior 5.3) |
| 10 | */ |
| 11 | function str_getcsv($input, $delimiter=',', $enclosure='"') { |
| 12 | if ("" == $delimiter) $delimiter = ','; |
| 13 | // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen -- export plugin reads/writes its own files in uploads dir, WP_Filesystem not viable for streamed CSV/XML output |
| 14 | $temp = fopen("php://memory", "rw"); |
| 15 | // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fwrite -- export plugin reads/writes its own files in uploads dir, WP_Filesystem not viable for streamed CSV/XML output |
| 16 | fwrite($temp, $input); |
| 17 | fseek($temp, 0); |
| 18 | $r = fgetcsv($temp, strlen($input), $delimiter, $enclosure, '\\'); |
| 19 | // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose -- export plugin reads/writes its own files in uploads dir, WP_Filesystem not viable for streamed CSV/XML output |
| 20 | fclose($temp); |
| 21 | return $r; |
| 22 | } |
| 23 | |
| 24 | endif; |