svn: /web/doc-editor/trunk/php/ ExtJsController.php

From: Date: Sun, 05 Jun 2011 19:49:44 +0000
Subject: svn: /web/doc-editor/trunk/php/ ExtJsController.php
Groups: php.doc.web 
Request: Send a blank email to doc-web+get-1999@lists.php.net to get a copy of this message
yannick Sun, 05 Jun 2011 19:49:44 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=311841 Log: Only check xml when we save .xml file Changed paths: U web/doc-editor/trunk/php/ExtJsController.php Modified: web/doc-editor/trunk/php/ExtJsController.php =================================================================== --- web/doc-editor/trunk/php/ExtJsController.php 2011-06-05 19:37:07 UTC (rev 311840) +++ web/doc-editor/trunk/php/ExtJsController.php 2011-06-05 19:49:44 UTC (rev 311841) @@ -861,18 +861,19 @@ // Replace   by space $fileContent = str_replace(" ", "", $fileContent); - // We check the Xml consistence - $xmlError = $tx->checkForError($fileContent); - - if( $xmlError != 'no_error' ) { - return JsonResponseBuilder::failure( - array( - 'XmlError' => $xmlError - ) - ); + // We check the Xml consistence only for .xml file + if( substr($fileName, -3) == 'xml' ) { + $xmlError = $tx->checkForError($fileContent); + + if( $xmlError != 'no_error' ) { + return JsonResponseBuilder::failure( + array( + 'XmlError' => $xmlError + ) + ); + } } - // Get file object $file = new File($fileLang, $filePath.$fileName);

« previous php.doc.web (#1999) next »