ErrorException: Invalid argument supplied for foreach()

Debugger::handle_error (2, "Invalid argument supplied for foreach()", "/home/cerezomo/not/apps/blog/handlers/tag.php", 33, array(13))

33/home/cerezomo/not/apps/blog/handlers/tag.php

31. }
32.
33. foreach ($posts as $post) {
34.     $post->url '/blog/post/' $post->id '/' URLify::filter ($post->title);
35.     $post->tag_list = (strlen ($post->tags) > 0) ? explode (','$post->tags) : array ();

require ("/home/cerezomo/not/apps/blog/handlers/tag.php")

471/home/cerezomo/not/lib/Controller.php

469.         // Run the handler and get its output
470.         ob_start ();
471.         $res = require ($handler);
472.         $out ob_get_clean ();
473.         if (is_string ($res) && strlen ($res) > 0) {

Controller->handle ("apps/blog/handlers/tag.php", false)

175/home/cerezomo/not/lib/FrontController.php

173.             $handler $controller->route ($_SERVER['REQUEST_URI']);
174.         }
175.         $page->body $controller->handle ($handlerfalse);
176.
177.         /**

FrontController::run (array(1), 1)

34/home/cerezomo/not/index.php

32. $argc = isset ($argc) ? $argc null;
33. $argv = isset ($argv) ? $argv null;
34. return FrontController::run ($argv$argc);

Error Context

$_COOKIE = array (
    
"mediaplan" => "R3721199693"
);

$_SERVER = array (
    
"PATH" => "/usr/local/bin:/usr/bin:/bin"
    "REDIRECT_STATUS" 
=> 200
    
"UNIQUE_ID" => "XMF65goAP4wAADAqedwAAABB"
    "GEOIP_COUNTRY_CODE" 
=> "US"
    "GEOIP_COUNTRY_NAME" 
=> "United States"
    "GEOIP_REGION" 
=> "WA"
    "GEOIP_CITY" 
=> "Seattle"
    "GEOIP_DMA_CODE" 
=> 819
    
"GEOIP_AREA_CODE" => 206
    
"GEOIP_LATITUDE" => 47.634399
    
"GEOIP_LONGITUDE" => -122.342201
    
"SCRIPT_URL" => "/blog/tag/u.s.a"
    "SCRIPT_URI" 
=> "http://noteduermas.com/blog/tag/u.s.a"
    "CFG_CLUSTER" 
=> "cluster006"
    "ENVIRONMENT" 
=> "production"
    "APP_ENGINE_VERSION" 
=> 7.0
    
"APP_ENGINE" => "phpcgi"
    "HTTP_HOST" 
=> "noteduermas.com"
    "HTTP_COOKIE" 
=> "mediaplan=R3721199693"
    "HTTP_X_PREDICTOR" 
=> 1
    
"HTTP_CONNECTION" => "close"
    "HTTP_USER_AGENT" 
=> "CCBot/2.0 (https://commoncrawl.org/faq/)"
    "HTTP_ACCEPT" 
=> "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
    "HTTP_ACCEPT_LANGUAGE" 
=> "en-US,en;q=0.5"
    "HTTP_IF_MODIFIED_SINCE" 
=> "Wed, 16 Jan 2019 06:44:40 GMT"
    "HTTP_ACCEPT_ENCODING" 
=> "gzip"
    "HTTP_X_FORWARDED_FOR" 
=> "3.90.56.90"
    "HTTP_X_FORWARDED_PORT" 
=> 80
    
"HTTP_X_FORWARDED_PROTO" => "http"
    "HTTP_X_REMOTE_PORT" 
=> 49882
    
"HTTP_X_REMOTE_IP" => "3.90.56.90"
    "HTTP_X_REMOTE_PROTO" 
=> "http"
    "HTTP_FORWARDED" 
=> "for=3.90.56.90; proto=http; host=noteduermas.com"
    "HTTP_REMOTE_PORT" 
=> 49882
    
"HTTP_X_CDN_ANY_IP" => "87.98.231.17"
    "HTTP_REMOTE_IP" 
=> "3.90.56.90"
    "SERVER_SIGNATURE" 
=> ""
    "SERVER_SOFTWARE" 
=> "Apache"
    "SERVER_NAME" 
=> "noteduermas.com"
    "SERVER_ADDR" 
=> "10.0.97.81"
    "SERVER_PORT" 
=> 80
    
"REMOTE_ADDR" => "3.90.56.90"
    "DOCUMENT_ROOT" 
=> "/home/cerezomo/not"
    "SERVER_ADMIN" 
=> "postmaster@noteduermas.com"
    "SCRIPT_FILENAME" 
=> "/home/cerezomo/not/index.php"
    "REMOTE_PORT" 
=> 34782
    
"REDIRECT_URL" => "/blog/tag/u.s.a"
    "GATEWAY_INTERFACE" 
=> "CGI/1.1"
    "SERVER_PROTOCOL" 
=> "HTTP/1.1"
    "REQUEST_METHOD" 
=> "GET"
    "QUERY_STRING" 
=> ""
    "REQUEST_URI" 
=> "/blog/tag/u.s.a"
    "SCRIPT_NAME" 
=> "/index.php"
    "HOME" 
=> "/homez.537/cerezomo"
    "PWD" 
=> "/homez.537/cerezomo/not"
    "UID" 
=> "cerezomo"
    "PHP_SELF" 
=> "/index.php"
    "REQUEST_TIME_FLOAT" 
=> 1556183782.1476
    
"REQUEST_TIME" => 1556183782
    
"argv" => array (
        
"index.php"
    
)
    
"argc" => 1
);

$handler "apps/blog/handlers/tag.php";

$internal false;

$data = array ();

$page Page (
    
$head "";
    
$tail "";
    
$title "";
    
$_menu_title "";
    
$_window_title "";
    
$body "";
    
$layout "default";
    
$scripts = array ();
    
$is_being_rendered false;
    
$cache_control true;
    
$preview false;
    
$id "blog";
    
$limit 10;
    
$tag "u.s.a";
    
$num 0;
    
$offset 0;
    
$count false;
    
$last 1;
    
$more false;
    
$next 2;
);

$tpl Template (
    
$charset "UTF-8";
    
$cache_folder "cache";
    
$layouts_folder "layouts";
    
$view_folders "apps/%s/views/%s";
    
$default_layout "default";
    
$file_extension "html";
    
$controller Controller (
        
$params = array (
            
"u.s.a"
        
);
        
$internal false;
        
$data = array ();
        
$cli false;
        
$put_data = ;
        
$app "blog";
        
$uri "blog/tag/u.s.a";
        
$chunked false;
        
$cache false;
        
$status_code false;
);
);

$cache Cache (
    
$dir "cache/datastore";
);

$i18n I18n (
    
$language "en";
    
$locale = ;
    
$directory "lang";
    
$lang_hash = array (
        
"en" => array (
            
"Home" => "Home"
        
)
    );
    
$hash_order = array (
        
"en"
    
);
    
$charset "UTF-8";
    
$fullname "English";
    
$day_date_format "dddd, mmmm d, yyyy";
    
$short_day_date_format "ddd, mmm d";
    
$date_format "mmmm d, yyyy";
    
$short_format "mmm d";
    
$time_format "h:MMa";
    
$year_format "yyyy";
    
$fallbacks = array ();
    
$languages = array (
        
"de" => array (
            
"name" => "Deutsch"
            "code" 
=> "de"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "default" 
=> ""
            "date_format" 
=> "d mmmm yyyy"
            "short_format" 
=> "d mmm"
            "time_format" 
=> "HH:MM"
        
)
        
"en" => array (
            
"name" => "English"
            "code" 
=> "en"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"fr" => array (
            
"name" => "Français"
            "code" 
=> "fr"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"it" => array (
            
"name" => "Italiano"
            "code" 
=> "it"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "default" 
=> ""
        
)
        
"nl" => array (
            
"name" => "Nederlands"
            "code" 
=> "nl"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"pt_br" => array (
            
"name" => "Português brasileiro"
            "code" 
=> "pt"
            "locale" 
=> "br"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "date_format" 
=> "mmmm d, yyyy"
            "short_format" 
=> "mmm d"
            "time_format" 
=> "h:MMa"
        
)
        
"sl_si" => array (
            
"name" => "Slovenščina"
            "code" 
=> "sl"
            "locale" 
=> "si"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"es_es" => array (
            
"name" => "spanish"
            "code" 
=> "es"
            "locale" 
=> "es"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> 1
            
"date_format" => "mmmm d, yyyy"
            "short_format" 
=> "mmm d"
            "time_format" 
=> "h:MMa"
        
)
        
"cs" => array (
            
"name" => "Česky"
            "code" 
=> "cs"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "locale" 
=> ""
            "date_format" 
=> "d.mmmm yyyy"
            "short_format" 
=> "dd.mm.yyyy"
            "time_format" 
=> "HH:MM"
        
)
        
"ru" => array (
            
"name" => "Русский"
            "code" 
=> "ru"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "date_format" 
=> "dd mmmm yyyy"
            "short_format" 
=> "dd mmm"
            "time_format" 
=> "HH:MM"
        
)
        
"uk" => array (
            
"name" => "Українська"
            "code" 
=> "uk"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "date_format" 
=> "dd mmmm yyyy"
            "short_format" 
=> "dd mmm"
            "time_format" 
=> "HH:mm"
        
)
        
"ja" => array (
            
"name" => "日本語"
            "code" 
=> "ja"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"zh" => array (
            
"name" => "简体中文"
            "code" 
=> "zh"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
    );
    
$cookieName "lang";
    
$url_includes_lang false;
    
$new_request_uri "";
    
$prefix "";
    
$negotiation "http";
    
$error = ;
    
$default "es_es";
);

$cache_uri "_c_blog_tag_u.s.a";

$out false;

$appconf = array (
    
"Blog" => array (
        
"title" => "Blog"
        "layout" 
=> "default"
        "post_layout" 
=> "bootstrap_indice"
        "include_in_nav" 
=> 1
        
"preview_chars" => 600
        
"post_format" => "html"
        "comments" 
=> "facebook"
        "show_related_posts" 
=> 1
        
"disqus_shortname" => ""
    
)
    
"Social Buttons" => array (
        
"twitter" => 1
        
"facebook" => 1
        
"google" => 1
    
)
    
"Custom Handlers" => array (
        
"blog/index" => "blog/index"
        "blog/post" 
=> "blog/post"
    
)
    
"Admin" => array (
        
"handler" => "blog/admin"
        "name" 
=> "Blog Posts"
        "install" 
=> "blog/upgrade"
        "upgrade" 
=> "blog/upgrade"
        "version" 
=> "1.1.4-stable"
        "sitemap" 
=> "blog\Post::sitemap"
        "search" 
=> "blog\Post::search"
    
)
);

$preview_chars 600;

$p blog\Post (
    
$table "#prefix#blog_post";
    
$_extended_field "extra";
    
$_extended false;
    
$key "id";
    
$keyval false;
    
$data = array ();
    
$fields = array ();
    
$error false;
    
$is_new true;
    
$query_fields "*";
    
$query_order "";
    
$query_group "";
    
$query_filters = array ();
    
$query_params = array ();
    
$query_having = array ();
    
$query_from false;
    
$verify = array ();
    
$failed = array ();
);

$posts false;