Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Also update gp_get_import_file_format
  • Loading branch information
swissspidy committed Dec 20, 2023
commit f16ca98de0779424820f714934d19a535b22431b
7 changes: 5 additions & 2 deletions gp-includes/misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,12 +543,15 @@ function gp_gmt_strtotime( $string ) {
* @return object|null A GP_Format child object or null if not found.
*/
function gp_get_import_file_format( $selected_format, $filename ) {
$format = gp_array_get( GP::$formats, $selected_format, null );
$formats = GP::$formats;
unset( $formats['php'] ); // Remove PHP format from the list of formats until we have an import process.

$format = gp_array_get( $formats, $selected_format, null );

if ( ! $format ) {
$matched_ext_len = 0;

foreach ( GP::$formats as $format_entry ) {
foreach ( $formats as $format_entry ) {
$format_extensions = $format_entry->get_file_extensions();

foreach ( $format_extensions as $extension ) {
Expand Down