Menu

#148 is_file(): File name is longer than the maximum allowed path length on this platform (4096)

closed
None
2022-04-09
2015-04-27
Tomáš
No

function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
{
if ($str)
{
if (preg_match("/^http:\/\//i",$str) || is_file($str)) //there should be at least some flag to prevent read as a file

Discussion

  • Dennis

    Dennis - 2020-04-23

    I have the same problem:

    Warning: is_file(): File name is longer than the maximum allowed path length on this platform (4096) [...] cross in [...]simplehtmldom/HtmlDocument.php on line 131
    PHP-Version: 7.2.30 FPM

    $doc = new HtmlWeb();
    $html = $doc->load($website);
    
     
  • avibodha

    avibodha - 2021-06-28

    change line 131 in HtmlDocument.php to:
    if (preg_match('/^http:\/\//i', $str) || (strlen($str)<4096 && is_file($str))) {

    check string length before doing is_file(). had same problem on ubuntu.

     
  • LogMANOriginal

    LogMANOriginal - 2022-04-09
    • status: open --> closed
    • assigned_to: LogMANOriginal
     

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.